aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mfd
diff options
context:
space:
mode:
authorMiquel Raynal <miquel.raynal@bootlin.com>2021-10-15 10:14:53 +0200
committerLee Jones <lee.jones@linaro.org>2021-10-21 09:23:51 +0100
commitbf0f394c7b1e4d623ca2afdf59b3b4b95cc6f592 (patch)
treeca1afad54ccd2a97257e2ecd380974bc10b0d32c /include/linux/mfd
parentmfd: ti_am335x_tscadc: Add a boolean to clarify the presence of a touchscreen (diff)
downloadlinux-dev-bf0f394c7b1e4d623ca2afdf59b3b4b95cc6f592.tar.xz
linux-dev-bf0f394c7b1e4d623ca2afdf59b3b4b95cc6f592.zip
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
Diffstat (limited to 'include/linux/mfd')
-rw-r--r--include/linux/mfd/ti_am335x_tscadc.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/mfd/ti_am335x_tscadc.h b/include/linux/mfd/ti_am335x_tscadc.h
index cc6de9258455..ee160b2036c1 100644
--- a/include/linux/mfd/ti_am335x_tscadc.h
+++ b/include/linux/mfd/ti_am335x_tscadc.h
@@ -177,6 +177,12 @@ static inline struct ti_tscadc_dev *ti_tscadc_dev_get(struct platform_device *p)
return *tscadc_dev;
}
+static inline bool ti_adc_with_touchscreen(struct ti_tscadc_dev *tscadc)
+{
+ return of_device_is_compatible(tscadc->dev->of_node,
+ "ti,am3359-tscadc");
+}
+
void am335x_tsc_se_set_cache(struct ti_tscadc_dev *tsadc, u32 val);
void am335x_tsc_se_set_once(struct ti_tscadc_dev *tsadc, u32 val);
void am335x_tsc_se_clr(struct ti_tscadc_dev *tsadc, u32 val);