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)
commitbf0f394c7b1e4d623ca2afdf59b3b4b95cc6f592
treeca1afad54ccd2a97257e2ecd380974bc10b0d32c
parent2a4e333a2e9c99ddd27f0a05ef87aae6c3362f8a
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