gpio-twl4030: add new device tree properties
Subsystems (2)
v2 cover gpio-twl4030: add new device tree properties
Hello,
A number of platform data are missing when using twl4030/gpio from a device tree. This patchset adds the missing properties, updates the documentation with the new bindings, and updates existing device trees. It mainly enables LEDA and LEDB outputs, as well as pullups / pulldowns on GPIOs.
The 1st patch changes the device driver and updates the documentation. The 2nd patch updates the device trees for BeagleBoard and omap3-evm.
Changes since v1:
- Patches on driver and documentation merged into the same patch
- Put device trees' values in hexadecimal
- Handle bool property using of_property_read_bool()
- Prefix the patches with the correct convention
Tested on Gumstix Overo. V1 was tested on omap3-evm by Vaibhav Hiremath.
BTW: who will merge this?
Regards,
Florian
Florian Vaussard (2):
gpio/twl4030: get platform data from device tree
ARM: dts: omap3: Add gpio-twl4030 properties for BeagleBoard and
omap3-EVM
.../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 | 84 +++++++++++++------ 4 files changed, 96 insertions(+), 27 deletions(-)
Signature · 1 line
1.7.5.4
PATCH v2 1/2 gpio/twl4030: get platform data from device tree
Adds a number of missing device tree properties for twl4030/gpio, and update bindings:
- "ti,use-leds" -> .use_leds - "ti,debounce" -> .debounce - "ti,mmc-cd" -> .mmc_cd - "ti,pullups" -> .pullups
- "ti,pulldowns" -> .pulldowns
--- .../devicetree/bindings/gpio/gpio-twl4030.txt | 6 ++ drivers/gpio/gpio-twl4030.c | 84 +++++++++++++------ 2 files changed, 63 insertions(+), 27 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 +- 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; };
drivers/gpio/gpio-twl4030.c +57 -27
102 lines not on this page · raw message
Signature · 1 line
1.7.5.4
PATCH v2 1/2 gpio/twl4030: get platform data from device tree
Hi Florian,
I've just noticed that this patch is reporting some CHECK issues.
d1f5052 - gpio/twl4030: get platform data from device tree
CHECK: Alignment should match open parenthesis #66: FILE: drivers/gpio/gpio-twl4030.c:412:
+ of_property_read_u32(dev->of_node, "ti,debounce",
+ &omap_twl_info->debounce);
CHECK: Alignment should match open parenthesis #68: FILE: drivers/gpio/gpio-twl4030.c:414:
+ of_property_read_u32(dev->of_node, "ti,mmc-cd",
+ (u32 *)&omap_twl_info->mmc_cd);
CHECK: Alignment should match open parenthesis #70: FILE: drivers/gpio/gpio-twl4030.c:416:
+ of_property_read_u32(dev->of_node, "ti,pullups",
+ &omap_twl_info->pullups);
CHECK: Alignment should match open parenthesis #72: FILE: drivers/gpio/gpio-twl4030.c:418:
+ of_property_read_u32(dev->of_node, "ti,pulldowns",
+ &omap_twl_info->pulldowns);
CHECK: Alignment should match open parenthesis
+ pdata->pullups, pdata->pulldowns,
CHECK: Alignment should match open parenthesis #139: FILE: drivers/gpio/gpio-twl4030.c:479:
+ dev_dbg(&pdev->dev, "debounce %.03x %.01x --> %d\n",
+ pdata->debounce, pdata->mmc_cd,
total: 0 errors, 0 warnings, 6 checks, 118 lines checked
I fixed them since it was trivial, but next time you should ensure that the patch pass checkpatch before posting.
Just let me know if you have any issue with the following update.
Regards,
Benoit
---
Quoted 1 line
From
f74ce8fb849e9f9c54a494cff5fc30d53ca4e963Mon Sep 17 00:00:00 2001
From: Florian Vaussard <[email protected]>
Date: Wed, 5 Sep 2012 09:46:25 +0200
Subject: [PATCH] gpio/twl4030: get platform data from device tree
Adds a number of missing device tree properties for twl4030/gpio, and update bindings:
- "ti,use-leds" -> .use_leds - "ti,debounce" -> .debounce - "ti,mmc-cd" -> .mmc_cd - "ti,pullups" -> .pullups
- "ti,pulldowns" -> .pulldowns
--- .../devicetree/bindings/gpio/gpio-twl4030.txt | 6 ++ drivers/gpio/gpio-twl4030.c | 82 +++++++++++++------- 2 files changed, 61 insertions(+), 27 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 +- 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; };
drivers/gpio/gpio-twl4030.c +55 -27
100 lines not on this page · raw message
Signature · 1 line
1.7.0.4
PATCH v2 1/2 gpio/twl4030: get platform data from device tree
Hello Benoit,
Le 07/09/2012 19:33, Benoit Cousson a ?crit :
Quoted 33 lines
Hi Florian,
I've just noticed that this patch is reporting some CHECK issues.
d1f5052 - gpio/twl4030: get platform data from device tree
CHECK: Alignment should match open parenthesis #66: FILE:drivers/gpio/gpio-twl4030.c:412:drivers/gpio/gpio-twl4030.c +2
-0+of_property_read_u32 (dev->of_node,"ti,debounce" , + &omap_twl_info->debounce);CHECK: Alignment should match open parenthesis
#68: FILE:drivers/gpio/gpio-twl4030.c:414:drivers/gpio/gpio-twl4030.c +2
-0+of_property_read_u32 (dev->of_node,"ti,mmc-cd" , + (u32 *)&omap_twl_info->mmc_cd);CHECK: Alignment should match open parenthesis
#70: FILE:drivers/gpio/gpio-twl4030.c:416:drivers/gpio/gpio-twl4030.c +2
-0+of_property_read_u32 (dev->of_node,"ti,pullups" , + &omap_twl_info->pullups);CHECK: Alignment should match open parenthesis
#72: FILE:drivers/gpio/gpio-twl4030.c:418:drivers/gpio/gpio-twl4030.c +2
-0+of_property_read_u32 (dev->of_node,"ti,pulldowns" , + &omap_twl_info->pulldowns);CHECK: Alignment should match open parenthesis
(quoted diff) +1
-0+ pdata->pullups, pdata->pulldowns,CHECK: Alignment should match open parenthesis
#139: FILE:drivers/gpio/gpio-twl4030.c:479:(quoted diff) +2
-0+ dev_dbg(&pdev->dev, "debounce %.03x %.01x --> %d\n", + pdata->debounce, pdata->mmc_cd,
Quoted 4 lines
total: 0 errors, 0 warnings, 6 checks, 118 lines checked
I fixed them since it was trivial, but next time you should ensure that the patch pass checkpatch before posting.
Sorry for these errors. I however checked my patches before submitting, and had no such warnings. I redone, and remarked that these warnings appear only with the "--strict" option, which is not enabled by default. Is this the recommended guideline? Thus why not enabling it by default?
Quoted 2 lines
Just let me know if you have any issue with the following update.
I will test, but should not have any issue with your fix.
Thank you very much for fixing my patch, I send you a virtual chocolate from Switzerland!
Regards,
Florian
PATCH v2 1/2 gpio/twl4030: get platform data from device tree
Hi Florian,
Quoted 39 lines · Florian Vaussard
Hello Benoit,
Le 07/09/2012 19:33, Benoit Cousson a ?crit :
Quoted 36 lines
Hi Florian,
I've just noticed that this patch is reporting some CHECK issues.
d1f5052 - gpio/twl4030: get platform data from device tree
CHECK: Alignment should match open parenthesis #66: FILE:drivers/gpio/gpio-twl4030.c:412:drivers/gpio/gpio-twl4030.c +2
-0+of_property_read_u32 (dev->of_node,"ti,debounce" , + &omap_twl_info->debounce);CHECK: Alignment should match open parenthesis
#68: FILE:drivers/gpio/gpio-twl4030.c:414:drivers/gpio/gpio-twl4030.c +2
-0+of_property_read_u32 (dev->of_node,"ti,mmc-cd" , + (u32 *)&omap_twl_info->mmc_cd);CHECK: Alignment should match open parenthesis
#70: FILE:drivers/gpio/gpio-twl4030.c:416:drivers/gpio/gpio-twl4030.c +2
-0+of_property_read_u32 (dev->of_node,"ti,pullups" , + &omap_twl_info->pullups);CHECK: Alignment should match open parenthesis
#72: FILE:drivers/gpio/gpio-twl4030.c:418:drivers/gpio/gpio-twl4030.c +2
-0+of_property_read_u32 (dev->of_node,"ti,pulldowns" , + &omap_twl_info->pulldowns);CHECK: Alignment should match open parenthesis
+pdata->pullups,pdata->pulldowns,CHECK: Alignment should match open parenthesis
#139: FILE:drivers/gpio/gpio-twl4030.c:479:(quoted diff) +2
-0+ dev_dbg(&pdev->dev, "debounce %.03x %.01x --> %d\n", + pdata->debounce, pdata->mmc_cd,total: 0 errors, 0 warnings, 6 checks, 118 lines checked
Quoted 7 lines
Quoted 2 lines
I fixed them since it was trivial, but next time you should ensure that the patch pass checkpatch before posting.
Sorry for these errors. I however checked my patches before submitting, and had no such warnings. I redone, and remarked that these warnings appear only with the "--strict" option, which is not enabled by default. Is this the recommended guideline? Thus why not enabling it by default?
That's a pretty good question :-)
Maybe the --strict is more a nice to have than a strong requirement? Anyway, we'd better run checkpatch with --strict and thus fix any cosmetic details that might be in the patch.
Quoted 6 lines
Quoted 1 line
Just let me know if you have any issue with the following update.
I will test, but should not have any issue with your fix.
Thank you very much for fixing my patch, I send you a virtual chocolate from Switzerland!
Cool, I love chocolate. That being said, I'm not sure how tasteful will be the *virtual* chocolate.
Regards,
Benoit
PATCH v2 1/2 gpio/twl4030: get platform data from device tree
Hello Benoit,
Quoted 7 lines
Quoted 7 lines
I fixed them since it was trivial, but next time you should ensure that the patch pass checkpatch before posting.
Sorry for these errors. I however checked my patches before submitting, and had no such warnings. I redone, and remarked that these warnings appear only with the "--strict" option, which is not enabled by default. Is this the recommended guideline? Thus why not enabling it by default?
Quoted 5 lines
That's a pretty good question :-)
Maybe the --strict is more a nice to have than a strong requirement? Anyway, we'd better run checkpatch with --strict and thus fix any cosmetic details that might be in the patch.
Good to know, I will use --strict for the next submissions.
Quoted 2 lines
Cool, I love chocolate. That being said, I'm not sure how tasteful will be the *virtual* chocolate. Regards, Benoit
Even *virtual*, Swiss chocolate will be the most tasteful (hope no Belgium friends will see this thread) :-)
Regards,
Florian
PATCH v2 2/2 ARM: dts: omap3: Add gpio-twl4030 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; + /* pullups: BIT(1) */ + ti,pullups = <0x000002>; + /* + * pulldowns: + * BIT(2), BIT(6), BIT(7), BIT(8), BIT(13) + * BIT(15), BIT(16), BIT(17) + */ + ti,pulldowns = <0x03a1c4>; +};
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; +};
Signature · 1 line
1.7.5.4
v2 cover gpio-twl4030: add new device tree properties
In reply to Florian VaussardHi Florian,
Quoted 8 lines · Florian Vaussard
Hello,
A number of platform data are missing when using twl4030/gpio from a device tree. This patchset adds the missing properties, updates the documentation with the new bindings, and updates existing device trees. It mainly enables LEDA and LEDB outputs, as well as pullups / pulldowns on GPIOs.
Quoted 8 lines
The 1st patch changes the device driver and updates the documentation. The 2nd patch updates the device trees for BeagleBoard and omap3-evm.
Changes since v1:
- Patches on driver and documentation merged into the same patch
- Put device trees' values in hexadecimal
- Handle bool property usingof_property_read_bool()
- Prefix the patches with the correct convention
Thanks for the update.
Quoted 1 line
Tested on Gumstix Overo. V1 was tested on omap3-evm by Vaibhav Hiremath.
I've just tested it on beagle xM. I can play with D12 led using:
echo 255 > /sys/class/leds/beagleboard\:\:pmu_stat/brightness
Quoted 1 line
BTW: who will merge this?
Since Linus already acked it, Tony can merge it.
Tony,
I can add that series in my DTS series for 3.7 if you want.
Regards,
Benoit
v2 cover gpio-twl4030: add new device tree properties
Quoted 31 lines · Benoit Cousson
Hi Florian,
Quoted 8 lines · Florian Vaussard
Hello,
A number of platform data are missing when using twl4030/gpio from a device tree. This patchset adds the missing properties, updates the documentation with the new bindings, and updates existing device trees. It mainly enables LEDA and LEDB outputs, as well as pullups / pulldowns on GPIOs.
Quoted 8 lines
The 1st patch changes the device driver and updates the documentation. The 2nd patch updates the device trees for BeagleBoard and omap3-evm.
Changes since v1:
- Patches on driver and documentation merged into the same patch
- Put device trees' values in hexadecimal
- Handle bool property usingof_property_read_bool()
- Prefix the patches with the correct conventionThanks for the update.
Quoted 1 line
Tested on Gumstix Overo. V1 was tested on omap3-evm by Vaibhav Hiremath.
I've just tested it on beagle xM. I can play with D12 led using:
echo 255 > /sys/class/leds/beagleboard\:\:pmu_stat/brightness
Tested-by Benoit Cousson <[email protected]>
Quoted 8 lines
Quoted 1 line
BTW: who will merge this?
Since Linus already acked it, Tony can merge it.
Tony,
I can add that series in my DTS series for 3.7 if you want.
Yes please do thanks.
Tony
v2 cover gpio-twl4030: add new device tree properties
Quoted 34 lines · Tony Lindgren
Quoted 33 lines · Benoit Cousson
Hi Florian,
Quoted 8 lines · Florian Vaussard
Hello,
A number of platform data are missing when using twl4030/gpio from a device tree. This patchset adds the missing properties, updates the documentation with the new bindings, and updates existing device trees. It mainly enables LEDA and LEDB outputs, as well as pullups / pulldowns on GPIOs.
Quoted 8 lines
The 1st patch changes the device driver and updates the documentation. The 2nd patch updates the device trees for BeagleBoard and omap3-evm.
Changes since v1:
- Patches on driver and documentation merged into the same patch
- Put device trees' values in hexadecimal
- Handle bool property usingof_property_read_bool()
- Prefix the patches with the correct conventionThanks for the update.
Quoted 1 line
Tested on Gumstix Overo. V1 was tested on omap3-evm by Vaibhav Hiremath.
I've just tested it on beagle xM. I can play with D12 led using:
echo 255 > /sys/class/leds/beagleboard\:\:pmu_stat/brightness
Tested-by Benoit Cousson <[email protected]>Quoted 1 line
BTW: who will merge this?
Quoted 8 lines
Quoted 6 lines
Since Linus already acked it, Tony can merge it.
Tony,
I can add that series in my DTS series for 3.7 if you want.
Yes please do thanks.
On top of that series, I realized that beagle was missing the other LEDs. So I've just posted the support for the two missing ones.
[PATCH] ARM: dts: omap3-beagle: Add heartbeat and mmc LEDs support
Regards,
Benoit