Message ID | 20210825152518.379386-22-miquel.raynal@bootlin.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | TI AM437X ADC1 | expand |
On Wed, 25 Aug 2021 17:24:59 +0200 Miquel Raynal <miquel.raynal@bootlin.com> wrote: > This bit is common to all devices (ADC, Touchscreen, Magnetic reader) so > make it clear that it can be used from any location by operating a > mechanical rename: > s/CNTRLREG_TSCSSENB/CNTRLREG_SSENB/ > > Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> I don't feel strongly either way on this one but if you feel it's a good idea fair enough. Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> > --- > drivers/iio/adc/ti_am335x_adc.c | 6 +++--- > drivers/mfd/ti_am335x_tscadc.c | 6 +++--- > include/linux/mfd/ti_am335x_tscadc.h | 2 +- > 3 files changed, 7 insertions(+), 7 deletions(-) > > diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c > index 855cc2d64ac8..f748d49f10f4 100644 > --- a/drivers/iio/adc/ti_am335x_adc.c > +++ b/drivers/iio/adc/ti_am335x_adc.c > @@ -184,7 +184,7 @@ static irqreturn_t tiadc_irq_h(int irq, void *private) > if (status & IRQENB_FIFO1OVRRUN) { > /* FIFO Overrun. Clear flag. Disable/Enable ADC to recover */ > config = tiadc_readl(adc_dev, REG_CTRL); > - config &= ~(CNTRLREG_TSCSSENB); > + config &= ~(CNTRLREG_SSENB); > tiadc_writel(adc_dev, REG_CTRL, config); > tiadc_writel(adc_dev, REG_IRQSTATUS, IRQENB_FIFO1OVRRUN > | IRQENB_FIFO1UNDRFLW | IRQENB_FIFO1THRES); > @@ -197,7 +197,7 @@ static irqreturn_t tiadc_irq_h(int irq, void *private) > adc_fsm = tiadc_readl(adc_dev, REG_ADCFSM); > } while (adc_fsm != 0x10 && count++ < 100); > > - tiadc_writel(adc_dev, REG_CTRL, (config | CNTRLREG_TSCSSENB)); > + tiadc_writel(adc_dev, REG_CTRL, (config | CNTRLREG_SSENB)); > return IRQ_HANDLED; > } else if (status & IRQENB_FIFO1THRES) { > /* Disable irq and wake worker thread */ > @@ -671,7 +671,7 @@ static int __maybe_unused tiadc_suspend(struct device *dev) > unsigned int idle; > > idle = tiadc_readl(adc_dev, REG_CTRL); > - idle &= ~(CNTRLREG_TSCSSENB); > + idle &= ~(CNTRLREG_SSENB); > tiadc_writel(adc_dev, REG_CTRL, (idle | > CNTRLREG_POWERDOWN)); > > diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c > index d661e8ae66c9..dd303523f9a3 100644 > --- a/drivers/mfd/ti_am335x_tscadc.c > +++ b/drivers/mfd/ti_am335x_tscadc.c > @@ -229,7 +229,7 @@ static int ti_tscadc_probe(struct platform_device *pdev) > tscadc_idle_config(tscadc); > > /* Enable the TSC module enable bit */ > - regmap_write(tscadc->regmap, REG_CTRL, tscadc->ctrl | CNTRLREG_TSCSSENB); > + regmap_write(tscadc->regmap, REG_CTRL, tscadc->ctrl | CNTRLREG_SSENB); > > /* TSC Cell */ > if (tsc_wires > 0) { > @@ -293,7 +293,7 @@ static int __maybe_unused tscadc_suspend(struct device *dev) > > regmap_read(tscadc->regmap, REG_CTRL, &ctrl); > ctrl &= ~(CNTRLREG_POWERDOWN); > - ctrl |= CNTRLREG_TSCSSENB; > + ctrl |= CNTRLREG_SSENB; > regmap_write(tscadc->regmap, REG_CTRL, ctrl); > } > pm_runtime_put_sync(dev); > @@ -310,7 +310,7 @@ static int __maybe_unused tscadc_resume(struct device *dev) > regmap_write(tscadc->regmap, REG_CLKDIV, tscadc->clk_div); > regmap_write(tscadc->regmap, REG_CTRL, tscadc->ctrl); > tscadc_idle_config(tscadc); > - regmap_write(tscadc->regmap, REG_CTRL, tscadc->ctrl | CNTRLREG_TSCSSENB); > + regmap_write(tscadc->regmap, REG_CTRL, tscadc->ctrl | CNTRLREG_SSENB); > > return 0; > } > diff --git a/include/linux/mfd/ti_am335x_tscadc.h b/include/linux/mfd/ti_am335x_tscadc.h > index 02963b6ebbac..a900fae8354c 100644 > --- a/include/linux/mfd/ti_am335x_tscadc.h > +++ b/include/linux/mfd/ti_am335x_tscadc.h > @@ -118,7 +118,7 @@ > #define CHARGEDLY_OPENDLY CHARGEDLY_OPEN(0x400) > > /* Control register */ > -#define CNTRLREG_TSCSSENB BIT(0) > +#define CNTRLREG_SSENB BIT(0) > #define CNTRLREG_STEPID BIT(1) > #define CNTRLREG_STEPCONFIGWRT BIT(2) > #define CNTRLREG_POWERDOWN BIT(4)
diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c index 855cc2d64ac8..f748d49f10f4 100644 --- a/drivers/iio/adc/ti_am335x_adc.c +++ b/drivers/iio/adc/ti_am335x_adc.c @@ -184,7 +184,7 @@ static irqreturn_t tiadc_irq_h(int irq, void *private) if (status & IRQENB_FIFO1OVRRUN) { /* FIFO Overrun. Clear flag. Disable/Enable ADC to recover */ config = tiadc_readl(adc_dev, REG_CTRL); - config &= ~(CNTRLREG_TSCSSENB); + config &= ~(CNTRLREG_SSENB); tiadc_writel(adc_dev, REG_CTRL, config); tiadc_writel(adc_dev, REG_IRQSTATUS, IRQENB_FIFO1OVRRUN | IRQENB_FIFO1UNDRFLW | IRQENB_FIFO1THRES); @@ -197,7 +197,7 @@ static irqreturn_t tiadc_irq_h(int irq, void *private) adc_fsm = tiadc_readl(adc_dev, REG_ADCFSM); } while (adc_fsm != 0x10 && count++ < 100); - tiadc_writel(adc_dev, REG_CTRL, (config | CNTRLREG_TSCSSENB)); + tiadc_writel(adc_dev, REG_CTRL, (config | CNTRLREG_SSENB)); return IRQ_HANDLED; } else if (status & IRQENB_FIFO1THRES) { /* Disable irq and wake worker thread */ @@ -671,7 +671,7 @@ static int __maybe_unused tiadc_suspend(struct device *dev) unsigned int idle; idle = tiadc_readl(adc_dev, REG_CTRL); - idle &= ~(CNTRLREG_TSCSSENB); + idle &= ~(CNTRLREG_SSENB); tiadc_writel(adc_dev, REG_CTRL, (idle | CNTRLREG_POWERDOWN)); diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c index d661e8ae66c9..dd303523f9a3 100644 --- a/drivers/mfd/ti_am335x_tscadc.c +++ b/drivers/mfd/ti_am335x_tscadc.c @@ -229,7 +229,7 @@ static int ti_tscadc_probe(struct platform_device *pdev) tscadc_idle_config(tscadc); /* Enable the TSC module enable bit */ - regmap_write(tscadc->regmap, REG_CTRL, tscadc->ctrl | CNTRLREG_TSCSSENB); + regmap_write(tscadc->regmap, REG_CTRL, tscadc->ctrl | CNTRLREG_SSENB); /* TSC Cell */ if (tsc_wires > 0) { @@ -293,7 +293,7 @@ static int __maybe_unused tscadc_suspend(struct device *dev) regmap_read(tscadc->regmap, REG_CTRL, &ctrl); ctrl &= ~(CNTRLREG_POWERDOWN); - ctrl |= CNTRLREG_TSCSSENB; + ctrl |= CNTRLREG_SSENB; regmap_write(tscadc->regmap, REG_CTRL, ctrl); } pm_runtime_put_sync(dev); @@ -310,7 +310,7 @@ static int __maybe_unused tscadc_resume(struct device *dev) regmap_write(tscadc->regmap, REG_CLKDIV, tscadc->clk_div); regmap_write(tscadc->regmap, REG_CTRL, tscadc->ctrl); tscadc_idle_config(tscadc); - regmap_write(tscadc->regmap, REG_CTRL, tscadc->ctrl | CNTRLREG_TSCSSENB); + regmap_write(tscadc->regmap, REG_CTRL, tscadc->ctrl | CNTRLREG_SSENB); return 0; } diff --git a/include/linux/mfd/ti_am335x_tscadc.h b/include/linux/mfd/ti_am335x_tscadc.h index 02963b6ebbac..a900fae8354c 100644 --- a/include/linux/mfd/ti_am335x_tscadc.h +++ b/include/linux/mfd/ti_am335x_tscadc.h @@ -118,7 +118,7 @@ #define CHARGEDLY_OPENDLY CHARGEDLY_OPEN(0x400) /* Control register */ -#define CNTRLREG_TSCSSENB BIT(0) +#define CNTRLREG_SSENB BIT(0) #define CNTRLREG_STEPID BIT(1) #define CNTRLREG_STEPCONFIGWRT BIT(2) #define CNTRLREG_POWERDOWN BIT(4)
This bit is common to all devices (ADC, Touchscreen, Magnetic reader) so make it clear that it can be used from any location by operating a mechanical rename: s/CNTRLREG_TSCSSENB/CNTRLREG_SSENB/ Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> --- drivers/iio/adc/ti_am335x_adc.c | 6 +++--- drivers/mfd/ti_am335x_tscadc.c | 6 +++--- include/linux/mfd/ti_am335x_tscadc.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-)