From: Chanwoo Choi <cw00.choi@samsung.com> To: Felipe Balbi <balbi@ti.com>, Tony Lindgren <tony@atomide.com>, Rob Herring <robh+dt@kernel.org>, MyungJoo Ham <myungjoo.ham@samsung.com> Cc: Linux OMAP Mailing List <linux-omap@vger.kernel.org>, Linux ARM Kernel Mailing List <linux-arm-kernel@lists.infradead.org>, Linux Kernel Mailing List <linux-kernel@vger.kernel.org> Subject: Re: [PATCH] extcon: palmas: add support for using VBUSDET output Date: Fri, 20 Nov 2015 14:33:26 +0900 [thread overview] Message-ID: <564EB0A6.4060407@samsung.com> (raw) In-Reply-To: <1447351034-21150-1-git-send-email-balbi@ti.com> Hi Felipe, Looks good to me. But I have one comment. On 2015년 11월 13일 02:57, Felipe Balbi wrote: > TPS659038 can remux its GPIO_1 as VBUSDET output, > which can be tied to a SoC GPIO and used as a VBUS > interrupt. > > Beagle X15 uses that, in fact, and without it, I > could not get USB peripheral working with that > board. > > Signed-off-by: Felipe Balbi <balbi@ti.com> > --- > drivers/extcon/extcon-palmas.c | 22 ++++++++++++++++++++-- > 1 file changed, 20 insertions(+), 2 deletions(-) > > diff --git a/drivers/extcon/extcon-palmas.c b/drivers/extcon/extcon-palmas.c > index 93c30a885740..7985d092c069 100644 > --- a/drivers/extcon/extcon-palmas.c > +++ b/drivers/extcon/extcon-palmas.c > @@ -296,10 +296,28 @@ static int palmas_usb_probe(struct platform_device *pdev) > } > > if (palmas_usb->enable_vbus_detection) { > + int irq = platform_get_irq(pdev, 0); > + > + if (irq > 0) { > + /* remux GPIO_1 as VBUSDET */ > + status = palmas_update_bits(palmas, PALMAS_PU_PD_OD_BASE, > + PALMAS_PRIMARY_SECONDARY_PAD1, > + PALMAS_PRIMARY_SECONDARY_PAD1_GPIO_1_MASK, > + (1 << 3)); PALMAS_PRIMARY_SECONDARY_PAD1_GPIO_1_SHIFT is appropriate instead of using '3'. Also, I don't recommend the over line 80. The everything else is good > + if (status < 0) { > + dev_err(&pdev->dev, "can't remux GPIO1\n"); > + return status; > + } > + > + palmas_usb->vbus_irq = irq; > + } else { > + irq = regmap_irq_get_virq(palmas->irq_data, > + PALMAS_VBUS_IRQ); > + palmas_usb->vbus_irq = irq; > + } > + > palmas_usb->vbus_otg_irq = regmap_irq_get_virq(palmas->irq_data, > PALMAS_VBUS_OTG_IRQ); > - palmas_usb->vbus_irq = regmap_irq_get_virq(palmas->irq_data, > - PALMAS_VBUS_IRQ); > status = devm_request_threaded_irq(palmas_usb->dev, > palmas_usb->vbus_irq, NULL, > palmas_vbus_irq_handler, > Thanks, Chanwoo Choi
WARNING: multiple messages have this Message-ID (diff)
From: cw00.choi@samsung.com (Chanwoo Choi) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH] extcon: palmas: add support for using VBUSDET output Date: Fri, 20 Nov 2015 14:33:26 +0900 [thread overview] Message-ID: <564EB0A6.4060407@samsung.com> (raw) In-Reply-To: <1447351034-21150-1-git-send-email-balbi@ti.com> Hi Felipe, Looks good to me. But I have one comment. On 2015? 11? 13? 02:57, Felipe Balbi wrote: > TPS659038 can remux its GPIO_1 as VBUSDET output, > which can be tied to a SoC GPIO and used as a VBUS > interrupt. > > Beagle X15 uses that, in fact, and without it, I > could not get USB peripheral working with that > board. > > Signed-off-by: Felipe Balbi <balbi@ti.com> > --- > drivers/extcon/extcon-palmas.c | 22 ++++++++++++++++++++-- > 1 file changed, 20 insertions(+), 2 deletions(-) > > diff --git a/drivers/extcon/extcon-palmas.c b/drivers/extcon/extcon-palmas.c > index 93c30a885740..7985d092c069 100644 > --- a/drivers/extcon/extcon-palmas.c > +++ b/drivers/extcon/extcon-palmas.c > @@ -296,10 +296,28 @@ static int palmas_usb_probe(struct platform_device *pdev) > } > > if (palmas_usb->enable_vbus_detection) { > + int irq = platform_get_irq(pdev, 0); > + > + if (irq > 0) { > + /* remux GPIO_1 as VBUSDET */ > + status = palmas_update_bits(palmas, PALMAS_PU_PD_OD_BASE, > + PALMAS_PRIMARY_SECONDARY_PAD1, > + PALMAS_PRIMARY_SECONDARY_PAD1_GPIO_1_MASK, > + (1 << 3)); PALMAS_PRIMARY_SECONDARY_PAD1_GPIO_1_SHIFT is appropriate instead of using '3'. Also, I don't recommend the over line 80. The everything else is good > + if (status < 0) { > + dev_err(&pdev->dev, "can't remux GPIO1\n"); > + return status; > + } > + > + palmas_usb->vbus_irq = irq; > + } else { > + irq = regmap_irq_get_virq(palmas->irq_data, > + PALMAS_VBUS_IRQ); > + palmas_usb->vbus_irq = irq; > + } > + > palmas_usb->vbus_otg_irq = regmap_irq_get_virq(palmas->irq_data, > PALMAS_VBUS_OTG_IRQ); > - palmas_usb->vbus_irq = regmap_irq_get_virq(palmas->irq_data, > - PALMAS_VBUS_IRQ); > status = devm_request_threaded_irq(palmas_usb->dev, > palmas_usb->vbus_irq, NULL, > palmas_vbus_irq_handler, > Thanks, Chanwoo Choi
next prev parent reply other threads:[~2015-11-20 5:33 UTC|newest] Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top 2015-11-12 17:52 [PATCH 0/2] arm: beaglex15: fix USB Gadget Felipe Balbi 2015-11-12 17:52 ` Felipe Balbi 2015-11-12 17:52 ` Felipe Balbi 2015-11-12 17:53 ` [PATCH 1/2] arm: boot: dts: beaglex15: Remove ID GPIO Felipe Balbi 2015-11-12 17:53 ` Felipe Balbi 2015-11-12 17:53 ` Felipe Balbi 2015-11-12 17:53 ` [PATCH 2/2] arm: boot: beaglex15: pass correct interrupt Felipe Balbi 2015-11-12 17:53 ` Felipe Balbi 2015-11-12 17:53 ` Felipe Balbi 2015-11-20 5:39 ` Chanwoo Choi 2015-11-20 5:39 ` Chanwoo Choi 2015-11-20 5:39 ` Chanwoo Choi [not found] ` <564F4D90.4050305@gmail.com> 2015-11-20 16:55 ` Chanwoo Choi 2015-11-20 16:55 ` Chanwoo Choi 2015-11-20 16:55 ` Chanwoo Choi 2015-11-25 19:01 ` Tony Lindgren 2015-11-25 19:01 ` Tony Lindgren 2015-11-25 19:01 ` Tony Lindgren 2015-11-12 17:54 ` [PATCH 0/2] arm: beaglex15: fix USB Gadget Felipe Balbi 2015-11-12 17:54 ` Felipe Balbi 2015-11-12 17:54 ` Felipe Balbi 2015-11-12 17:57 ` [PATCH] extcon: palmas: add support for using VBUSDET output Felipe Balbi 2015-11-12 17:57 ` Felipe Balbi 2015-11-12 17:57 ` Felipe Balbi 2015-11-20 5:33 ` Chanwoo Choi [this message] 2015-11-20 5:33 ` Chanwoo Choi 2015-11-20 5:33 ` Chanwoo Choi 2015-11-20 5:44 ` Chanwoo Choi 2015-11-20 5:44 ` Chanwoo Choi 2015-11-20 5:44 ` Chanwoo Choi 2015-11-20 14:37 ` Felipe Balbi 2015-11-20 14:37 ` Felipe Balbi 2015-11-20 14:37 ` Felipe Balbi 2015-11-20 15:05 ` Chanwoo Choi 2015-11-20 15:05 ` Chanwoo Choi 2015-11-20 15:05 ` Chanwoo Choi 2015-11-20 16:37 ` Chanwoo Choi 2015-11-20 16:37 ` Chanwoo Choi 2015-11-20 16:37 ` Chanwoo Choi 2015-11-20 16:34 ` Chanwoo Choi 2015-11-20 16:34 ` Chanwoo Choi 2015-11-20 16:34 ` Chanwoo Choi
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=564EB0A6.4060407@samsung.com \ --to=cw00.choi@samsung.com \ --cc=balbi@ti.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-omap@vger.kernel.org \ --cc=myungjoo.ham@samsung.com \ --cc=robh+dt@kernel.org \ --cc=tony@atomide.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.