From: Olof Johansson <olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org>
To: Jon Smirl <jonsmirl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linuxppc-dev-mnsaURCQ41sdnm+yROfE0A@public.gmane.org,
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
Subject: Re: [PATCH 2/3] Convert PowerPC MPC i2c to of_platform_driver from platform_driver
Date: Mon, 28 Jan 2008 10:12:06 -0600 [thread overview]
Message-ID: <20080128161206.GB19873@lixom.net> (raw)
In-Reply-To: <20080128144206.8410.2505.stgit-+J+k29bDNxlBDLzU/O5InQ@public.gmane.org>
Hi,
Nice to see this one, I've been waiting for it. :)
On Mon, Jan 28, 2008 at 09:42:07AM -0500, Jon Smirl wrote:
> diff --git a/drivers/i2c/busses/powerpc-common.c b/drivers/i2c/busses/powerpc-common.c
> new file mode 100644
> index 0000000..51b039f
> --- /dev/null
> +++ b/drivers/i2c/busses/powerpc-common.c
This is really broader than powerpc. devtree-common.c would be a more
suitable name.
> @@ -0,0 +1,81 @@
> +/*
> + * powerpc-common.c - routines common to device tree parsing for all
> + * powerpc based i2c hosts
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
> + *
> + * (C) Copyright 2008 Jon Smirl <jonsmirl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> + *
> + */
> +
> +#include <linux/interrupt.h>
> +#include <linux/i2c.h>
> +#include <linux/of_platform.h>
> +
> +#include "powerpc-common.h"
> +
> +#ifdef CONFIG_PPC_MERGE
> +
> +void of_register_i2c_devices(struct i2c_adapter *adap, struct device_node *adap_node)
> +{
> + void *result;
> + struct device_node *node = NULL;
> +
> + while ((node = of_get_next_child(adap_node, node))) {
> + struct i2c_board_info info;
> + const u32 *addr;
> + const char *compatible;
> + int len;
> +
> + compatible = of_get_property(node, "compatible", NULL);
> + if (!compatible) {
> + printk(KERN_ERR "i2c-mpc.c: missing compatible attribute\n");
> + continue;
> + }
> +
> + addr = of_get_property(node, "reg", &len);
> + if (!addr || len < sizeof(int) || *addr > (1 << 10) - 1) {
> + printk(KERN_ERR "i2c-mpc.c: missing reg attribute for %s\n", compatible);
This is no longer i2c-mpc. Same for the other comments in this function.
-Olof
_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c
next prev parent reply other threads:[~2008-01-28 16:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-28 14:42 [PATCH 0/3] Implement device tree based i2c module loading on mpc5200 powerpc Jon Smirl
[not found] ` <20080128144202.8410.14647.stgit-+J+k29bDNxlBDLzU/O5InQ@public.gmane.org>
2008-01-28 14:42 ` [PATCH 1/3] Rename i2c-mpc to i2c-mpc-drv in preparation for breaking out common code Jon Smirl
2008-01-28 14:42 ` [PATCH 3/3] Add device tree compatible aliases to i2c drivers Jon Smirl
[not found] ` <20080128144209.8410.37884.stgit-+J+k29bDNxlBDLzU/O5InQ@public.gmane.org>
2008-01-28 17:10 ` Jon Loeliger
2008-01-28 14:42 ` [PATCH 2/3] Convert PowerPC MPC i2c to of_platform_driver from platform_driver Jon Smirl
[not found] ` <20080128144206.8410.2505.stgit-+J+k29bDNxlBDLzU/O5InQ@public.gmane.org>
2008-01-28 16:12 ` Olof Johansson [this message]
-- strict thread matches above, loose matches on Subject: below --
2008-01-23 2:09 [PATCH 1/3] Rename i2c-mpc to i2c-mpc-drv in preparation for breaking out common code Jon Smirl
2008-01-23 2:09 ` [PATCH 2/3] Convert PowerPC MPC i2c to of_platform_driver from platform_driver Jon Smirl
2008-01-23 3:11 ` Stephen Rothwell
2008-01-23 4:18 ` Jon Smirl
2008-01-23 14:31 ` Jon Loeliger
[not found] ` <E1JHgdB-0002zV-F4-CYoMK+44s/E@public.gmane.org>
2008-01-23 14:40 ` Jon Smirl
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=20080128161206.GB19873@lixom.net \
--to=olof-nzht3qvonbneowh0uzbu5w@public.gmane.org \
--cc=i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org \
--cc=jonsmirl-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linuxppc-dev-mnsaURCQ41sdnm+yROfE0A@public.gmane.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