aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen/imx6ul_tsc.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
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-20Input: 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-21Input: 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-15Input: 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-11-30Input: 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-11-30Input: 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-27Input: 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>