diff options
author | John Crispin <john@phrozen.org> | 2016-12-25 20:11:34 +0100 |
---|---|---|
committer | John Crispin <john@phrozen.org> | 2017-08-05 08:46:36 +0200 |
commit | 74d00a8c3849c1340efd713eb94b786e304c201f (patch) | |
tree | de481743de61c34da96ab5f9dba3af3edcfb8260 /target/linux/generic/backport-4.9/080-0001-leds-core-add-OF-variants-of-LED-registering-functio.patch | |
parent | de350550ef648d9728351b986b0516fa29465c45 (diff) | |
download | mtk-20170518-74d00a8c3849c1340efd713eb94b786e304c201f.zip mtk-20170518-74d00a8c3849c1340efd713eb94b786e304c201f.tar.gz mtk-20170518-74d00a8c3849c1340efd713eb94b786e304c201f.tar.bz2 |
kernel: split patches folder up into backport, pending and hack folders
* properly format/comment all patches
* merge debloat patches
* merge Kconfig patches
* merge swconfig patches
* merge hotplug patches
* drop 200-fix_localversion.patch - upstream
* drop 222-arm_zimage_none.patch - unused
* drop 252-mv_cesa_depends.patch - no longer required
* drop 410-mtd-move-forward-declaration-of-struct-mtd_info.patch - unused
* drop 661-fq_codel_keep_dropped_stats.patch - outdated
* drop 702-phy_add_aneg_done_function.patch - upstream
* drop 840-rtc7301.patch - unused
* drop 841-rtc_pt7c4338.patch - upstream
* drop 921-use_preinit_as_init.patch - unused
* drop spio-gpio-old and gpio-mmc - unused
Signed-off-by: John Crispin <john@phrozen.org>
Diffstat (limited to 'target/linux/generic/backport-4.9/080-0001-leds-core-add-OF-variants-of-LED-registering-functio.patch')
-rw-r--r-- | target/linux/generic/backport-4.9/080-0001-leds-core-add-OF-variants-of-LED-registering-functio.patch | 120 |
1 files changed, 120 insertions, 0 deletions
diff --git a/target/linux/generic/backport-4.9/080-0001-leds-core-add-OF-variants-of-LED-registering-functio.patch b/target/linux/generic/backport-4.9/080-0001-leds-core-add-OF-variants-of-LED-registering-functio.patch new file mode 100644 index 0000000..5b1b307 --- /dev/null +++ b/target/linux/generic/backport-4.9/080-0001-leds-core-add-OF-variants-of-LED-registering-functio.patch @@ -0,0 +1,120 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl> +Date: Mon, 6 Mar 2017 06:19:44 +0100 +Subject: [PATCH] leds: core: add OF variants of LED registering functions +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +These new functions allow passing an additional device_node argument +that will be internally set for created LED device. Thanks to this LED +core code and triggers will be able to access DT node for reading extra +info. + +The easiest solution for achieving this was reworking old functions to +more generic ones & adding simple defines for API compatibility. + +Signed-off-by: Rafał Miłecki <rafal@milecki.pl> +Acked-by: Pavel Machek <pavel@ucw.cz> +Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com> +--- + drivers/leds/led-class.c | 26 ++++++++++++++++---------- + include/linux/leds.h | 14 ++++++++++---- + 2 files changed, 26 insertions(+), 14 deletions(-) + +--- a/drivers/leds/led-class.c ++++ b/drivers/leds/led-class.c +@@ -181,11 +181,14 @@ static int led_classdev_next_name(const + } + + /** +- * led_classdev_register - register a new object of led_classdev class. +- * @parent: The device to register. ++ * of_led_classdev_register - register a new object of led_classdev class. ++ * ++ * @parent: parent of LED device + * @led_cdev: the led_classdev structure for this device. ++ * @np: DT node describing this LED + */ +-int led_classdev_register(struct device *parent, struct led_classdev *led_cdev) ++int of_led_classdev_register(struct device *parent, struct device_node *np, ++ struct led_classdev *led_cdev) + { + char name[64]; + int ret; +@@ -198,6 +201,7 @@ int led_classdev_register(struct device + led_cdev, led_cdev->groups, "%s", name); + if (IS_ERR(led_cdev->dev)) + return PTR_ERR(led_cdev->dev); ++ led_cdev->dev->of_node = np; + + if (ret) + dev_warn(parent, "Led %s renamed to %s due to name collision", +@@ -228,7 +232,7 @@ int led_classdev_register(struct device + + return 0; + } +-EXPORT_SYMBOL_GPL(led_classdev_register); ++EXPORT_SYMBOL_GPL(of_led_classdev_register); + + /** + * led_classdev_unregister - unregisters a object of led_properties class. +@@ -270,12 +274,14 @@ static void devm_led_classdev_release(st + } + + /** +- * devm_led_classdev_register - resource managed led_classdev_register() +- * @parent: The device to register. ++ * devm_of_led_classdev_register - resource managed led_classdev_register() ++ * ++ * @parent: parent of LED device + * @led_cdev: the led_classdev structure for this device. + */ +-int devm_led_classdev_register(struct device *parent, +- struct led_classdev *led_cdev) ++int devm_of_led_classdev_register(struct device *parent, ++ struct device_node *np, ++ struct led_classdev *led_cdev) + { + struct led_classdev **dr; + int rc; +@@ -284,7 +290,7 @@ int devm_led_classdev_register(struct de + if (!dr) + return -ENOMEM; + +- rc = led_classdev_register(parent, led_cdev); ++ rc = of_led_classdev_register(parent, np, led_cdev); + if (rc) { + devres_free(dr); + return rc; +@@ -295,7 +301,7 @@ int devm_led_classdev_register(struct de + + return 0; + } +-EXPORT_SYMBOL_GPL(devm_led_classdev_register); ++EXPORT_SYMBOL_GPL(devm_of_led_classdev_register); + + static int devm_led_classdev_match(struct device *dev, void *res, void *data) + { +--- a/include/linux/leds.h ++++ b/include/linux/leds.h +@@ -109,10 +109,16 @@ struct led_classdev { + struct mutex led_access; + }; + +-extern int led_classdev_register(struct device *parent, +- struct led_classdev *led_cdev); +-extern int devm_led_classdev_register(struct device *parent, +- struct led_classdev *led_cdev); ++extern int of_led_classdev_register(struct device *parent, ++ struct device_node *np, ++ struct led_classdev *led_cdev); ++#define led_classdev_register(parent, led_cdev) \ ++ of_led_classdev_register(parent, NULL, led_cdev) ++extern int devm_of_led_classdev_register(struct device *parent, ++ struct device_node *np, ++ struct led_classdev *led_cdev); ++#define devm_led_classdev_register(parent, led_cdev) \ ++ devm_of_led_classdev_register(parent, NULL, led_cdev) + extern void led_classdev_unregister(struct led_classdev *led_cdev); + extern void devm_led_classdev_unregister(struct device *parent, + struct led_classdev *led_cdev); |