mfd: ti_am335x_tscadc: Reorder the initialization steps
authorMiquel Raynal <miquel.raynal@bootlin.com>
Fri, 15 Oct 2021 08:14:39 +0000 (10:14 +0200)
committerLee Jones <lee.jones@linaro.org>
Wed, 20 Oct 2021 16:28:34 +0000 (17:28 +0100)
commit3dafbe93be5d33113af1137c0e54a754cb72551b
tree280e44f50640a45a781767050331b75a5a856548
parent25b15d04a43ee2b022708fd0d42ae47c423c6ebf
mfd: ti_am335x_tscadc: Reorder the initialization steps

TI AM335X TRM [1] states that most of the configuration should be set in
the control register in the first place, before actually enabling the
hardware with the subsystem enable bit.

So far only half of the configuration was made in the first step (before
enabling the "subsystem"), which does not make really sense. Also, the
probe and the resume patch were acting differently. Let's harmonize all
this by following these steps:
1/ Configure the CLKDIV register
2/ Configure the CTRL register
3/ Configure the idle configuration
4/ Really enable the device by rewriting the CTRL register with the
   subsystem enable bit set.

[1] https://www.ti.com/lit/pdf/spruh73

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211015081506.933180-22-miquel.raynal@bootlin.com
drivers/mfd/ti_am335x_tscadc.c