gpio-twl4030: add new device tree properties
Subsystems (2)
cover gpio-twl4030: add new device tree properties
A number of platform data are missing when using twl4030/gpio from a device tree. This patchset adds the missing properties, updates existing device trees and updates the documentation of bindings. It mainly enables LEDA and LEDB outputs, as well as pullups / pulldowns on GPIOs.
The 1st patch changes the device driver.
The 2nd patch updates the device trees for BeagleBoard and omap3-evm. The 3rd patch updates the documentation of bindings.
Tested:
- Boot tested on Gumstix Overo for "ti,use-leds". Corresponding patch is not provided, as the device tree is not yet merged. The support can be found in the git tree [1], branch omap3-devel-dt-overo.
- Device trees for BeagleBoard and omap3-evm were compiled, but not tested on hardware.
Would someone be willing to test on BeagleBoard / omap3-evm?
Regards,
Florian
[1] https://github.com/vaussard/linux.git (not safe for merge)
Florian Vaussard (3):
gpio-twl4030: get platform data from device tree
gpio-twl4030: new dt properties for BeagleBoard and omap3-EVM
gpio-twl4030: updates the bindings for new dt properties
.../devicetree/bindings/gpio/gpio-twl4030.txt | 6 ++ arch/arm/boot/dts/omap3-beagle.dts | 20 +++++ arch/arm/boot/dts/omap3-evm.dts | 13 +++ drivers/gpio/gpio-twl4030.c | 86 +++++++++++++------ 4 files changed, 98 insertions(+), 27 deletions(-)
Signature · 1 line
1.7.5.4
PATCH 1/3 gpio-twl4030: get platform data from device tree
Adds a number of missing properties to the device tree of twl4030/gpio:
- "ti,use-leds" -> .use_leds - "ti,debounce" -> .debounce - "ti,mmc-cd" -> .mmc_cd - "ti,pullups" -> .pullups
- "ti,pulldowns" -> .pulldowns
--- drivers/gpio/gpio-twl4030.c | 86 +++++++++++++++++++++++++++++------------- 1 files changed, 59 insertions(+), 27 deletions(-)
drivers/gpio/gpio-twl4030.c +59 -27
@@ -395,6 +395,33 @@ static int __devinit gpio_twl4030_debounce(u32 debounce, u8 mmc_cd)static int gpio_twl4030_remove (struct platform_device *pdev); +static struct twl4030_gpio_platform_data *of_gpio_twl4030 (struct device *dev) +{ +struct twl4030_gpio_platform_data *omap_twl_info; +const char *of_use_leds; + + omap_twl_info =devm_kzalloc (dev,sizeof (*omap_twl_info),GFP_KERNEL ); +if (!omap_twl_info) +return NULL ; + + omap_twl_info->gpio_base =-1 ; + +of_property_read_string (dev->of_node,"ti,use-leds" , &of_use_leds); +if (!strcmp (of_use_leds,"true" )) + omap_twl_info->use_leds = true; + +of_property_read_u32 (dev->of_node,"ti,debounce" , + &omap_twl_info->debounce); +of_property_read_u32 (dev->of_node,"ti,mmc-cd" , + (u32 *)&omap_twl_info->mmc_cd); +of_property_read_u32 (dev->of_node,"ti,pullups" , + &omap_twl_info->pullups); +of_property_read_u32 (dev->of_node,"ti,pulldowns" , + &omap_twl_info->pulldowns); + +return omap_twl_info; +} +static int __devinit gpio_twl4030_probe (struct platform_device *pdev) {struct twl4030_gpio_platform_data *pdata = pdev->dev.platform_data;
@@ -423,39 +450,44 @@ static int __devinit gpio_twl4030_probe(struct platform_device *pdev) twl4030_gpio_irq_base = irq_base; no_irqs: - twl_gpiochip.base =-1 ; twl_gpiochip.ngpio =TWL4030_GPIO_MAX ; twl_gpiochip.dev = &pdev->dev; -if (pdata) { - twl_gpiochip.base = pdata->gpio_base; +if (node) + pdata =of_gpio_twl4030 (&pdev->dev); -/* -* NOTE: boards may waste power if they don't set pullups -* and pulldowns correctly ... default for non-ULPI pins is -* pulldown, and some other pins may have external pullups -* or pulldowns. Careful! -*/ - ret =gpio_twl4030_pulls (pdata->pullups, pdata->pulldowns); -if (ret) -dev_dbg (&pdev->dev,"pullups %.05x %.05x --> %d\n" , - pdata->pullups, pdata->pulldowns, - ret); - - ret =gpio_twl4030_debounce (pdata->debounce, pdata->mmc_cd); -if (ret) -dev_dbg (&pdev->dev,"debounce %.03x %.01x --> %d\n" , - pdata->debounce, pdata->mmc_cd, - ret); - -/* -* NOTE: we assume VIBRA_CTL.VIBRA_EN, in MODULE_AUDIO_VOICE, -* is (still) clear if use_leds is set. -*/ -if (pdata->use_leds) - twl_gpiochip.ngpio +=2 ; +if (pdata ==NULL ) { +dev_err (&pdev->dev,"Platform data is missing\n" ); +return -ENXIO ; } + twl_gpiochip.base = pdata->gpio_base; + +/* +* NOTE: boards may waste power if they don't set pullups +* and pulldowns correctly ... default for non-ULPI pins is +* pulldown, and some other pins may have external pullups +* or pulldowns. Careful! +*/ + ret =gpio_twl4030_pulls (pdata->pullups, pdata->pulldowns); +if (ret) +dev_dbg (&pdev->dev,"pullups %.05x %.05x --> %d\n" , + pdata->pullups, pdata->pulldowns, + ret); + + ret =gpio_twl4030_debounce (pdata->debounce, pdata->mmc_cd); +if (ret) +dev_dbg (&pdev->dev,"debounce %.03x %.01x --> %d\n" , + pdata->debounce, pdata->mmc_cd, + ret); + +/* +* NOTE: we assume VIBRA_CTL.VIBRA_EN, in MODULE_AUDIO_VOICE, +* is (still) clear if use_leds is set. +*/ +if (pdata->use_leds) + twl_gpiochip.ngpio +=2 ; + ret =gpiochip_add (&twl_gpiochip);if (ret <0 ) {dev_err (&pdev->dev,"could not register gpiochip, %d\n" , ret);
Signature · 1 line
1.7.5.4
PATCH 1/3 gpio-twl4030: get platform data from device tree
Quoted 26 lines · Florian Vaussard
Adds a number of missing properties to the device tree of twl4030/gpio:
- "ti,use-leds" -> .use_leds - "ti,debounce" -> .debounce - "ti,mmc-cd" -> .mmc_cd - "ti,pullups" -> .pullups- "ti,pulldowns" -> .pulldowns
Signed-off-by Florian Vaussard <[email protected]>--- drivers/gpio/gpio-twl4030.c | 86 +++++++++++++++++++++++++++++------------- 1 files changed, 59 insertions(+), 27 deletions(-)drivers/gpio/gpio-twl4030.c +5
-0@@ -395,6 +395,33 @@ static int __devinit gpio_twl4030_debounce(u32 debounce, u8 mmc_cd)static int gpio_twl4030_remove (struct platform_device *pdev); +static struct twl4030_gpio_platform_data *of_gpio_twl4030 (struct device *dev) +{ +struct twl4030_gpio_platform_data *omap_twl_info; +const char *of_use_leds; +
drivers/gpio/gpio-twl4030.c static int __devinit gpio_twl4030_debounce(u32 debounce, u8 mmc_cd) · line 412
Quoted 10 lines
drivers/gpio/gpio-twl4030.c +10
-0+ omap_twl_info =devm_kzalloc (dev,sizeof (*omap_twl_info),GFP_KERNEL ); +if (!omap_twl_info) +return NULL ; + + omap_twl_info->gpio_base =-1 ; + +of_property_read_string (dev->of_node,"ti,use-leds" , &of_use_leds); +if (!strcmp (of_use_leds,"true" )) + omap_twl_info->use_leds = true; +
You can replace this with
omap_twl_info->use_leds = of_property_read_bool(dev->of_node, "ti,use-leds");
Otherwise looks OK to me, also I have tested it on OMAP3EVM.
Tested-&-Acked-By: Vaibhav Hiremath <[email protected]>
Thanks,
Vaibhav
Quoted 88 lines
drivers/gpio/gpio-twl4030.c +44
-27+of_property_read_u32 (dev->of_node,"ti,debounce" , + &omap_twl_info->debounce); +of_property_read_u32 (dev->of_node,"ti,mmc-cd" , + (u32 *)&omap_twl_info->mmc_cd); +of_property_read_u32 (dev->of_node,"ti,pullups" , + &omap_twl_info->pullups); +of_property_read_u32 (dev->of_node,"ti,pulldowns" , + &omap_twl_info->pulldowns); + +return omap_twl_info; +} +static int __devinit gpio_twl4030_probe (struct platform_device *pdev) {struct twl4030_gpio_platform_data *pdata = pdev->dev.platform_data;@@ -423,39 +450,44 @@ static int __devinit gpio_twl4030_probe(struct platform_device *pdev) twl4030_gpio_irq_base = irq_base; no_irqs: - twl_gpiochip.base =-1 ; twl_gpiochip.ngpio =TWL4030_GPIO_MAX ; twl_gpiochip.dev = &pdev->dev; -if (pdata) { - twl_gpiochip.base = pdata->gpio_base; +if (node) + pdata =of_gpio_twl4030 (&pdev->dev); -/* -* NOTE: boards may waste power if they don't set pullups -* and pulldowns correctly ... default for non-ULPI pins is -* pulldown, and some other pins may have external pullups -* or pulldowns. Careful! -*/ - ret =gpio_twl4030_pulls (pdata->pullups, pdata->pulldowns); -if (ret) -dev_dbg (&pdev->dev,"pullups %.05x %.05x --> %d\n" , - pdata->pullups, pdata->pulldowns, - ret); - - ret =gpio_twl4030_debounce (pdata->debounce, pdata->mmc_cd); -if (ret) -dev_dbg (&pdev->dev,"debounce %.03x %.01x --> %d\n" , - pdata->debounce, pdata->mmc_cd, - ret); - -/* -* NOTE: we assume VIBRA_CTL.VIBRA_EN, in MODULE_AUDIO_VOICE, -* is (still) clear if use_leds is set. -*/ -if (pdata->use_leds) - twl_gpiochip.ngpio +=2 ; +if (pdata ==NULL ) { +dev_err (&pdev->dev,"Platform data is missing\n" ); +return -ENXIO ; } + twl_gpiochip.base = pdata->gpio_base; + +/* +* NOTE: boards may waste power if they don't set pullups +* and pulldowns correctly ... default for non-ULPI pins is +* pulldown, and some other pins may have external pullups +* or pulldowns. Careful! +*/ + ret =gpio_twl4030_pulls (pdata->pullups, pdata->pulldowns); +if (ret) +dev_dbg (&pdev->dev,"pullups %.05x %.05x --> %d\n" , + pdata->pullups, pdata->pulldowns, + ret); + + ret =gpio_twl4030_debounce (pdata->debounce, pdata->mmc_cd); +if (ret) +dev_dbg (&pdev->dev,"debounce %.03x %.01x --> %d\n" , + pdata->debounce, pdata->mmc_cd, + ret); + +/* +* NOTE: we assume VIBRA_CTL.VIBRA_EN, in MODULE_AUDIO_VOICE, +* is (still) clear if use_leds is set. +*/ +if (pdata->use_leds) + twl_gpiochip.ngpio +=2 ; + ret =gpiochip_add (&twl_gpiochip);if (ret <0 ) {dev_err (&pdev->dev,"could not register gpiochip, %d\n" , ret);
PATCH 1/3 gpio-twl4030: get platform data from device tree
Quoted 42 lines · Florian Vaussard
Quoted 26 lines
Adds a number of missing properties to the device tree of twl4030/gpio:
- "ti,use-leds" -> .use_leds - "ti,debounce" -> .debounce - "ti,mmc-cd" -> .mmc_cd - "ti,pullups" -> .pullups- "ti,pulldowns" -> .pulldowns
Signed-off-by Florian Vaussard <[email protected]>--- drivers/gpio/gpio-twl4030.c | 86 +++++++++++++++++++++++++++++------------- 1 files changed, 59 insertions(+), 27 deletions(-)drivers/gpio/gpio-twl4030.c +5
-0@@ -395,6 +395,33 @@ static int __devinit gpio_twl4030_debounce(u32 debounce, u8 mmc_cd)static int gpio_twl4030_remove (struct platform_device *pdev); +static struct twl4030_gpio_platform_data *of_gpio_twl4030 (struct device *dev) +{ +struct twl4030_gpio_platform_data *omap_twl_info; +const char *of_use_leds; +drivers/gpio/gpio-twl4030.c static int __devinit gpio_twl4030_debounce(u32 debounce, u8 mmc_cd) · line 412
Quoted 10 lines
drivers/gpio/gpio-twl4030.c +10
-0+ omap_twl_info =devm_kzalloc (dev,sizeof (*omap_twl_info),GFP_KERNEL ); +if (!omap_twl_info) +return NULL ; + + omap_twl_info->gpio_base =-1 ; + +of_property_read_string (dev->of_node,"ti,use-leds" , &of_use_leds); +if (!strcmp (of_use_leds,"true" )) + omap_twl_info->use_leds = true; +You can replace this with
Quoted 6 lines
omap_twl_info->use_leds=of_property_read_bool(dev->of_node, "ti,use-leds");Otherwise looks OK to me, also I have tested it on OMAP3EVM.
Tested-&-Acked-By: Vaibhav Hiremath <[email protected]>
Thank you Vaibhav for your review. I will send a v2 today.
Regards,
Florian
PATCH 1/3 gpio-twl4030: get platform data from device tree
In reply to Florian VaussardQuoted 9 lines · Florian Vaussard
Adds a number of missing properties to the device tree of twl4030/gpio:
- "ti,use-leds" -> .use_leds - "ti,debounce" -> .debounce - "ti,mmc-cd" -> .mmc_cd - "ti,pullups" -> .pullups- "ti,pulldowns" -> .pulldowns
Signed-off-by Florian Vaussard <[email protected]>
Tony will you carry this in the OMAP tree?
Yours,
Linus Walleij
PATCH 1/3 gpio-twl4030: get platform data from device tree
Quoted 11 lines · Linus Walleij
Quoted 8 lines · Florian Vaussard
Adds a number of missing properties to the device tree of twl4030/gpio:
- "ti,use-leds" -> .use_leds - "ti,debounce" -> .debounce - "ti,mmc-cd" -> .mmc_cd - "ti,pullups" -> .pullups- "ti,pulldowns" -> .pulldowns
Quoted 5 lines
Quoted 1 line
Signed-off-by Florian Vaussard <[email protected]>Acked-by Linus Walleij <[email protected]>Tony will you carry this in the OMAP tree?
Yes thanks I can queue this once the acks are there, I guess Benoit is planning to test the series first.
Regards,
Tony
PATCH 2/3 gpio-twl4030: new dt properties for BeagleBoard and omap3-EVM
In reply to Florian VaussardAdd device tree properties for twl4030/gpio, according to the platform data of corresponding boards. This enables the led connected to LEDB output for both boards, as well as pullups/pulldowns on GPIO for the BeagleBoard.
--- arch/arm/boot/dts/omap3-beagle.dts | 20 ++++++++++++++++++++ arch/arm/boot/dts/omap3-evm.dts | 13 +++++++++++++ 2 files changed, 33 insertions(+), 0 deletions(-)
arch/arm/boot/dts/omap3-beagle.dts +20 -0
@@ -17,6 +17,14 @@ device_type = "memory"; reg = <0x80000000 0x20000000>; /* 512 MB */ }; + + leds { + compatible = "gpio-leds"; + pmu_stat { + label = "beagleboard::pmu_stat"; + gpios = <&twl_gpio 19 0>; /* LEDB */ + }; + }; }; &i2c1 {
@@ -67,3 +75,15 @@ &mmc3 { status = "disabled"; }; + +&twl_gpio { + ti,use-leds = "true"; + /* pullups: BIT(1) */ + ti,pullups = <2>; + /* + * pulldowns: + * BIT(2), BIT(6), BIT(7), BIT(8), BIT(13) + * BIT(15), BIT(16), BIT(17) + */ + ti,pulldowns = <238020>; +};
arch/arm/boot/dts/omap3-evm.dts +13 -0
@@ -17,6 +17,15 @@ device_type = "memory"; reg = <0x80000000 0x10000000>; /* 256 MB */ }; + + leds { + compatible = "gpio-leds"; + ledb { + label = "omap3evm::ledb"; + gpios = <&twl_gpio 19 0>; /* LEDB */ + linux,default-trigger = "default-on"; + }; + }; }; &i2c1 {
@@ -46,3 +55,7 @@ reg = <0x5c>; }; }; + +&twl_gpio { + ti,use-leds = "true"; +};
Signature · 1 line
1.7.5.4
PATCH 2/3 gpio-twl4030: new dt properties for BeagleBoard and omap3-EVM
Quoted 35 lines · Florian Vaussard
Add device tree properties for twl4030/gpio, according to the platform data of corresponding boards. This enables the led connected to LEDB output for both boards, as well as pullups/pulldowns on GPIO for the BeagleBoard.
Signed-off-by Florian Vaussard <[email protected]>--- arch/arm/boot/dts/omap3-beagle.dts | 20 ++++++++++++++++++++ arch/arm/boot/dts/omap3-evm.dts | 13 +++++++++++++ 2 files changed, 33 insertions(+), 0 deletions(-)arch/arm/boot/dts/omap3-beagle.dts +9
-0@@ -17,6 +17,14 @@ device_type = "memory"; reg = <0x80000000 0x20000000>; /* 512 MB */ }; + + leds { + compatible = "gpio-leds"; + pmu_stat { + label = "beagleboard::pmu_stat"; + gpios = <&twl_gpio 19 0>; /* LEDB */ + }; + }; }; &i2c1 {@@ -67,3 +75,15 @@ &mmc3 { status = "disabled"; }; +
arch/arm/boot/dts/omap3-beagle.dts line 88
Quoted 10 lines
arch/arm/boot/dts/omap3-beagle.dts +10
-0+&twl_gpio { + ti,use-leds = "true"; + /* pullups: BIT(1) */ + ti,pullups = <2>; + /* + * pulldowns: + * BIT(2), BIT(6), BIT(7), BIT(8), BIT(13) + * BIT(15), BIT(16), BIT(17) + */ + ti,pulldowns = <238020>;
Consider changing above value to hex presentation. Otherwise looks ok to me, also I have tested it on OMAP3EVM.
Tested-&-Acked-By: Vaibhav Hiremath <[email protected]>
Thanks,
Vaibhav
Quoted 30 lines
arch/arm/boot/dts/omap3-beagle.dts +1
-0+};arch/arm/boot/dts/omap3-evm.dts +13
-0@@ -17,6 +17,15 @@ device_type = "memory"; reg = <0x80000000 0x10000000>; /* 256 MB */ }; + + leds { + compatible = "gpio-leds"; + ledb { + label = "omap3evm::ledb"; + gpios = <&twl_gpio 19 0>; /* LEDB */ + linux,default-trigger = "default-on"; + }; + }; }; &i2c1 {@@ -46,3 +55,7 @@ reg = <0x5c>; }; }; + +&twl_gpio { + ti,use-leds = "true"; +};
PATCH 2/3 gpio-twl4030: new dt properties for BeagleBoard and omap3-EVM
In reply to Florian VaussardQuoted 6 lines · Florian Vaussard
Add device tree properties for twl4030/gpio, according to the platform data of corresponding boards. This enables the led connected to LEDB output for both boards, as well as pullups/pulldowns on GPIO for the BeagleBoard.
Signed-off-by Florian Vaussard <[email protected]>
Yours,
Linus Walleij
PATCH 3/3 gpio-twl4030: updates the bindings for new dt properties
In reply to Florian VaussardAdd the new properties to the documentation of bindings.
--- .../devicetree/bindings/gpio/gpio-twl4030.txt | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
Documentation/devicetree/bindings/gpio/gpio-twl4030.txt +6 -0
@@ -11,6 +11,11 @@ Required properties: - interrupt-controller: Mark the device node as an interrupt controller The first cell is the GPIO number. The second cell is not used. +- ti,use-leds : Enables LEDA and LEDB outputs if set to "true" +- ti,debounce : if n-th bit is set, debounces GPIO-n +- ti,mmc-cd : if n-th bit is set, GPIO-n controls VMMC(n+1) +- ti,pullups : if n-th bit is set, set a pullup on GPIO-n +- ti,pulldowns : if n-th bit is set, set a pulldown on GPIO-n Example:
@@ -20,4 +25,5 @@ twl_gpio: gpio { gpio-controller; #interrupt-cells = <2>; interrupt-controller; + ti,use-leds = "true"; };
Signature · 1 line
1.7.5.4
PATCH 3/3 gpio-twl4030: updates the bindings for new dt properties
Quoted 3 lines · Florian Vaussard
Add the new properties to the documentation of bindings.
Signed-off-by Florian Vaussard <[email protected]>
Yours,
Linus Walleij
cover gpio-twl4030: add new device tree properties
In reply to Florian Vaussard+ Vaibhav for the omap3-evm
Hi Florian,
Quoted 2 lines · Florian Vaussard
A number of platform data are missing when using twl4030/gpio from a device tree.
Yeah, I know, I was too lazy when I did the DT conversion at that time :-)
Many thanks for completing the work.
Quoted 8 lines
This patchset adds the missing properties, updates
existing device trees and updates the documentation of bindings. It mainly enables LEDA and LEDB outputs, as well as pullups / pulldowns on GPIOs.The 1st patch changes the device driver.
The 2nd patch updates the device trees for BeagleBoard and omap3-evm. The 3rd patch updates the documentation of bindings.
OK, that's a nit, but in general, you'd better introduce the binding before using it.
The binding documentation could/should be updated along with the driver change that does introduce the binding. You could just merged patch #1 and #3.
Quoted 9 lines
Tested:
- Boot tested on Gumstix Overo for "ti,use-leds". Corresponding patch is not provided, as the device tree is not yet merged. The support can be found in the git tree [1], branch omap3-devel-dt-overo.
- Device trees for BeagleBoard and omap3-evm were compiled, but not tested on hardware.Would someone be willing to test on BeagleBoard / omap3-evm?
I'll try to do it on Beagle. This is the least I can do since I did not do the job myself :-)
I added vaibhav as well since I do not have any omap3-evm board.
Quoted 10 lines
Regards,
Florian[1] https://github.com/vaussard/linux.git (not safe for merge)
Florian Vaussard (3):
gpio-twl4030: get platform data from device tree
gpio-twl4030: new dt properties for BeagleBoard and omap3-EVM
Nit #2: the DTS file does not belong to the gpio subsystem. So you should prefix them using the *convention* for ARM DTS patches:
arm/dts: omap3: Add gpio-twl4030 properties for BeagleBoard and omap3-EVM
Or maybe "ARM: dts: " because it looks like most people are using that nowadays.
The convention for the gpio directory is similar:
gpio/twl4030: get platform data from device tree
Quoted 7 lines
gpio-twl4030: updates the bindings for new dt properties
.../devicetree/bindings/gpio/gpio-twl4030.txt | 6 ++ arch/arm/boot/dts/omap3-beagle.dts | 20 +++++ arch/arm/boot/dts/omap3-evm.dts | 13 +++ drivers/gpio/gpio-twl4030.c | 86 +++++++++++++------ 4 files changed, 98 insertions(+), 27 deletions(-)
Thanks,
Benoit
cover gpio-twl4030: add new device tree properties
Hi Benoit,
Quoted 13 lines
Nit #2: the DTS file does not belong to the gpio subsystem. So you should prefix them using the *convention* for ARM DTS patches:
arm/dts: omap3: Add gpio-twl4030 properties for BeagleBoard and omap3-EVM
Or maybe "ARM: dts: " because it looks like most people are using that nowadays.
The convention for the gpio directory is similar:
gpio/twl4030: get platform data from device treeQuoted 2 lines
gpio-twl4030: updates the bindings for new dt properties
Quoted 8 lines
Quoted 5 lines
.../devicetree/bindings/gpio/gpio-twl4030.txt | 6 ++ arch/arm/boot/dts/omap3-beagle.dts | 20 +++++ arch/arm/boot/dts/omap3-evm.dts | 13 +++ drivers/gpio/gpio-twl4030.c | 86 +++++++++++++------ 4 files changed, 98 insertions(+), 27 deletions(-)Thanks,
Benoit
Thank you for your review, I will send a new version soon.
Regards,
Florian
cover gpio-twl4030: add new device tree properties
In reply to Benoit CoussonQuoted 2 lines · Benoit
+ Vaibhav for the omap3-evm
Reviewing and testing it now...
Thanks,
Vaibhav
Quoted 75 lines
Hi Florian,
Quoted 2 lines · Florian Vaussard
A number of platform data are missing when using twl4030/gpio from a device tree.
Yeah, I know, I was too lazy when I did the DT conversion at that time :-)
Many thanks for completing the work.
Quoted 8 lines
This patchset adds the missing properties, updates
existing device trees and updates the documentation of bindings. It mainly enables LEDA and LEDB outputs, as well as pullups / pulldowns on GPIOs.The 1st patch changes the device driver.
The 2nd patch updates the device trees for BeagleBoard and omap3-evm. The 3rd patch updates the documentation of bindings.OK, that's a nit, but in general, you'd better introduce the binding before using it.
The binding documentation could/should be updated along with the driver change that does introduce the binding. You could just merged patch #1 and #3.
Quoted 9 lines
Tested:
- Boot tested on Gumstix Overo for "ti,use-leds". Corresponding patch is not provided, as the device tree is not yet merged. The support can be found in the git tree [1], branch omap3-devel-dt-overo.
- Device trees for BeagleBoard and omap3-evm were compiled, but not tested on hardware.Would someone be willing to test on BeagleBoard / omap3-evm?
I'll try to do it on Beagle. This is the least I can do since I did not do the job myself :-)
I added vaibhav as well since I do not have any omap3-evm board.
Quoted 10 lines
Regards,
Florian[1] https://github.com/vaussard/linux.git (not safe for merge)
Florian Vaussard (3):
gpio-twl4030: get platform data from device tree
gpio-twl4030: new dt properties for BeagleBoard and omap3-EVMNit #2: the DTS file does not belong to the gpio subsystem. So you should prefix them using the *convention* for ARM DTS patches:
arm/dts: omap3: Add gpio-twl4030 properties for BeagleBoard and omap3-EVM
Or maybe "ARM: dts: " because it looks like most people are using that nowadays.
The convention for the gpio directory is similar:
gpio/twl4030: get platform data from device treeQuoted 7 lines
gpio-twl4030: updates the bindings for new dt properties
.../devicetree/bindings/gpio/gpio-twl4030.txt | 6 ++ arch/arm/boot/dts/omap3-beagle.dts | 20 +++++ arch/arm/boot/dts/omap3-evm.dts | 13 +++ drivers/gpio/gpio-twl4030.c | 86 +++++++++++++------ 4 files changed, 98 insertions(+), 27 deletions(-)Thanks,
Benoit