]> git.baikalelectronics.ru Git - kernel.git/commit
mfd: ti_am335x_tscadc: Introduce a helper to deal with the type of hardware
authorMiquel Raynal <miquel.raynal@bootlin.com>
Fri, 15 Oct 2021 08:14:53 +0000 (10:14 +0200)
committerLee Jones <lee.jones@linaro.org>
Thu, 21 Oct 2021 08:23:51 +0000 (09:23 +0100)
commitafe3826c2d24517498ab5ffa1f894daf3fd6c822
treeca1afad54ccd2a97257e2ecd380974bc10b0d32c
parente4a3b263bfd4dad9c7dbae4442dd20e5c974c9a4
mfd: ti_am335x_tscadc: Introduce a helper to deal with the type of hardware

One way of knowing which hardware we are dealing with is to check the
compatible string. When this must be done at several places, it's best
and certainly more clear to use a helper for that.

Introduce ti_adc_with_touchscreen() to indicate if there is a touchscreen
controller available (meaning it's an am33xx-like ADC). This helper does
not indicate if it is actually used (that is the purpose of the use_tsc
boolean).

Introducing this helper helps making a difference in the code between
what is generic to both types of ADCs and what is specific to the am33xx
hardware before introducing support for the am437x hardware.

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-36-miquel.raynal@bootlin.com
drivers/mfd/ti_am335x_tscadc.c
include/linux/mfd/ti_am335x_tscadc.h