summaryrefslogtreecommitdiff
path: root/drivers/input/touchscreen/imx6ul_tsc.c
AgeCommit message (Collapse)AuthorFilesLines
2023-01-10Input: imx6ul_tsc - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()Jonathan Cameron1-5/+5
SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection against unused function warnings. The new combination of pm_sleep_ptr() and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions, thus suppressing the warning, but still allowing the unused code to be removed. Thus also drop the __maybe_unused markings. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Haibo Chen <haibo.chen@nxp.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20230102181842.718010-51-jic23@kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-12-03Input: use input_device_enabled()Andrzej Pietrasiewicz1-2/+2
Use the newly added helper in relevant input drivers. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com> Link: https://lore.kernel.org/r/20200608112211.12125-3-andrzej.p@collabora.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-11-13Input: imx6ul_tsc - remove set but unused variable 'value'Lee Jones1-2/+1
Fixes the following W=1 kernel build warning(s): drivers/input/touchscreen/imx6ul_tsc.c: In function ‘adc_irq_fn’: drivers/input/touchscreen/imx6ul_tsc.c:307:6: warning: variable ‘value’ set but not used [-Wunused-but-set-variable] Signed-off-by: Lee Jones <lee.jones@linaro.org> Reviewed-by: Haibo Chen <haibo.chen@nxp.com> Link: https://lore.kernel.org/r/20201112110204.2083435-6-lee.jones@linaro.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-09-16Input: imx6ul_tsc - unify open/close and PM pathsDmitry Torokhov1-30/+22
Open/close and resume/suspend paths are very similar, let's factor out common parts. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2020-09-16Input: imx6ul_tsc - clean up some errors in imx6ul_tsc_resume()Dan Carpenter1-11/+16
If imx6ul_tsc_init() fails then we need to clean up the clocks. I reversed the "if (input_dev->users) {" condition to make the code a bit simpler. Fixes: 6cc527b05847 ("Input: imx6ul_tsc - propagate the errors") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/20200905124942.GC183976@mwanda Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-08-14Input: remove dev_err() usage after platform_get_irq()Stephen Boyd1-6/+2
We don't need dev_err() messages when platform_get_irq() fails now that platform_get_irq() prints an error message itself when something goes wrong. Let's remove these prints with a simple semantic patch. // <smpl> @@ expression ret; struct platform_device *E; @@ ret = ( platform_get_irq(E, ...) | platform_get_irq_byname(E, ...) ); if ( \( ret < 0 \| ret <= 0 \) ) { ( -if (ret != -EPROBE_DEFER) -{ ... -dev_err(...); -... } | ... -dev_err(...); ) ... } // </smpl> While we're here, remove braces on if statements that only have one statement (manually). Signed-off-by: Stephen Boyd <swboyd@chromium.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2019-05-21Input: imx6ul_tsc - use devm_platform_ioremap_resource() to simplify codeAnson Huang1-6/+2
Use the new helper devm_platform_ioremap_resource() which wraps the platform_get_resource() and devm_ioremap_resource() together, to simplify the code. Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Reviewed-by: Mukesh Ojha <mojha@codeaurora.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2018-06-22Input: imx6ul_tsc - switch to SPDX identifierFabio Estevam1-9/+5
Adopt the SPDX license identifier headers to ease license compliance management. Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-12Input: imx6ul_tsc - fix error handlingFabio Estevam1-3/+12
If imx6ul_tsc_init() fails we should not return directly. We should disable the previously acquired clocks in this case. Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2016-12-16Input: imx6ul_tsc - generalize the averaging propertyGuy Shapiro1-11/+27
Make the avarage-samples property a general touchscreen property rather than imx6ul device specific. Signed-off-by: Guy Shapiro <guy.shapiro@mobi-wize.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2016-12-01Input: imx6ul_tsc - convert int to u32Guy Shapiro1-21/+21
The code uses of_property_read_u32 and expects positive values. However, the values are stored in signed int variables. Additionally, the registers values are also stored in signed variables without a good reason (readl/writel expect u32). The only time this caused a real bug was in the new average-samples property, in which the property is numerically compared and implicitly expected to be positive. I believe it's better to change all the properties and registers to u32, for consistency and warnings reduction. Signed-off-by: Guy Shapiro <guy.shapiro@mobi-wize.com> Reported-by: Bjørn Forsman <bjorn.forsman@gmail.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2016-12-01Input: imx6ul_tsc - add mask when set REG_ADC_CFGHaibo Chen1-1/+10
Add mask of each function bits of REG_ADC_CFG, and clear these function bits first, otherwise use '|=' operation may get the wrong setting which depends on the original value of REG_ADC_CFG. Signed-off-by: Haibo Chen <haibo.chen@nxp.com> Reviewed-by: Guy Shapiro <guy.shapiro@mobi-wize.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2016-11-28Input: imx6ul_tsc - add support for sample averagingGuy Shapiro1-0/+18
The i.MX6UL internal touchscreen controller contains an option to average upon samples. This feature reduces noise from the produced touch locations. This patch adds sample averaging support to the imx6ul_tsc device driver. Signed-off-by: Guy Shapiro <guy.shapiro@mobi-wize.com> Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-09-19Input: imx6ul_tsc - fix controller nameFabio Estevam1-1/+1
We should better write "Touchscreen". Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-09-19Input: imx6ul_tsc - use the preferred method for kzalloc()Fabio Estevam1-1/+1
According to Documentation/CodingStyle: "The preferred form for passing a size of a struct is the following: p = kmalloc(sizeof(*p), ...);" so do as suggested. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-09-19Input: imx6ul_tsc - check for negative return valueFabio Estevam1-1/+1
We should check for negative values returned by platform_get_irq(). Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-09-19Input: imx6ul_tsc - propagate the errorsFabio Estevam1-9/+19
imx6ul_adc_init() may fail in two cases, so we should better propagate the errors and make sure that the callers of this function also check and propagate the errors accordingly. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-09-05Input: touchscreen - add imx6ul_tsc driver supportHaibo Chen1-0/+523
Freescale i.MX6UL contains a internal touchscreen controller, this patch add a driver to support this controller. Signed-off-by: Haibo Chen <haibo.chen@freescale.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>