From: Wolfram Sang <w.sang@pengutronix.de>
To: Andreas Larsson <andreas@gaisler.com>
Cc: Ben Dooks <ben-linux@fluff.org>,
Peter Korsgaard <jacmet@sunsite.dk>,
linux-i2c@vger.kernel.org,
Grant Likely <grant.likely@secretlab.ca>,
Rob Herring <rob.herring@calxeda.com>,
devicetree-discuss@lists.ozlabs.org,
linux-kernel@vger.kernel.org, software@gaisler.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
Date: Tue, 13 Nov 2012 12:13:37 +0100 [thread overview]
Message-ID: <20121113111337.GG23119@pengutronix.de> (raw)
In-Reply-To: <1352739591-1317-3-git-send-email-andreas@gaisler.com>
[-- Attachment #1: Type: text/plain, Size: 1137 bytes --]
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/ |
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
prev parent reply other threads:[~2012-11-13 11:13 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-12 16:59 [PATCH v2 0/2] i2c: i2c-ocores: Add support for sparc, custom set and get functions, and the GRLIB port of the controller Andreas Larsson
2012-11-12 16:59 ` [PATCH v2 1/2] i2c: i2c-ocores: Add irq support for sparc Andreas Larsson
[not found] ` <1352739591-1317-2-git-send-email-andreas-FkzTOoA/JUlBDgjK7y7TUQ@public.gmane.org>
2012-11-13 11:10 ` Wolfram Sang
2012-11-13 11:10 ` Wolfram Sang
[not found] ` <20121113111055.GF23119-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-11-13 13:18 ` Rob Herring
2012-11-13 13:18 ` Rob Herring
[not found] ` <50A248AD.9000705-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-11-13 16:31 ` Wolfram Sang
2012-11-13 16:31 ` Wolfram Sang
[not found] ` <1352739591-1317-1-git-send-email-andreas-FkzTOoA/JUlBDgjK7y7TUQ@public.gmane.org>
2012-11-12 16:59 ` [PATCH v2 2/2] i2c: i2c-ocores: Add support for the GRLIB port of the controller and custom getreg and setreg functions Andreas Larsson
2012-11-12 16:59 ` Andreas Larsson
2012-11-13 11:13 ` Wolfram Sang [this message]
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=20121113111337.GG23119@pengutronix.de \
--to=w.sang@pengutronix.de \
--cc=andreas@gaisler.com \
--cc=ben-linux@fluff.org \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=grant.likely@secretlab.ca \
--cc=jacmet@sunsite.dk \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rob.herring@calxeda.com \
--cc=software@gaisler.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.