* [PATCH 0/4] extcon: gpio: add DT support
@ 2014-11-03 16:32 Felipe Balbi
2014-11-03 16:32 ` [PATCH 1/4] extcon: gpio: Convert the driver to use gpio desc API's Felipe Balbi
` (4 more replies)
0 siblings, 5 replies; 14+ messages in thread
From: Felipe Balbi @ 2014-11-03 16:32 UTC (permalink / raw)
To: myungjoo.ham, cw00.choi
Cc: Linux Kernel Mailing List, Linux OMAP Mailing List, nsekhar,
grant.likely, Felipe Balbi
Hi,
this series has been tested with v3.18-rc2 with a
yet-to-be-released board (called X15). That board
is DT-only and we use extcon-gpio to decide which
USB mode should be used (host or peripheral).
George Cherian (4):
extcon: gpio: Convert the driver to use gpio desc API's
extcon: gpio: Add dt support for the driver.
extcon: gpio: Always use gpio_get_value_cansleep
extcon: gpio: Add support for using cable names
.../devicetree/bindings/extcon/extcon-gpio.txt | 23 ++++++
drivers/extcon/extcon-gpio.c | 93 ++++++++++++++--------
2 files changed, 84 insertions(+), 32 deletions(-)
create mode 100644 Documentation/devicetree/bindings/extcon/extcon-gpio.txt
--
2.1.0.GIT
^ permalink raw reply [flat|nested] 14+ messages in thread* [PATCH 1/4] extcon: gpio: Convert the driver to use gpio desc API's 2014-11-03 16:32 [PATCH 0/4] extcon: gpio: add DT support Felipe Balbi @ 2014-11-03 16:32 ` Felipe Balbi 2014-11-03 18:01 ` Guenter Roeck [not found] ` <1415032350-8459-1-git-send-email-balbi-l0cyMroinI0@public.gmane.org> ` (3 subsequent siblings) 4 siblings, 1 reply; 14+ messages in thread From: Felipe Balbi @ 2014-11-03 16:32 UTC (permalink / raw) To: myungjoo.ham, cw00.choi Cc: Linux Kernel Mailing List, Linux OMAP Mailing List, nsekhar, grant.likely, George Cherian, Felipe Balbi From: George Cherian <george.cherian@ti.com> Convert the driver to use gpiod_* API's. Reviewed-by: Roger Quadros <rogerq@ti.com> Signed-off-by: George Cherian <george.cherian@ti.com> Signed-off-by: Sekhar Nori <nsekhar@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com> --- drivers/extcon/extcon-gpio.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/extcon/extcon-gpio.c b/drivers/extcon/extcon-gpio.c index 72f19a3..70e3fc7 100644 --- a/drivers/extcon/extcon-gpio.c +++ b/drivers/extcon/extcon-gpio.c @@ -33,8 +33,7 @@ struct gpio_extcon_data { struct extcon_dev *edev; - unsigned gpio; - bool gpio_active_low; + struct gpio_desc *gpiod; const char *state_on; const char *state_off; int irq; @@ -50,9 +49,7 @@ static void gpio_extcon_work(struct work_struct *work) container_of(to_delayed_work(work), struct gpio_extcon_data, work); - state = gpio_get_value(data->gpio); - if (data->gpio_active_low) - state = !state; + state = gpiod_get_value(data->gpiod); extcon_set_state(data->edev, state); } @@ -106,21 +103,20 @@ static int gpio_extcon_probe(struct platform_device *pdev) } extcon_data->edev->name = pdata->name; - extcon_data->gpio = pdata->gpio; - extcon_data->gpio_active_low = pdata->gpio_active_low; + extcon_data->gpiod = gpio_to_desc(pdata->gpio); extcon_data->state_on = pdata->state_on; extcon_data->state_off = pdata->state_off; extcon_data->check_on_resume = pdata->check_on_resume; if (pdata->state_on && pdata->state_off) extcon_data->edev->print_state = extcon_gpio_print_state; - ret = devm_gpio_request_one(&pdev->dev, extcon_data->gpio, GPIOF_DIR_IN, + ret = devm_gpio_request_one(&pdev->dev, pdata->gpio, GPIOF_DIR_IN, pdev->name); if (ret < 0) return ret; if (pdata->debounce) { - ret = gpio_set_debounce(extcon_data->gpio, + ret = gpiod_set_debounce(extcon_data->gpiod, pdata->debounce * 1000); if (ret < 0) extcon_data->debounce_jiffies = @@ -133,7 +129,7 @@ static int gpio_extcon_probe(struct platform_device *pdev) INIT_DELAYED_WORK(&extcon_data->work, gpio_extcon_work); - extcon_data->irq = gpio_to_irq(extcon_data->gpio); + extcon_data->irq = gpiod_to_irq(extcon_data->gpiod); if (extcon_data->irq < 0) return extcon_data->irq; -- 2.1.0.GIT ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH 1/4] extcon: gpio: Convert the driver to use gpio desc API's 2014-11-03 16:32 ` [PATCH 1/4] extcon: gpio: Convert the driver to use gpio desc API's Felipe Balbi @ 2014-11-03 18:01 ` Guenter Roeck 2014-11-03 18:06 ` Felipe Balbi 0 siblings, 1 reply; 14+ messages in thread From: Guenter Roeck @ 2014-11-03 18:01 UTC (permalink / raw) To: Felipe Balbi Cc: myungjoo.ham, cw00.choi, Linux Kernel Mailing List, Linux OMAP Mailing List, nsekhar, grant.likely, George Cherian On Mon, Nov 03, 2014 at 10:32:27AM -0600, Felipe Balbi wrote: > From: George Cherian <george.cherian@ti.com> > > Convert the driver to use gpiod_* API's. > > Reviewed-by: Roger Quadros <rogerq@ti.com> > Signed-off-by: George Cherian <george.cherian@ti.com> > Signed-off-by: Sekhar Nori <nsekhar@ti.com> > Signed-off-by: Felipe Balbi <balbi@ti.com> > --- I think it might be useful and appropriate to explain that and why you remove support for active-low pins, instead of hiding it in a seemingly unrelated patch. Also, since you don't use the platform data flag anymore, you might as well remove it to give out-of-tree users a fair warning. Overall, it might be easier to just revert the patch introducing it (5bfbdc9caa7) before converting extcon to gpiod. I am just glad that we stopped using extcon for other reasons ;-) Guenter ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/4] extcon: gpio: Convert the driver to use gpio desc API's 2014-11-03 18:01 ` Guenter Roeck @ 2014-11-03 18:06 ` Felipe Balbi 2014-11-03 18:51 ` Guenter Roeck 0 siblings, 1 reply; 14+ messages in thread From: Felipe Balbi @ 2014-11-03 18:06 UTC (permalink / raw) To: Guenter Roeck Cc: Felipe Balbi, myungjoo.ham, cw00.choi, Linux Kernel Mailing List, Linux OMAP Mailing List, nsekhar, grant.likely, George Cherian [-- Attachment #1: Type: text/plain, Size: 719 bytes --] On Mon, Nov 03, 2014 at 10:01:50AM -0800, Guenter Roeck wrote: > On Mon, Nov 03, 2014 at 10:32:27AM -0600, Felipe Balbi wrote: > > From: George Cherian <george.cherian@ti.com> > > > > Convert the driver to use gpiod_* API's. > > > > Reviewed-by: Roger Quadros <rogerq@ti.com> > > Signed-off-by: George Cherian <george.cherian@ti.com> > > Signed-off-by: Sekhar Nori <nsekhar@ti.com> > > Signed-off-by: Felipe Balbi <balbi@ti.com> > > --- > > I think it might be useful and appropriate to explain that and why > you remove support for active-low pins, instead of hiding it in a > seemingly unrelated patch. removed ? why removed ? gpio descs handle that for you, read the source code. -- balbi [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/4] extcon: gpio: Convert the driver to use gpio desc API's 2014-11-03 18:06 ` Felipe Balbi @ 2014-11-03 18:51 ` Guenter Roeck 2014-11-03 20:43 ` Felipe Balbi 0 siblings, 1 reply; 14+ messages in thread From: Guenter Roeck @ 2014-11-03 18:51 UTC (permalink / raw) To: Felipe Balbi Cc: myungjoo.ham, cw00.choi, Linux Kernel Mailing List, Linux OMAP Mailing List, nsekhar, grant.likely, George Cherian On Mon, Nov 03, 2014 at 12:06:02PM -0600, Felipe Balbi wrote: > On Mon, Nov 03, 2014 at 10:01:50AM -0800, Guenter Roeck wrote: > > On Mon, Nov 03, 2014 at 10:32:27AM -0600, Felipe Balbi wrote: > > > From: George Cherian <george.cherian@ti.com> > > > > > > Convert the driver to use gpiod_* API's. > > > > > > Reviewed-by: Roger Quadros <rogerq@ti.com> > > > Signed-off-by: George Cherian <george.cherian@ti.com> > > > Signed-off-by: Sekhar Nori <nsekhar@ti.com> > > > Signed-off-by: Felipe Balbi <balbi@ti.com> > > > --- > > > > I think it might be useful and appropriate to explain that and why > > you remove support for active-low pins, instead of hiding it in a > > seemingly unrelated patch. > > removed ? why removed ? gpio descs handle that for you, read the source > code. > Well, it for sure looks like it. Care to explain that in the patch, as well as how the platform data flag is used ? Thanks, Guenter ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/4] extcon: gpio: Convert the driver to use gpio desc API's 2014-11-03 18:51 ` Guenter Roeck @ 2014-11-03 20:43 ` Felipe Balbi 0 siblings, 0 replies; 14+ messages in thread From: Felipe Balbi @ 2014-11-03 20:43 UTC (permalink / raw) To: Guenter Roeck Cc: Felipe Balbi, myungjoo.ham, cw00.choi, Linux Kernel Mailing List, Linux OMAP Mailing List, nsekhar, grant.likely, George Cherian [-- Attachment #1: Type: text/plain, Size: 1168 bytes --] Hi, On Mon, Nov 03, 2014 at 10:51:08AM -0800, Guenter Roeck wrote: > On Mon, Nov 03, 2014 at 12:06:02PM -0600, Felipe Balbi wrote: > > On Mon, Nov 03, 2014 at 10:01:50AM -0800, Guenter Roeck wrote: > > > On Mon, Nov 03, 2014 at 10:32:27AM -0600, Felipe Balbi wrote: > > > > From: George Cherian <george.cherian@ti.com> > > > > > > > > Convert the driver to use gpiod_* API's. > > > > > > > > Reviewed-by: Roger Quadros <rogerq@ti.com> > > > > Signed-off-by: George Cherian <george.cherian@ti.com> > > > > Signed-off-by: Sekhar Nori <nsekhar@ti.com> > > > > Signed-off-by: Felipe Balbi <balbi@ti.com> > > > > --- > > > > > > I think it might be useful and appropriate to explain that and why > > > you remove support for active-low pins, instead of hiding it in a > > > seemingly unrelated patch. > > > > removed ? why removed ? gpio descs handle that for you, read the source > > code. > > > Well, it for sure looks like it. Care to explain that in the patch, > as well as how the platform data flag is used ? I'll leave that to $author, I just cherry-picked and tested them. Certainly that commit log needs some love. -- balbi [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 14+ messages in thread
[parent not found: <1415032350-8459-1-git-send-email-balbi-l0cyMroinI0@public.gmane.org>]
* [PATCH 2/4] extcon: gpio: Add dt support for the driver. [not found] ` <1415032350-8459-1-git-send-email-balbi-l0cyMroinI0@public.gmane.org> @ 2014-11-03 16:32 ` Felipe Balbi 0 siblings, 0 replies; 14+ messages in thread From: Felipe Balbi @ 2014-11-03 16:32 UTC (permalink / raw) To: myungjoo.ham-Sze3O3UU22JBDgjK7y7TUQ, cw00.choi-Sze3O3UU22JBDgjK7y7TUQ Cc: Linux Kernel Mailing List, Linux OMAP Mailing List, nsekhar-l0cyMroinI0, grant.likely-QSEj5FYQhm4dnm+yROfE0A, George Cherian, devicetree-u79uwXL29TY76Z2rM5mHXA, Felipe Balbi From: George Cherian <george.cherian-l0cyMroinI0@public.gmane.org> Add device tree support to extcon-gpio driver. Add devicetree binding documentation Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org Signed-off-by: George Cherian <george.cherian-l0cyMroinI0@public.gmane.org> Signed-off-by: Sekhar Nori <nsekhar-l0cyMroinI0@public.gmane.org> Signed-off-by: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org> --- .../devicetree/bindings/extcon/extcon-gpio.txt | 21 ++++++ drivers/extcon/extcon-gpio.c | 75 +++++++++++++++------- 2 files changed, 73 insertions(+), 23 deletions(-) create mode 100644 Documentation/devicetree/bindings/extcon/extcon-gpio.txt diff --git a/Documentation/devicetree/bindings/extcon/extcon-gpio.txt b/Documentation/devicetree/bindings/extcon/extcon-gpio.txt new file mode 100644 index 0000000..5fe6846 --- /dev/null +++ b/Documentation/devicetree/bindings/extcon/extcon-gpio.txt @@ -0,0 +1,21 @@ +GPIO based EXTCON + +EXTCON GPIO +----------- + +Required Properties: + - compatible: should be: + * "linux,extcon-gpio" + - gpios: specifies the gpio pin used. + +Optional Properties: + - debounce: Debounce time for GPIO IRQ in ms + + +Eg: + + extcon1: am43_usbid_extcon1 { + compatible = "linux,extcon-gpio"; + gpios = <&gpio3 12 GPIO_ACTIVE_HIGH>; + debounce = <20>; + }; diff --git a/drivers/extcon/extcon-gpio.c b/drivers/extcon/extcon-gpio.c index 70e3fc7..9571e1f 100644 --- a/drivers/extcon/extcon-gpio.c +++ b/drivers/extcon/extcon-gpio.c @@ -25,8 +25,10 @@ #include <linux/gpio.h> #include <linux/init.h> #include <linux/interrupt.h> +#include <linux/irq.h> #include <linux/kernel.h> #include <linux/module.h> +#include <linux/of_gpio.h> #include <linux/platform_device.h> #include <linux/slab.h> #include <linux/workqueue.h> @@ -80,16 +82,12 @@ static ssize_t extcon_gpio_print_state(struct extcon_dev *edev, char *buf) static int gpio_extcon_probe(struct platform_device *pdev) { + struct device_node *np = pdev->dev.of_node; struct gpio_extcon_platform_data *pdata = dev_get_platdata(&pdev->dev); struct gpio_extcon_data *extcon_data; int ret; - - if (!pdata) - return -EBUSY; - if (!pdata->irq_flags) { - dev_err(&pdev->dev, "IRQ flag is not specified.\n"); - return -EINVAL; - } + unsigned int irq_flags; + unsigned int debounce = 0; extcon_data = devm_kzalloc(&pdev->dev, sizeof(struct gpio_extcon_data), GFP_KERNEL); @@ -101,26 +99,51 @@ static int gpio_extcon_probe(struct platform_device *pdev) dev_err(&pdev->dev, "failed to allocate extcon device\n"); return -ENOMEM; } - extcon_data->edev->name = pdata->name; - - extcon_data->gpiod = gpio_to_desc(pdata->gpio); - extcon_data->state_on = pdata->state_on; - extcon_data->state_off = pdata->state_off; - extcon_data->check_on_resume = pdata->check_on_resume; - if (pdata->state_on && pdata->state_off) - extcon_data->edev->print_state = extcon_gpio_print_state; - ret = devm_gpio_request_one(&pdev->dev, pdata->gpio, GPIOF_DIR_IN, - pdev->name); - if (ret < 0) - return ret; + if (np) { + int irq; + + extcon_data->gpiod = devm_gpiod_get(&pdev->dev, NULL); + if (IS_ERR(extcon_data->gpiod)) + return PTR_ERR(extcon_data->gpiod); + + extcon_data->edev->name = np->name; + extcon_data->edev->dev.parent = &pdev->dev; + of_property_read_u32(np, "debounce", &debounce); + irq = gpiod_to_irq(extcon_data->gpiod); + irq_flags = irq_get_trigger_type(irq); + } else { + if (!pdata) + return -EBUSY; + + if (!pdata->irq_flags) { + dev_err(&pdev->dev, "IRQ flag is not specified.\n"); + return -EINVAL; + } + + extcon_data->edev->name = pdata->name; + + extcon_data->gpiod = gpio_to_desc(pdata->gpio); + extcon_data->state_on = pdata->state_on; + extcon_data->state_off = pdata->state_off; + extcon_data->check_on_resume = pdata->check_on_resume; + if (pdata->state_on && pdata->state_off) + extcon_data->edev->print_state = extcon_gpio_print_state; + + ret = devm_gpio_request_one(&pdev->dev, pdata->gpio, GPIOF_DIR_IN, + pdev->name); + if (ret < 0) + return ret; + irq_flags = pdata->irq_flags; + debounce = pdata->debounce; + } - if (pdata->debounce) { + if (debounce) { ret = gpiod_set_debounce(extcon_data->gpiod, - pdata->debounce * 1000); + debounce * 1000); if (ret < 0) extcon_data->debounce_jiffies = - msecs_to_jiffies(pdata->debounce); + msecs_to_jiffies(debounce); } ret = devm_extcon_dev_register(&pdev->dev, extcon_data->edev); @@ -134,7 +157,7 @@ static int gpio_extcon_probe(struct platform_device *pdev) return extcon_data->irq; ret = request_any_context_irq(extcon_data->irq, gpio_irq_handler, - pdata->irq_flags, pdev->name, + irq_flags, pdev->name, extcon_data); if (ret < 0) return ret; @@ -172,6 +195,11 @@ static int gpio_extcon_resume(struct device *dev) static SIMPLE_DEV_PM_OPS(gpio_extcon_pm_ops, NULL, gpio_extcon_resume); +static struct of_device_id of_extcon_gpio_match_tbl[] = { + { .compatible = "linux,extcon-gpio", }, + { /* end */ } +}; + static struct platform_driver gpio_extcon_driver = { .probe = gpio_extcon_probe, .remove = gpio_extcon_remove, @@ -179,6 +207,7 @@ static struct platform_driver gpio_extcon_driver = { .name = "extcon-gpio", .owner = THIS_MODULE, .pm = &gpio_extcon_pm_ops, + .of_match_table = of_extcon_gpio_match_tbl, }, }; -- 2.1.0.GIT -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 3/4] extcon: gpio: Always use gpio_get_value_cansleep 2014-11-03 16:32 [PATCH 0/4] extcon: gpio: add DT support Felipe Balbi 2014-11-03 16:32 ` [PATCH 1/4] extcon: gpio: Convert the driver to use gpio desc API's Felipe Balbi [not found] ` <1415032350-8459-1-git-send-email-balbi-l0cyMroinI0@public.gmane.org> @ 2014-11-03 16:32 ` Felipe Balbi 2014-11-03 16:32 ` [PATCH 4/4] extcon: gpio: Add support for using cable names Felipe Balbi 2014-11-04 6:12 ` [PATCH 0/4] extcon: gpio: add DT support George Cherian 4 siblings, 0 replies; 14+ messages in thread From: Felipe Balbi @ 2014-11-03 16:32 UTC (permalink / raw) To: myungjoo.ham, cw00.choi Cc: Linux Kernel Mailing List, Linux OMAP Mailing List, nsekhar, grant.likely, George Cherian, Felipe Balbi From: George Cherian <george.cherian@ti.com> Some gpio's can sleep while reading, so always use gpio_get_value_cansleep to get data. This fixes warning from gpiolib due to wrong API usage. Reviewed-by: Roger Quadros <rogerq@ti.com> Signed-off-by: George Cherian <george.cherian@ti.com> Signed-off-by: Sekhar Nori <nsekhar@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com> --- drivers/extcon/extcon-gpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/extcon/extcon-gpio.c b/drivers/extcon/extcon-gpio.c index 9571e1f..7191d28 100644 --- a/drivers/extcon/extcon-gpio.c +++ b/drivers/extcon/extcon-gpio.c @@ -51,7 +51,7 @@ static void gpio_extcon_work(struct work_struct *work) container_of(to_delayed_work(work), struct gpio_extcon_data, work); - state = gpiod_get_value(data->gpiod); + state = gpiod_get_value_cansleep(data->gpiod); extcon_set_state(data->edev, state); } -- 2.1.0.GIT ^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH 4/4] extcon: gpio: Add support for using cable names 2014-11-03 16:32 [PATCH 0/4] extcon: gpio: add DT support Felipe Balbi ` (2 preceding siblings ...) 2014-11-03 16:32 ` [PATCH 3/4] extcon: gpio: Always use gpio_get_value_cansleep Felipe Balbi @ 2014-11-03 16:32 ` Felipe Balbi 2014-11-03 16:39 ` Felipe Balbi 2014-11-04 6:12 ` [PATCH 0/4] extcon: gpio: add DT support George Cherian 4 siblings, 1 reply; 14+ messages in thread From: Felipe Balbi @ 2014-11-03 16:32 UTC (permalink / raw) To: myungjoo.ham, cw00.choi Cc: Linux Kernel Mailing List, Linux OMAP Mailing List, nsekhar, grant.likely, George Cherian From: George Cherian <george.cherian@ti.com> Add support for using cable names. Enables other drivers to register interest and get notified using extcon provided notifier call backs. Signed-off-by: George Cherian <george.cherian@ti.com> Signed-off-by: Sekhar Nori <nsekhar@ti.com> --- Documentation/devicetree/bindings/extcon/extcon-gpio.txt | 2 ++ drivers/extcon/extcon-gpio.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/extcon/extcon-gpio.txt b/Documentation/devicetree/bindings/extcon/extcon-gpio.txt index 5fe6846..f19aeb4 100644 --- a/Documentation/devicetree/bindings/extcon/extcon-gpio.txt +++ b/Documentation/devicetree/bindings/extcon/extcon-gpio.txt @@ -7,6 +7,7 @@ Required Properties: - compatible: should be: * "linux,extcon-gpio" - gpios: specifies the gpio pin used. + - cable-name: Name of the cable used. Optional Properties: - debounce: Debounce time for GPIO IRQ in ms @@ -18,4 +19,5 @@ Eg: compatible = "linux,extcon-gpio"; gpios = <&gpio3 12 GPIO_ACTIVE_HIGH>; debounce = <20>; + cable-name = "USB-HOST"; }; diff --git a/drivers/extcon/extcon-gpio.c b/drivers/extcon/extcon-gpio.c index 7191d28..cbe35af 100644 --- a/drivers/extcon/extcon-gpio.c +++ b/drivers/extcon/extcon-gpio.c @@ -42,6 +42,7 @@ struct gpio_extcon_data { struct delayed_work work; unsigned long debounce_jiffies; bool check_on_resume; + const char *cable_name[1]; }; static void gpio_extcon_work(struct work_struct *work) @@ -112,6 +113,9 @@ static int gpio_extcon_probe(struct platform_device *pdev) of_property_read_u32(np, "debounce", &debounce); irq = gpiod_to_irq(extcon_data->gpiod); irq_flags = irq_get_trigger_type(irq); + of_property_read_string_index(np, "cable-name", 0, + extcon_data->cable_name); + extcon_data->edev->supported_cable = extcon_data->cable_name; } else { if (!pdata) return -EBUSY; -- 2.1.0.GIT ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH 4/4] extcon: gpio: Add support for using cable names 2014-11-03 16:32 ` [PATCH 4/4] extcon: gpio: Add support for using cable names Felipe Balbi @ 2014-11-03 16:39 ` Felipe Balbi 0 siblings, 0 replies; 14+ messages in thread From: Felipe Balbi @ 2014-11-03 16:39 UTC (permalink / raw) To: Felipe Balbi Cc: myungjoo.ham, cw00.choi, Linux Kernel Mailing List, Linux OMAP Mailing List, nsekhar, grant.likely, George Cherian [-- Attachment #1: Type: text/plain, Size: 2510 bytes --] On Mon, Nov 03, 2014 at 10:32:30AM -0600, Felipe Balbi wrote: > From: George Cherian <george.cherian@ti.com> > > Add support for using cable names. Enables other drivers to register interest > and get notified using extcon provided notifier call backs. > > Signed-off-by: George Cherian <george.cherian@ti.com> > Signed-off-by: Sekhar Nori <nsekhar@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com> > --- > Documentation/devicetree/bindings/extcon/extcon-gpio.txt | 2 ++ > drivers/extcon/extcon-gpio.c | 4 ++++ > 2 files changed, 6 insertions(+) > > diff --git a/Documentation/devicetree/bindings/extcon/extcon-gpio.txt b/Documentation/devicetree/bindings/extcon/extcon-gpio.txt > index 5fe6846..f19aeb4 100644 > --- a/Documentation/devicetree/bindings/extcon/extcon-gpio.txt > +++ b/Documentation/devicetree/bindings/extcon/extcon-gpio.txt > @@ -7,6 +7,7 @@ Required Properties: > - compatible: should be: > * "linux,extcon-gpio" > - gpios: specifies the gpio pin used. > + - cable-name: Name of the cable used. > > Optional Properties: > - debounce: Debounce time for GPIO IRQ in ms > @@ -18,4 +19,5 @@ Eg: > compatible = "linux,extcon-gpio"; > gpios = <&gpio3 12 GPIO_ACTIVE_HIGH>; > debounce = <20>; > + cable-name = "USB-HOST"; > }; > diff --git a/drivers/extcon/extcon-gpio.c b/drivers/extcon/extcon-gpio.c > index 7191d28..cbe35af 100644 > --- a/drivers/extcon/extcon-gpio.c > +++ b/drivers/extcon/extcon-gpio.c > @@ -42,6 +42,7 @@ struct gpio_extcon_data { > struct delayed_work work; > unsigned long debounce_jiffies; > bool check_on_resume; > + const char *cable_name[1]; > }; > > static void gpio_extcon_work(struct work_struct *work) > @@ -112,6 +113,9 @@ static int gpio_extcon_probe(struct platform_device *pdev) > of_property_read_u32(np, "debounce", &debounce); > irq = gpiod_to_irq(extcon_data->gpiod); > irq_flags = irq_get_trigger_type(irq); > + of_property_read_string_index(np, "cable-name", 0, > + extcon_data->cable_name); > + extcon_data->edev->supported_cable = extcon_data->cable_name; > } else { > if (!pdata) > return -EBUSY; > -- > 2.1.0.GIT > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ -- balbi [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 0/4] extcon: gpio: add DT support 2014-11-03 16:32 [PATCH 0/4] extcon: gpio: add DT support Felipe Balbi ` (3 preceding siblings ...) 2014-11-03 16:32 ` [PATCH 4/4] extcon: gpio: Add support for using cable names Felipe Balbi @ 2014-11-04 6:12 ` George Cherian 2014-11-04 14:41 ` Felipe Balbi 4 siblings, 1 reply; 14+ messages in thread From: George Cherian @ 2014-11-04 6:12 UTC (permalink / raw) To: Felipe Balbi, myungjoo.ham, cw00.choi Cc: Linux Kernel Mailing List, Linux OMAP Mailing List, nsekhar, grant.likely Hi Felipe et al. Another series was posted by removing the platform support. https://lkml.org/lkml/2014/10/14/244 I guess I forgot to copy linux-omap. On 11/03/2014 10:02 PM, Felipe Balbi wrote: > Hi, > > this series has been tested with v3.18-rc2 with a > yet-to-be-released board (called X15). That board > is DT-only and we use extcon-gpio to decide which > USB mode should be used (host or peripheral). > > George Cherian (4): > extcon: gpio: Convert the driver to use gpio desc API's > extcon: gpio: Add dt support for the driver. > extcon: gpio: Always use gpio_get_value_cansleep > extcon: gpio: Add support for using cable names > > .../devicetree/bindings/extcon/extcon-gpio.txt | 23 ++++++ > drivers/extcon/extcon-gpio.c | 93 ++++++++++++++-------- > 2 files changed, 84 insertions(+), 32 deletions(-) > create mode 100644 Documentation/devicetree/bindings/extcon/extcon-gpio.txt > ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 0/4] extcon: gpio: add DT support 2014-11-04 6:12 ` [PATCH 0/4] extcon: gpio: add DT support George Cherian @ 2014-11-04 14:41 ` Felipe Balbi 2014-11-05 15:25 ` George Cherian 0 siblings, 1 reply; 14+ messages in thread From: Felipe Balbi @ 2014-11-04 14:41 UTC (permalink / raw) To: George Cherian Cc: Felipe Balbi, myungjoo.ham, cw00.choi, Linux Kernel Mailing List, Linux OMAP Mailing List, nsekhar, grant.likely [-- Attachment #1: Type: text/plain, Size: 365 bytes --] On Tue, Nov 04, 2014 at 11:42:04AM +0530, George Cherian wrote: > Hi Felipe et al. > > Another series was posted by removing the platform support. > https://lkml.org/lkml/2014/10/14/244 > > I guess I forgot to copy linux-omap. you do too many things in patch one. I wonder why you decided to combine three patches in one for that series. -- balbi [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 0/4] extcon: gpio: add DT support 2014-11-04 14:41 ` Felipe Balbi @ 2014-11-05 15:25 ` George Cherian 2014-11-05 18:28 ` Felipe Balbi 0 siblings, 1 reply; 14+ messages in thread From: George Cherian @ 2014-11-05 15:25 UTC (permalink / raw) To: balbi Cc: myungjoo.ham, cw00.choi, Linux Kernel Mailing List, Linux OMAP Mailing List, nsekhar, grant.likely On 11/04/2014 08:11 PM, Felipe Balbi wrote: > On Tue, Nov 04, 2014 at 11:42:04AM +0530, George Cherian wrote: >> Hi Felipe et al. >> >> Another series was posted by removing the platform support. >> https://lkml.org/lkml/2014/10/14/244 >> >> I guess I forgot to copy linux-omap. > you do too many things in patch one. I wonder why you decided to combine > three patches in one for that series. Since there are no platform users for this driver. I am basically removing the whole platform data part from the driver. That is the reason i squashed 1 to 3 of the previous series. I will resend the new series copying linux-omap now. ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 0/4] extcon: gpio: add DT support 2014-11-05 15:25 ` George Cherian @ 2014-11-05 18:28 ` Felipe Balbi 0 siblings, 0 replies; 14+ messages in thread From: Felipe Balbi @ 2014-11-05 18:28 UTC (permalink / raw) To: George Cherian Cc: balbi, myungjoo.ham, cw00.choi, Linux Kernel Mailing List, Linux OMAP Mailing List, nsekhar, grant.likely [-- Attachment #1: Type: text/plain, Size: 871 bytes --] On Wed, Nov 05, 2014 at 08:55:17PM +0530, George Cherian wrote: > > On 11/04/2014 08:11 PM, Felipe Balbi wrote: > >On Tue, Nov 04, 2014 at 11:42:04AM +0530, George Cherian wrote: > >>Hi Felipe et al. > >> > >>Another series was posted by removing the platform support. > >>https://lkml.org/lkml/2014/10/14/244 > >> > >>I guess I forgot to copy linux-omap. > >you do too many things in patch one. I wonder why you decided to combine > >three patches in one for that series. > Since there are no platform users for this driver. I am basically removing > the whole platform data part > from the driver. That is the reason i squashed 1 to 3 of the previous > series. > I will resend the new series copying linux-omap now. It doesn't make sense, however, to switch over to gpio descs, remove platform_data and add DT support all in one go. -- balbi [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2014-11-05 18:28 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-03 16:32 [PATCH 0/4] extcon: gpio: add DT support Felipe Balbi
2014-11-03 16:32 ` [PATCH 1/4] extcon: gpio: Convert the driver to use gpio desc API's Felipe Balbi
2014-11-03 18:01 ` Guenter Roeck
2014-11-03 18:06 ` Felipe Balbi
2014-11-03 18:51 ` Guenter Roeck
2014-11-03 20:43 ` Felipe Balbi
[not found] ` <1415032350-8459-1-git-send-email-balbi-l0cyMroinI0@public.gmane.org>
2014-11-03 16:32 ` [PATCH 2/4] extcon: gpio: Add dt support for the driver Felipe Balbi
2014-11-03 16:32 ` [PATCH 3/4] extcon: gpio: Always use gpio_get_value_cansleep Felipe Balbi
2014-11-03 16:32 ` [PATCH 4/4] extcon: gpio: Add support for using cable names Felipe Balbi
2014-11-03 16:39 ` Felipe Balbi
2014-11-04 6:12 ` [PATCH 0/4] extcon: gpio: add DT support George Cherian
2014-11-04 14:41 ` Felipe Balbi
2014-11-05 15:25 ` George Cherian
2014-11-05 18:28 ` Felipe Balbi
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).