public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: "Lothar Waßmann" <LW@KARO-electronics.de>
To: Markus Pargmann <mpa@pengutronix.de>
Cc: "Shawn Guo" <shawn.guo@linaro.org>,
	"Samuel Ortiz" <sameo@linux.intel.com>,
	"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
	"Jonathan Cameron" <jic23@kernel.org>,
	"Fabio Estevam" <festevam@gmail.com>,
	"Peter Meerwald" <pmeerw@pmeerw.net>,
	"Hartmut Knaack" <knaack.h@gmx.de>,
	"Mark Rutland" <mark.rutland@arm.com>,
	devicetree@vger.kernel.org,
	"Lars-Peter Clausen" <lars@metafoo.de>,
	"Eric Bénard" <eric@eukrea.com>,
	"Pawel Moll" <pawel.moll@arm.com>,
	"Ian Campbell" <ijc+devicetree@hellion.org.uk>,
	linux-iio@vger.kernel.org, "Kumar Gala" <galak@codeaurora.org>,
	"Denis Carikli" <denis@eukrea.com>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Sascha Hauer" <kernel@pengutronix.de>,
	linux-input@vger.kernel.org, "Lee Jones" <lee.jones@linaro.org>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v6 4/8] mfd: fsl imx25 Touchscreen ADC driver
Date: Fri, 30 Jan 2015 07:43:24 +0100	[thread overview]
Message-ID: <20150130074324.3e4d868f@ipc1.ka-ro> (raw)
In-Reply-To: <1422540556-14828-5-git-send-email-mpa@pengutronix.de>

Hi,

Markus Pargmann wrote:
> This is the core driver for imx25 touchscreen/adc driver. The module
> has one shared ADC and two different conversion queues which use the
> ADC. The two queues are identical. Both can be used for general purpose
> ADC but one is meant to be used for touchscreens.
> 
> This driver is the core which manages the central components and
> registers of the TSC/ADC unit. It manages the IRQs and forwards them to
> the correct components.
> 
[...]
> diff --git a/drivers/mfd/fsl-imx25-tsadc.c b/drivers/mfd/fsl-imx25-tsadc.c
> new file mode 100644
> index 000000000000..8e4013d57500
> --- /dev/null
> +++ b/drivers/mfd/fsl-imx25-tsadc.c
> @@ -0,0 +1,167 @@
[...]
> +#define MX25_TGCR_POWERMODE_MASK	(3 << 8)
> +#define MX25_TGCR_POWERMODE_SAVE	BIT(8)
> +#define MX25_TGCR_POWERMODE_ON		(2 << 8)
>
This looks a bit weird and conceals the fact, that
MX25_TGCR_POWERMODE_SAVE is in fact one of the possible settings
of a two bit bitfield. For consistency I would write:
#define MX25_TGCR_POWERMODE_MASK	(3 << 8)
#define MX25_TGCR_POWERMODE_SAVE	(1 << 8)
#define MX25_TGCR_POWERMODE_ON		(2 << 8)

[...]
> +#define MX25_ADCQ_CFG_YPLL_HIGH	0
> +#define MX25_ADCQ_CFG_YPLL_OFF		BIT(12)
> +#define MX25_ADCQ_CFG_YPLL_LOW		(3 << 12)
>
dto.

> +#define MX25_ADCQ_CFG_XNUR_HIGH	0
> +#define MX25_ADCQ_CFG_XNUR_OFF		BIT(10)
> +#define MX25_ADCQ_CFG_XNUR_LOW		(3 << 10)
>
dto.

> +#define MX25_ADCQ_CFG_XPUL_OFF		BIT(9)
> +#define MX25_ADCQ_CFG_XPUL_HIGH	0
>
|#define MX25_ADCQ_CFG_XPUL_OFF		(1 << 9)
|#define MX25_ADCQ_CFG_XPUL_HIGH	(0 << 9)
would make it more clear, that these refer to the two states of the same
bit.

> +#define MX25_ADCQ_CFG_REFP(sel)		(sel << 7)
>
missing () around macro argument

> +#define MX25_ADCQ_CFG_REFP_YP		0
> +#define MX25_ADCQ_CFG_REFP_XP		(1 << 7)
> +#define MX25_ADCQ_CFG_REFP_EXT		(2 << 7)
> +#define MX25_ADCQ_CFG_REFP_INT		(3 << 7)
> +#define MX25_ADCQ_CFG_REFP_MASK		(3 << 7)
>
see my previous comment.

> +#define MX25_ADCQ_CFG_IN(sel)		(sel << 4)
>
missing () around macro argument

> +#define MX25_ADCQ_CFG_IN_XP		0
> +#define MX25_ADCQ_CFG_IN_YP		(1 << 4)
> +#define MX25_ADCQ_CFG_IN_XN		(2 << 4)
> +#define MX25_ADCQ_CFG_IN_YN		(3 << 4)
>
see my previous comment.

> +#define MX25_ADCQ_CFG_IN_WIPER		(4 << 4)
> +#define MX25_ADCQ_CFG_IN_AUX0		(5 << 4)
> +#define MX25_ADCQ_CFG_IN_AUX1		(6 << 4)
> +#define MX25_ADCQ_CFG_IN_AUX2		(7 << 4)
> +#define MX25_ADCQ_CFG_REFN(sel)		(sel << 2)
>
missing () around macro argument

> +#define MX25_ADCQ_CFG_REFN_XN		0
> +#define MX25_ADCQ_CFG_REFN_YN		(1 << 2)
> +#define MX25_ADCQ_CFG_REFN_NGND		(2 << 2)
> +#define MX25_ADCQ_CFG_REFN_NGND2	(3 << 2)
> +#define MX25_ADCQ_CFG_REFN_MASK		(3 << 2)
>
see my previous comment.


Lothar Waßmann
-- 
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info@karo-electronics.de
___________________________________________________________

  reply	other threads:[~2015-01-30  7:01 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-29 14:09 [PATCH v6 0/8] imx25 adc and touchscreen driver Markus Pargmann
2015-01-29 14:09 ` [PATCH v6 1/8] ARM: dt: Binding documentation for imx25 ADC/TSC Markus Pargmann
2015-01-29 14:09 ` [PATCH v6 2/8] ARM: dt: Binding documentation for imx25 GCQ Markus Pargmann
2015-02-04 16:48   ` Jonathan Cameron
2015-01-29 14:09 ` [PATCH v6 3/8] ARM: dt: Binding documentation for imx25 touchscreen controller Markus Pargmann
2015-01-29 14:09 ` [PATCH v6 4/8] mfd: fsl imx25 Touchscreen ADC driver Markus Pargmann
2015-01-30  6:43   ` Lothar Waßmann [this message]
2015-01-30  7:20     ` Markus Pargmann
2015-01-29 14:09 ` [PATCH v6 5/8] iio: adc: fsl,imx25-gcq driver Markus Pargmann
2015-01-29 14:30   ` Varka Bhadram
2015-01-30  8:16     ` Markus Pargmann
2015-02-04 16:42     ` Jonathan Cameron
2015-02-04 16:48   ` Jonathan Cameron
2015-02-26 15:23     ` Markus Pargmann
2015-01-29 14:09 ` [PATCH v6 6/8] input: touchscreen: imx25 tcq driver Markus Pargmann
2015-01-29 14:26   ` Varka Bhadram
2015-01-30 18:57     ` Dmitry Torokhov
2015-02-02 16:05       ` Markus Pargmann
2015-02-02 17:51         ` Dmitry Torokhov
2015-02-26 14:30           ` Markus Pargmann
2015-01-29 14:09 ` [PATCH v6 7/8] ARM: dts: imx25: Add TSC and ADC support Markus Pargmann
2015-01-29 14:09 ` [PATCH v6 8/8] ARM: imx_v4_v5_defconfig: Add I.MX25 Touchscreen controller " Markus Pargmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150130074324.3e4d868f@ipc1.ka-ro \
    --to=lw@karo-electronics.de \
    --cc=denis@eukrea.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=eric@eukrea.com \
    --cc=festevam@gmail.com \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=jic23@kernel.org \
    --cc=kernel@pengutronix.de \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mpa@pengutronix.de \
    --cc=pawel.moll@arm.com \
    --cc=pmeerw@pmeerw.net \
    --cc=robh+dt@kernel.org \
    --cc=sameo@linux.intel.com \
    --cc=shawn.guo@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox