* [PATCH 0/1] power_supply: twl4030_charger modification
@ 2011-02-25 11:56 Heikki Krogerus
2011-02-25 11:56 ` [PATCH 1/1] twl4030_charger: Make the driver atomic notifier safe Heikki Krogerus
2011-02-25 12:12 ` [PATCH 0/1] power_supply: twl4030_charger modification Felipe Balbi
0 siblings, 2 replies; 8+ messages in thread
From: Heikki Krogerus @ 2011-02-25 11:56 UTC (permalink / raw)
To: balbi; +Cc: linux-omap, notasas, cbouatmailru
Hi guys,
Grazvydas, I don't have hardware to test this with. If this is OK to
you, could you test it?
Felipe, was the idea that you take this with the atomic notifier
support for otg patches? I guess this is how it needs to be done in
order to keep things bisectable, right? Or does this simply go to
Anton?
Heikki Krogerus (1):
twl4030_charger: Make the driver atomic notifier safe
drivers/power/twl4030_charger.c | 25 +++++++++++++++++++------
1 files changed, 19 insertions(+), 6 deletions(-)
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/1] twl4030_charger: Make the driver atomic notifier safe
2011-02-25 11:56 [PATCH 0/1] power_supply: twl4030_charger modification Heikki Krogerus
@ 2011-02-25 11:56 ` Heikki Krogerus
2011-02-26 17:53 ` Grazvydas Ignotas
2011-02-25 12:12 ` [PATCH 0/1] power_supply: twl4030_charger modification Felipe Balbi
1 sibling, 1 reply; 8+ messages in thread
From: Heikki Krogerus @ 2011-02-25 11:56 UTC (permalink / raw)
To: balbi; +Cc: linux-omap, notasas, cbouatmailru
This queues work from the otg notification where the
i2c operations can be safely made. Needed for atomic otg
notifiers.
Signed-off-by: Heikki Krogerus <heikki.krogerus@nokia.com>
Cc: Grazvydas Ignotas <notasas@gmail.com>
Cc: Anton Vorontsov <cbouatmailru@gmail.com>
---
drivers/power/twl4030_charger.c | 25 +++++++++++++++++++------
1 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/drivers/power/twl4030_charger.c b/drivers/power/twl4030_charger.c
index ff1f423..92c16e1 100644
--- a/drivers/power/twl4030_charger.c
+++ b/drivers/power/twl4030_charger.c
@@ -71,8 +71,11 @@ struct twl4030_bci {
struct power_supply usb;
struct otg_transceiver *transceiver;
struct notifier_block otg_nb;
+ struct work_struct work;
int irq_chg;
int irq_bci;
+
+ unsigned long event;
};
/*
@@ -258,14 +261,11 @@ static irqreturn_t twl4030_bci_interrupt(int irq, void *arg)
return IRQ_HANDLED;
}
-static int twl4030_bci_usb_ncb(struct notifier_block *nb, unsigned long val,
- void *priv)
+static void twl4030_bci_usb_work(struct work_struct *data)
{
- struct twl4030_bci *bci = container_of(nb, struct twl4030_bci, otg_nb);
+ struct twl4030_bci *bci = container_of(data, struct twl4030_bci, work);
- dev_dbg(bci->dev, "OTG notify %lu\n", val);
-
- switch (val) {
+ switch (bci->event) {
case USB_EVENT_VBUS:
case USB_EVENT_CHARGER:
twl4030_charger_enable_usb(bci, true);
@@ -274,6 +274,17 @@ static int twl4030_bci_usb_ncb(struct notifier_block *nb, unsigned long val,
twl4030_charger_enable_usb(bci, false);
break;
}
+}
+
+static int twl4030_bci_usb_ncb(struct notifier_block *nb, unsigned long val,
+ void *priv)
+{
+ struct twl4030_bci *bci = container_of(nb, struct twl4030_bci, otg_nb);
+
+ dev_dbg(bci->dev, "OTG notify %lu\n", val);
+
+ bci->event = val;
+ schedule_work(&bci->work);
return NOTIFY_OK;
}
@@ -466,6 +477,8 @@ static int __init twl4030_bci_probe(struct platform_device *pdev)
goto fail_bci_irq;
}
+ INIT_WORK(&bci->work, twl4030_bci_usb_work);
+
bci->transceiver = otg_get_transceiver();
if (bci->transceiver != NULL) {
bci->otg_nb.notifier_call = twl4030_bci_usb_ncb;
--
1.7.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 0/1] power_supply: twl4030_charger modification
2011-02-25 11:56 [PATCH 0/1] power_supply: twl4030_charger modification Heikki Krogerus
2011-02-25 11:56 ` [PATCH 1/1] twl4030_charger: Make the driver atomic notifier safe Heikki Krogerus
@ 2011-02-25 12:12 ` Felipe Balbi
2011-02-26 18:10 ` Grazvydas Ignotas
1 sibling, 1 reply; 8+ messages in thread
From: Felipe Balbi @ 2011-02-25 12:12 UTC (permalink / raw)
To: Heikki Krogerus; +Cc: balbi, linux-omap, notasas, cbouatmailru
On Fri, Feb 25, 2011 at 01:56:35PM +0200, Heikki Krogerus wrote:
> Hi guys,
>
> Grazvydas, I don't have hardware to test this with. If this is OK to
> you, could you test it?
>
> Felipe, was the idea that you take this with the atomic notifier
> support for otg patches? I guess this is how it needs to be done in
> order to keep things bisectable, right? Or does this simply go to
> Anton?
We can't change patches anymore :-( So as long as it goes on the merge
window, we should be ok, hopefully.
--
balbi
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/1] twl4030_charger: Make the driver atomic notifier safe
2011-02-25 11:56 ` [PATCH 1/1] twl4030_charger: Make the driver atomic notifier safe Heikki Krogerus
@ 2011-02-26 17:53 ` Grazvydas Ignotas
2011-02-28 6:29 ` Heikki Krogerus
0 siblings, 1 reply; 8+ messages in thread
From: Grazvydas Ignotas @ 2011-02-26 17:53 UTC (permalink / raw)
To: Heikki Krogerus; +Cc: balbi, linux-omap, cbouatmailru
On Fri, Feb 25, 2011 at 1:56 PM, Heikki Krogerus
<heikki.krogerus@nokia.com> wrote:
> This queues work from the otg notification where the
> i2c operations can be safely made. Needed for atomic otg
> notifiers.
>
> Signed-off-by: Heikki Krogerus <heikki.krogerus@nokia.com>
> Cc: Grazvydas Ignotas <notasas@gmail.com>
> Cc: Anton Vorontsov <cbouatmailru@gmail.com>
seems to work fine.
Tested-by: Grazvydas Ignotas <notasas@gmail.com>
> ---
> drivers/power/twl4030_charger.c | 25 +++++++++++++++++++------
> 1 files changed, 19 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/power/twl4030_charger.c b/drivers/power/twl4030_charger.c
> index ff1f423..92c16e1 100644
> --- a/drivers/power/twl4030_charger.c
> +++ b/drivers/power/twl4030_charger.c
> @@ -71,8 +71,11 @@ struct twl4030_bci {
> struct power_supply usb;
> struct otg_transceiver *transceiver;
> struct notifier_block otg_nb;
> + struct work_struct work;
> int irq_chg;
> int irq_bci;
> +
> + unsigned long event;
> };
>
> /*
> @@ -258,14 +261,11 @@ static irqreturn_t twl4030_bci_interrupt(int irq, void *arg)
> return IRQ_HANDLED;
> }
>
> -static int twl4030_bci_usb_ncb(struct notifier_block *nb, unsigned long val,
> - void *priv)
> +static void twl4030_bci_usb_work(struct work_struct *data)
> {
> - struct twl4030_bci *bci = container_of(nb, struct twl4030_bci, otg_nb);
> + struct twl4030_bci *bci = container_of(data, struct twl4030_bci, work);
>
> - dev_dbg(bci->dev, "OTG notify %lu\n", val);
> -
> - switch (val) {
> + switch (bci->event) {
> case USB_EVENT_VBUS:
> case USB_EVENT_CHARGER:
> twl4030_charger_enable_usb(bci, true);
> @@ -274,6 +274,17 @@ static int twl4030_bci_usb_ncb(struct notifier_block *nb, unsigned long val,
> twl4030_charger_enable_usb(bci, false);
> break;
> }
> +}
> +
> +static int twl4030_bci_usb_ncb(struct notifier_block *nb, unsigned long val,
> + void *priv)
> +{
> + struct twl4030_bci *bci = container_of(nb, struct twl4030_bci, otg_nb);
> +
> + dev_dbg(bci->dev, "OTG notify %lu\n", val);
> +
> + bci->event = val;
> + schedule_work(&bci->work);
>
> return NOTIFY_OK;
> }
> @@ -466,6 +477,8 @@ static int __init twl4030_bci_probe(struct platform_device *pdev)
> goto fail_bci_irq;
> }
>
> + INIT_WORK(&bci->work, twl4030_bci_usb_work);
> +
> bci->transceiver = otg_get_transceiver();
> if (bci->transceiver != NULL) {
> bci->otg_nb.notifier_call = twl4030_bci_usb_ncb;
> --
> 1.7.1
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 0/1] power_supply: twl4030_charger modification
2011-02-25 12:12 ` [PATCH 0/1] power_supply: twl4030_charger modification Felipe Balbi
@ 2011-02-26 18:10 ` Grazvydas Ignotas
2011-02-28 6:05 ` Heikki Krogerus
0 siblings, 1 reply; 8+ messages in thread
From: Grazvydas Ignotas @ 2011-02-26 18:10 UTC (permalink / raw)
To: balbi; +Cc: Heikki Krogerus, linux-omap, cbouatmailru
On Fri, Feb 25, 2011 at 2:12 PM, Felipe Balbi <balbi@ti.com> wrote:
> On Fri, Feb 25, 2011 at 01:56:35PM +0200, Heikki Krogerus wrote:
>> Hi guys,
>>
>> Grazvydas, I don't have hardware to test this with. If this is OK to
>> you, could you test it?
Sure, replied to your patch.
>> Felipe, was the idea that you take this with the atomic notifier
>> support for otg patches? I guess this is how it needs to be done in
>> order to keep things bisectable, right? Or does this simply go to
>> Anton?
>
> We can't change patches anymore :-( So as long as it goes on the merge
> window, we should be ok, hopefully.
Talking about notifiers, do we have away to find the amount of current
host can provide yet? I haven't followed USB development closely
lately.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 0/1] power_supply: twl4030_charger modification
2011-02-26 18:10 ` Grazvydas Ignotas
@ 2011-02-28 6:05 ` Heikki Krogerus
0 siblings, 0 replies; 8+ messages in thread
From: Heikki Krogerus @ 2011-02-28 6:05 UTC (permalink / raw)
To: Grazvydas Ignotas; +Cc: balbi, linux-omap, cbouatmailru
On Sat, Feb 26, 2011 at 08:10:17PM +0200, ext Grazvydas Ignotas wrote:
> On Fri, Feb 25, 2011 at 2:12 PM, Felipe Balbi <balbi@ti.com> wrote:
> > On Fri, Feb 25, 2011 at 01:56:35PM +0200, Heikki Krogerus wrote:
> >> Hi guys,
> >>
> >> Grazvydas, I don't have hardware to test this with. If this is OK to
> >> you, could you test it?
>
> Sure, replied to your patch.
Thanks!
> >> Felipe, was the idea that you take this with the atomic notifier
> >> support for otg patches? I guess this is how it needs to be done in
> >> order to keep things bisectable, right? Or does this simply go to
> >> Anton?
> >
> > We can't change patches anymore :-( So as long as it goes on the merge
> > window, we should be ok, hopefully.
>
> Talking about notifiers, do we have away to find the amount of current
> host can provide yet? I haven't followed USB development closely
> lately.
There is nothing to support this yet. I'm only assuming the ENUMERATED
event will be used for this. Now with the atomic notifiers it should
be OK for the controller drivers to send this notification always when
usb_gadget_vbus_draw() is called.
But Felipe is working with the udc class. Maybe he has some other
method in mind? For now I think we could send the ENUMERATED
event from all the controller drivers. Felipe?
--
heikki
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/1] twl4030_charger: Make the driver atomic notifier safe
2011-02-26 17:53 ` Grazvydas Ignotas
@ 2011-02-28 6:29 ` Heikki Krogerus
2011-02-28 14:32 ` Anton Vorontsov
0 siblings, 1 reply; 8+ messages in thread
From: Heikki Krogerus @ 2011-02-28 6:29 UTC (permalink / raw)
To: Anton Vorontsov; +Cc: Grazvydas Ignotas, balbi, linux-omap
On Sat, Feb 26, 2011 at 07:53:03PM +0200, ext Grazvydas Ignotas wrote:
> On Fri, Feb 25, 2011 at 1:56 PM, Heikki Krogerus
> <heikki.krogerus@nokia.com> wrote:
> > This queues work from the otg notification where the
> > i2c operations can be safely made. Needed for atomic otg
> > notifiers.
> >
> > Signed-off-by: Heikki Krogerus <heikki.krogerus@nokia.com>
> > Cc: Grazvydas Ignotas <notasas@gmail.com>
> > Cc: Anton Vorontsov <cbouatmailru@gmail.com>
>
> seems to work fine.
> Tested-by: Grazvydas Ignotas <notasas@gmail.com>
Anton, can you take this?
--
heikki
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/1] twl4030_charger: Make the driver atomic notifier safe
2011-02-28 6:29 ` Heikki Krogerus
@ 2011-02-28 14:32 ` Anton Vorontsov
0 siblings, 0 replies; 8+ messages in thread
From: Anton Vorontsov @ 2011-02-28 14:32 UTC (permalink / raw)
To: Heikki Krogerus; +Cc: Grazvydas Ignotas, balbi, linux-omap
On Mon, Feb 28, 2011 at 08:29:53AM +0200, Heikki Krogerus wrote:
> On Sat, Feb 26, 2011 at 07:53:03PM +0200, ext Grazvydas Ignotas wrote:
> > On Fri, Feb 25, 2011 at 1:56 PM, Heikki Krogerus
> > <heikki.krogerus@nokia.com> wrote:
> > > This queues work from the otg notification where the
> > > i2c operations can be safely made. Needed for atomic otg
> > > notifiers.
> > >
> > > Signed-off-by: Heikki Krogerus <heikki.krogerus@nokia.com>
> > > Cc: Grazvydas Ignotas <notasas@gmail.com>
> > > Cc: Anton Vorontsov <cbouatmailru@gmail.com>
> >
> > seems to work fine.
> > Tested-by: Grazvydas Ignotas <notasas@gmail.com>
>
> Anton, can you take this?
Applied, thanks!
--
Anton Vorontsov
Email: cbouatmailru@gmail.com
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2011-02-28 14:32 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-25 11:56 [PATCH 0/1] power_supply: twl4030_charger modification Heikki Krogerus
2011-02-25 11:56 ` [PATCH 1/1] twl4030_charger: Make the driver atomic notifier safe Heikki Krogerus
2011-02-26 17:53 ` Grazvydas Ignotas
2011-02-28 6:29 ` Heikki Krogerus
2011-02-28 14:32 ` Anton Vorontsov
2011-02-25 12:12 ` [PATCH 0/1] power_supply: twl4030_charger modification Felipe Balbi
2011-02-26 18:10 ` Grazvydas Ignotas
2011-02-28 6:05 ` Heikki Krogerus
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox