mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: Satish Patel <satish.patel@ti.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"arnd@arndb.de" <arnd@arndb.de>,
	"rob@landley.net" <rob@landley.net>
Subject: Re: [RFC PATCH v1 2/5] misc: tda8026: Add NXP TDA8026 PHY driver
Date: Mon, 6 Jan 2014 15:30:33 +0000	[thread overview]
Message-ID: <20140106153033.GB24664@e106331-lin.cambridge.arm.com> (raw)
In-Reply-To: <1389010062-17185-3-git-send-email-satish.patel@ti.com>

On Mon, Jan 06, 2014 at 12:07:39PM +0000, Satish Patel wrote:
> TDA8026 is a SmartCard PHY from NXP.
> 
> The PHY interfaces with the main processor over the
> I2C interface and acts as a slave device.
> 
> The driver also exposes the phy interface
> (defined@include/linux/sc_phy.h) for SmartCard controller.
> Controller uses this interface to communicate with smart card
> inserted to the phy's slot.
> 
> Note: gpio irq is not validated as I do not have device with that.
> I have validated interrupt with dedicated interrupt line on my device.
> 
> Signed-off-by: Maulik Mankad <maulik@ti.com>
> Signed-off-by: Satish Patel <satish.patel@ti.com>
> ---
>  Documentation/devicetree/bindings/misc/tda8026.txt |   14 +
>  drivers/misc/Kconfig                               |    7 +
>  drivers/misc/Makefile                              |    1 +
>  drivers/misc/tda8026.c                             | 1271 ++++++++++++++++++++
>  4 files changed, 1293 insertions(+), 0 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/misc/tda8026.txt
>  create mode 100644 drivers/misc/tda8026.c
> 
> diff --git a/Documentation/devicetree/bindings/misc/tda8026.txt b/Documentation/devicetree/bindings/misc/tda8026.txt
> new file mode 100644
> index 0000000..d3083bf
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/misc/tda8026.txt
> @@ -0,0 +1,14 @@
> +TDA8026 smart card slot interface
> +
> +Required properties:
> +- compatible: nxp,tda8026

Please quote strings:

- compatible: should contain "nxp,tda8026"

> +- shutdown-gpio = GPIO pin mapping for SDWNN pin
> +- reg = i2c interface address

It's probably worth mentioning at the start that this is an i2c device.

[...]

> +static int tda8026_parse_dt(struct device *dev, struct tda8026 *pdata)
> +{
> +       struct device_node *np = dev->of_node;
> +       const struct of_device_id *match;
> +       int ret = 0;
> +
> +       match = of_match_device(of_match_ptr(tda8026_id_table), dev);
> +       if (!match)
> +               return -EINVAL;

Why do this? The of_device_id table contains one entry with no
additional data. If you just want to see if this was probed via DT,
dev->of_node not being NULL would tell you that.

Is this going to be used without DT anywhere?

[...]

> +       if (pdata->irq == 0) {
> +               /* look for the field irq-gpio in DT */
> +               irq_gpio = of_get_named_gpio(np, "irq-gpio", 0);
> +               if (!gpio_is_valid(irq_gpio)) {
> +                       dev_err(dev, "Failed to get irq gpio,\n");
> +                       return -EIO;
> +               }

This is horrible. If the gpio controller can act as an irq controller
then it should be annotated as such, with #interrupt-cells, and you
should just describe the interrupt. The smart card controller cares
about having an interrupt line, not a GPIO.

Additionally, this was not described in the binding.

Thanks,
Mark.

  reply	other threads:[~2014-01-06 15:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-06 12:07 [RFC PATCH v1 0/5] Smart Card(SC) interface, TI USIM & NxP SC phy driver Satish Patel
2014-01-06 12:07 ` [RFC PATCH v1 1/5] sc_phy:SmartCard(SC) PHY interface to SC controller Satish Patel
2014-01-06 12:07 ` [RFC PATCH v1 2/5] misc: tda8026: Add NXP TDA8026 PHY driver Satish Patel
2014-01-06 15:30   ` Mark Rutland [this message]
2014-01-07  6:36     ` Satish Patel
2014-01-07 11:45       ` Sebastian Reichel
2014-01-06 12:07 ` [RFC PATCH v1 3/5] char: ti-usim: Add driver for USIM module on AM43xx Satish Patel
2014-01-06 12:07 ` [RFC PATCH v1 4/5] ARM: dts: AM43xx: DT entries added for ti-usim Satish Patel
2014-01-06 12:07 ` [RFC PATCH v1 5/5] ARM: dts: AM43xx-epos-evm: DT entries " Satish Patel

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=20140106153033.GB24664@e106331-lin.cambridge.arm.com \
    --to=mark.rutland@arm.com \
    --cc=arnd@arndb.de \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=rob@landley.net \
    --cc=satish.patel@ti.com \
    /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

all inboxes | Powered by JetHome®