[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20121113111337.GG23119@pengutronix.de>
Date: Tue, 13 Nov 2012 12:13:37 +0100
From: Wolfram Sang <w.sang@...gutronix.de>
To: Andreas Larsson <andreas@...sler.com>
Cc: Ben Dooks <ben-linux@...ff.org>,
Peter Korsgaard <jacmet@...site.dk>, linux-i2c@...r.kernel.org,
Grant Likely <grant.likely@...retlab.ca>,
Rob Herring <rob.herring@...xeda.com>,
devicetree-discuss@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
software@...sler.com
Subject: Re: [PATCH v2 2/2] i2c: i2c-ocores: Add support for the GRLIB port
of the controller and custom getreg and setreg functions
Hi,
On Mon, Nov 12, 2012 at 05:59:51PM +0100, Andreas Larsson wrote:
> @@ -233,6 +276,7 @@ static int ocores_i2c_of_probe(struct platform_device *pdev,
> {
> struct device_node *np = pdev->dev.of_node;
> u32 val;
> + const char *name;
>
> if (of_property_read_u32(np, "reg-shift", &i2c->reg_shift)) {
> /* no 'reg-shift', check for deprecated 'regstep' */
> @@ -257,6 +301,15 @@ static int ocores_i2c_of_probe(struct platform_device *pdev,
>
> of_property_read_u32(pdev->dev.of_node, "reg-io-width",
> &i2c->reg_io_width);
> +
> + name = of_get_property(pdev->dev.of_node, "name", NULL);
> + if (name && (!strcmp(name, "GAISLER_I2CMST") ||
> + !strcmp(name, "01_028"))) {
> + dev_dbg(&pdev->dev, "GRLIB variant of i2c-ocores\n");
> + i2c->setreg = oc_setreg_grlib;
> + i2c->getreg = oc_getreg_grlib;
> + }
> +
I'd think we should handle this via a seperate compatible-entry and
match->data?
Regards,
Wolfram
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Download attachment "signature.asc" of type "application/pgp-signature" (199 bytes)
Powered by blists - more mailing lists