linux/drivers/w1/masters
Tony Lindgren 27d13da878 w1: omap-hdq: Simplify driver with PM runtime autosuspend
We've had generic code handling module sysconfig and OCP reset registers
for omap variants for many years now and all the drivers really needs to
do is just call runtime PM functions.

Looks like the omap-hdq driver got only partially updated over the years
to use runtime PM, and still has lots of custom PM code left.

We can replace all the custom code for sysconfig, OCP reset, and PM with
just a few lines of runtime PM autosuspend code.

In order to set the device mode properly when pm_runtime_get_sync() is
called during probe, we need to also move parsing of "ti,mode" to happen
earlier before we call pm_runtime_enable().

Since we now disable interrupts lazily in omap_hdq_runtime_suspend(), we
must remove the call to hdq_disable_interrupt() in omap_w1_read_byte().
And we must clear irqstatus calling wait_event_timeout() on it, so let's
add hdq_reset_irqstatus() for that.

Note that the earlier driver specific usage count limit of four seems
completely artificial and should not be an issue in normal use.

Cc: Adam Ford <aford173@gmail.com>
Cc: Andrew F. Davis <afd@ti.com>
Cc: Andreas Kemnade <andreas@kemnade.info>
Cc: H. Nikolaus Schaller <hns@goldelico.com>
Cc: Vignesh R <vigneshr@ti.com>
Tested-by: Andreas Kemnade <andreas@kemnade.info> # gta04
Tested-by: Adam Ford <aford173@gmail.com> #logicpd-torpedo-37xx-devkit
Signed-off-by: Tony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/20191217004048.46298-1-tony@atomide.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-01-14 21:46:48 +01:00
..
ds1wm.c w1: ds1wm: add messages to make incorporation in mfd-drivers easier 2017-08-28 17:20:01 +02:00
ds2482.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441 2019-06-05 17:37:17 +02:00
ds2490.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
Kconfig w1: add 1-wire master driver for IP block found in SGI ASICs 2019-09-04 14:34:31 +02:00
Makefile w1: add 1-wire master driver for IP block found in SGI ASICs 2019-09-04 14:34:31 +02:00
matrox_w1.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
mxc_w1.c w1: mxc_w1: use devm_platform_ioremap_resource() to simplify code 2019-08-05 17:56:46 +02:00
omap_hdq.c w1: omap-hdq: Simplify driver with PM runtime autosuspend 2020-01-14 21:46:48 +01:00
sgi_w1.c w1: sgi_w1: use devm_platform_ioremap_resource() to simplify code 2019-10-10 15:24:18 +02:00
w1-gpio.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00