Re: [PATCH 1/3] gpio-twl4030: get platform data from device tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 






On 9/3/2012 7:24 PM, Florian Vaussard wrote:
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 <florian.vaussard@xxxxxxx>
---
  drivers/gpio/gpio-twl4030.c |   86 +++++++++++++++++++++++++++++-------------
  1 files changed, 59 insertions(+), 27 deletions(-)

diff --git a/drivers/gpio/gpio-twl4030.c b/drivers/gpio/gpio-twl4030.c
index 94256fe..dabe76b 100644
--- a/drivers/gpio/gpio-twl4030.c
+++ b/drivers/gpio/gpio-twl4030.c
@@ -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;
+
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 <hvaibhav@xxxxxx>

Thank you Vaibhav for your review. I will send a v2 today.

Regards,
Florian
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux