* [PATCH v5 06/11] i2c: core: Convert to dev_pm_domain_attach|detach()
[not found] ` <1411151264-16245-1-git-send-email-ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
@ 2014-09-19 18:27 ` Ulf Hansson
[not found] ` <1411151264-16245-7-git-send-email-ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Ulf Hansson @ 2014-09-19 18:27 UTC (permalink / raw)
To: Rafael J. Wysocki, Len Brown, Pavel Machek, Greg Kroah-Hartman,
linux-pm-u79uwXL29TY76Z2rM5mHXA
Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-acpi-u79uwXL29TY76Z2rM5mHXA, Geert Uytterhoeven,
Kevin Hilman, Alan Stern, Daniel Lezcano, Tomasz Figa,
devicetree-u79uwXL29TY76Z2rM5mHXA, Linus Walleij, Simon Horman,
Magnus Damm, Ben Dooks, Kukjin Kim, Stephen Boyd, Philipp Zabel,
Mark Brown, Wolfram Sang, Chris Ball, Russell King,
Dmitry Torokhov, Ulf Hansson, linux-i2c-u79uwXL29TY76Z2rM5mHXA
Previously only the ACPI PM domain was supported by the i2c bus.
Let's convert to the common attach/detach functions for PM domains,
which currently means we are extending the support to include the
generic PM domain as well.
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Signed-off-by: Ulf Hansson <ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Reviewed-by: Kevin Hilman <khilman-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
---
drivers/i2c/i2c-core.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 632057a..3cd8f11 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -279,10 +279,13 @@ static int i2c_device_probe(struct device *dev)
if (status < 0)
return status;
- acpi_dev_pm_attach(&client->dev, true);
- status = driver->probe(client, i2c_match_id(driver->id_table, client));
- if (status)
- acpi_dev_pm_detach(&client->dev, true);
+ status = dev_pm_domain_attach(&client->dev, true);
+ if (status != -EPROBE_DEFER) {
+ status = driver->probe(client, i2c_match_id(driver->id_table,
+ client));
+ if (status)
+ dev_pm_domain_detach(&client->dev, true);
+ }
return status;
}
@@ -302,7 +305,7 @@ static int i2c_device_remove(struct device *dev)
status = driver->remove(client);
}
- acpi_dev_pm_detach(&client->dev, true);
+ dev_pm_domain_detach(&client->dev, true);
return status;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v5 06/11] i2c: core: Convert to dev_pm_domain_attach|detach()
[not found] ` <1411151264-16245-7-git-send-email-ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
@ 2014-09-20 12:23 ` Wolfram Sang
2014-09-20 23:48 ` Rafael J. Wysocki
2014-09-22 9:52 ` Mika Westerberg
0 siblings, 2 replies; 5+ messages in thread
From: Wolfram Sang @ 2014-09-20 12:23 UTC (permalink / raw)
To: Ulf Hansson
Cc: Rafael J. Wysocki, Len Brown, Pavel Machek, Greg Kroah-Hartman,
linux-pm-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-acpi-u79uwXL29TY76Z2rM5mHXA, Geert Uytterhoeven,
Kevin Hilman, Alan Stern, Daniel Lezcano, Tomasz Figa,
devicetree-u79uwXL29TY76Z2rM5mHXA, Linus Walleij, Simon Horman,
Magnus Damm, Ben Dooks, Kukjin Kim, Stephen Boyd, Philipp Zabel,
Mark Brown, Chris Ball, Russell King, Dmitry Torokhov
[-- Attachment #1: Type: text/plain, Size: 1841 bytes --]
On Fri, Sep 19, 2014 at 08:27:39PM +0200, Ulf Hansson wrote:
> Previously only the ACPI PM domain was supported by the i2c bus.
>
> Let's convert to the common attach/detach functions for PM domains,
> which currently means we are extending the support to include the
> generic PM domain as well.
>
> Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> Signed-off-by: Ulf Hansson <ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> Reviewed-by: Kevin Hilman <khilman-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Looks good to me, but I'd like to give Mika a chance to look at it,
since he does ACPI with I2C. Adding to CC.
> ---
> drivers/i2c/i2c-core.c | 13 ++++++++-----
> 1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
> index 632057a..3cd8f11 100644
> --- a/drivers/i2c/i2c-core.c
> +++ b/drivers/i2c/i2c-core.c
> @@ -279,10 +279,13 @@ static int i2c_device_probe(struct device *dev)
> if (status < 0)
> return status;
>
> - acpi_dev_pm_attach(&client->dev, true);
> - status = driver->probe(client, i2c_match_id(driver->id_table, client));
> - if (status)
> - acpi_dev_pm_detach(&client->dev, true);
> + status = dev_pm_domain_attach(&client->dev, true);
> + if (status != -EPROBE_DEFER) {
> + status = driver->probe(client, i2c_match_id(driver->id_table,
> + client));
Very minor: I think it is more readable to keep this in one line.
> + if (status)
> + dev_pm_domain_detach(&client->dev, true);
> + }
>
> return status;
> }
> @@ -302,7 +305,7 @@ static int i2c_device_remove(struct device *dev)
> status = driver->remove(client);
> }
>
> - acpi_dev_pm_detach(&client->dev, true);
> + dev_pm_domain_detach(&client->dev, true);
> return status;
> }
>
> --
> 1.9.1
>
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v5 06/11] i2c: core: Convert to dev_pm_domain_attach|detach()
2014-09-20 12:23 ` Wolfram Sang
@ 2014-09-20 23:48 ` Rafael J. Wysocki
2014-09-22 9:52 ` Mika Westerberg
1 sibling, 0 replies; 5+ messages in thread
From: Rafael J. Wysocki @ 2014-09-20 23:48 UTC (permalink / raw)
To: Wolfram Sang
Cc: Ulf Hansson, Len Brown, Pavel Machek, Greg Kroah-Hartman,
linux-pm, linux-arm-kernel, linux-acpi, Geert Uytterhoeven,
Kevin Hilman, Alan Stern, Daniel Lezcano, Tomasz Figa, devicetree,
Linus Walleij, Simon Horman, Magnus Damm, Ben Dooks, Kukjin Kim,
Stephen Boyd, Philipp Zabel, Mark Brown, Chris Ball, Russell King,
Dmitry Torokhov
On Saturday, September 20, 2014 02:23:19 PM Wolfram Sang wrote:
>
> --bAmEntskrkuBymla
> Content-Type: text/plain; charset=us-ascii
> Content-Disposition: inline
> Content-Transfer-Encoding: quoted-printable
>
> On Fri, Sep 19, 2014 at 08:27:39PM +0200, Ulf Hansson wrote:
> > Previously only the ACPI PM domain was supported by the i2c bus.
> >=20
> > Let's convert to the common attach/detach functions for PM domains,
> > which currently means we are extending the support to include the
> > generic PM domain as well.
> >=20
> > Cc: linux-i2c@vger.kernel.org
> > Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> > Reviewed-by: Kevin Hilman <khilman@linaro.org>
>
> Looks good to me, but I'd like to give Mika a chance to look at it,
> since he does ACPI with I2C. Adding to CC.
It is not applicable without the [4/9] in this series anyway.
> > ---
> > drivers/i2c/i2c-core.c | 13 ++++++++-----
> > 1 file changed, 8 insertions(+), 5 deletions(-)
> >=20
> > diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
> > index 632057a..3cd8f11 100644
> > --- a/drivers/i2c/i2c-core.c
> > +++ b/drivers/i2c/i2c-core.c
> > @@ -279,10 +279,13 @@ static int i2c_device_probe(struct device *dev)
> > if (status < 0)
> > return status;
> > =20
> > - acpi_dev_pm_attach(&client->dev, true);
> > - status =3D driver->probe(client, i2c_match_id(driver->id_table, client)=
> );
> > - if (status)
> > - acpi_dev_pm_detach(&client->dev, true);
> > + status =3D dev_pm_domain_attach(&client->dev, true);
> > + if (status !=3D -EPROBE_DEFER) {
> > + status =3D driver->probe(client, i2c_match_id(driver->id_table,
> > + client));
>
> Very minor: I think it is more readable to keep this in one line.
Agreed.
> > + if (status)
> > + dev_pm_domain_detach(&client->dev, true);
> > + }
> > =20
> > return status;
> > }
> > @@ -302,7 +305,7 @@ static int i2c_device_remove(struct device *dev)
> > status =3D driver->remove(client);
> > }
> > =20
> > - acpi_dev_pm_detach(&client->dev, true);
> > + dev_pm_domain_detach(&client->dev, true);
> > return status;
> > }
> > =20
> > --=20
> > 1.9.1
> >=20
>
> --bAmEntskrkuBymla
> Content-Type: application/pgp-signature; name="signature.asc"
> Content-Description: Digital signature
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1
>
> iQIcBAEBAgAGBQJUHXG2AAoJEBQN5MwUoCm2E7EP/1ykOCTRgrozlYwdbXxO9X8Z
> b6ad23VambrSiQJTZcYheydiVW9qrXIsn8TQf1flWChXtkD06odQRy8tGN8Vw3MQ
> MTdhyB19x1Z0TMkdmcrbhohsRchjsaeMgcpCNklW8ul8nASuDjY9KUdhVfUaY07q
> O1zyZxrA5ykPCq/xP2gakHTTOrB6pj0zwOlDe4yQOd1hJcWrhX0/EBxY4DgvvQIr
> o05w2rdr+s6qCCgV3WSY9EJ0JBOqNhvvGpGnpZe6tms8e1RmrEnSil3piBC1nhHP
> LPeZr/ZHdoRbEgUPNnr/otLhufVeE5uMLu7FFhmZi3DTVXXVb+kMjE17C6XYc3mM
> DIumY2ubMBInCIZDjFZa0BvwuodKqkWrG5cmgimDw8VywhDfmCXm7Q1immbKZ0rw
> p9R4YHkBl5ii0KCyTSrf5M4+ksV80iplb4jmIwfmU0kKnOIan1fgkmyHXR/WN67M
> d6sZUpMsuCUNTRj7Axe6LdKuuQe/EbO9GC66umjxtckJIesM/BSHHgGAGqnxQolQ
> q/NnP2JBTVz6sSjoBRb+EMw5cri2Yb2M1Ak24nw+uoveiqBGGMuFFQGoHyV9UXVP
> zA0MaUKKESiwO1RIaqhYe5lRwIwFSUktD5s/yYQqKbSF0zGAeRn79O+U2ei7xI9a
> gv2ABkxPmYxBPoSf9y1B
> =izqF
> -----END PGP SIGNATURE-----
>
> --bAmEntskrkuBymla--
>
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v5 06/11] i2c: core: Convert to dev_pm_domain_attach|detach()
2014-09-20 12:23 ` Wolfram Sang
2014-09-20 23:48 ` Rafael J. Wysocki
@ 2014-09-22 9:52 ` Mika Westerberg
2014-09-22 10:00 ` Wolfram Sang
1 sibling, 1 reply; 5+ messages in thread
From: Mika Westerberg @ 2014-09-22 9:52 UTC (permalink / raw)
To: Wolfram Sang
Cc: Ulf Hansson, Rafael J. Wysocki, Len Brown, Pavel Machek,
Greg Kroah-Hartman, linux-pm, linux-arm-kernel, linux-acpi,
Geert Uytterhoeven, Kevin Hilman, Alan Stern, Daniel Lezcano,
Tomasz Figa, devicetree, Linus Walleij, Simon Horman, Magnus Damm,
Ben Dooks, Kukjin Kim, Stephen Boyd, Philipp Zabel, Mark Brown,
Chris Ball, Russell King
On Sat, Sep 20, 2014 at 02:23:19PM +0200, Wolfram Sang wrote:
> On Fri, Sep 19, 2014 at 08:27:39PM +0200, Ulf Hansson wrote:
> > Previously only the ACPI PM domain was supported by the i2c bus.
> >
> > Let's convert to the common attach/detach functions for PM domains,
> > which currently means we are extending the support to include the
> > generic PM domain as well.
> >
> > Cc: linux-i2c@vger.kernel.org
> > Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> > Reviewed-by: Kevin Hilman <khilman@linaro.org>
>
> Looks good to me, but I'd like to give Mika a chance to look at it,
> since he does ACPI with I2C. Adding to CC.
Looks fine to me.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v5 06/11] i2c: core: Convert to dev_pm_domain_attach|detach()
2014-09-22 9:52 ` Mika Westerberg
@ 2014-09-22 10:00 ` Wolfram Sang
0 siblings, 0 replies; 5+ messages in thread
From: Wolfram Sang @ 2014-09-22 10:00 UTC (permalink / raw)
To: Mika Westerberg
Cc: Ulf Hansson, Rafael J. Wysocki, Len Brown, Pavel Machek,
Greg Kroah-Hartman, linux-pm, linux-arm-kernel, linux-acpi,
Geert Uytterhoeven, Kevin Hilman, Alan Stern, Daniel Lezcano,
Tomasz Figa, devicetree, Linus Walleij, Simon Horman, Magnus Damm,
Ben Dooks, Kukjin Kim, Stephen Boyd, Philipp Zabel, Mark Brown,
Chris Ball, Russell King
[-- Attachment #1: Type: text/plain, Size: 832 bytes --]
On Mon, Sep 22, 2014 at 12:52:53PM +0300, Mika Westerberg wrote:
> On Sat, Sep 20, 2014 at 02:23:19PM +0200, Wolfram Sang wrote:
> > On Fri, Sep 19, 2014 at 08:27:39PM +0200, Ulf Hansson wrote:
> > > Previously only the ACPI PM domain was supported by the i2c bus.
> > >
> > > Let's convert to the common attach/detach functions for PM domains,
> > > which currently means we are extending the support to include the
> > > generic PM domain as well.
> > >
> > > Cc: linux-i2c@vger.kernel.org
> > > Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> > > Reviewed-by: Kevin Hilman <khilman@linaro.org>
> >
> > Looks good to me, but I'd like to give Mika a chance to look at it,
> > since he does ACPI with I2C. Adding to CC.
>
> Looks fine to me.
Thanks! So:
Acked-by: Wolfram Sang <wsa@the-dreams.de>
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-09-22 10:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1411151264-16245-1-git-send-email-ulf.hansson@linaro.org>
[not found] ` <1411151264-16245-1-git-send-email-ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2014-09-19 18:27 ` [PATCH v5 06/11] i2c: core: Convert to dev_pm_domain_attach|detach() Ulf Hansson
[not found] ` <1411151264-16245-7-git-send-email-ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2014-09-20 12:23 ` Wolfram Sang
2014-09-20 23:48 ` Rafael J. Wysocki
2014-09-22 9:52 ` Mika Westerberg
2014-09-22 10:00 ` Wolfram Sang
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).