From: David Brownell <david-b@pacbell.net>
To: rtc-linux@googlegroups.com
Cc: linuxppc-dev@ozlabs.org, i2c@lm-sensors.org,
James Chapman <jchapman@katalix.com>
Subject: [patch/rft 4/4] rtc-ds1307 platform update, powerpc mpc834x_itx and mpc8313_rdb
Date: Mon, 14 May 2007 09:46:41 -0700 [thread overview]
Message-ID: <200705140946.41993.david-b@pacbell.net> (raw)
Update powerpc platforms to support new-style rtc-ds1307 driver:
- Make i2c-mpc driver use numbered adapter;
- Update boards identified by defconfig to list a ds1339 device:
* mpc834x_itx
* mpc8313_rdb
Didn't update the pasemi reference board; public info doesn't say
which chip it uses.
UNTESTED
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
---
NOTE: cc'd the relevant powerpc maintainers lists; patches 1-3
will be archived in the rtc and i2c lists. I'd like to see these
get tested/fixed so that the rtc-ds1307 driver can swich completely
to use the new-style I2c driver model.
arch/powerpc/platforms/83xx/mpc8313_rdb.c | 11 +++++++++++
arch/powerpc/platforms/83xx/mpc834x_itx.c | 12 ++++++++++++
drivers/i2c/busses/i2c-mpc.c | 3 ++-
3 files changed, 25 insertions(+), 1 deletion(-)
--- at91.orig/drivers/i2c/busses/i2c-mpc.c 2007-05-10 00:48:22.000000000 -0700
+++ at91/drivers/i2c/busses/i2c-mpc.c 2007-05-13 10:56:52.000000000 -0700
@@ -280,6 +280,7 @@ static struct i2c_adapter mpc_ops = {
.owner = THIS_MODULE,
.name = "MPC adapter",
.id = I2C_HW_MPC107,
+ /* .nr = 0, */
.algo = &mpc_algo,
.class = I2C_CLASS_HWMON,
.timeout = 1,
@@ -329,7 +330,7 @@ static int fsl_i2c_probe(struct platform
i2c->adap = mpc_ops;
i2c_set_adapdata(&i2c->adap, i2c);
i2c->adap.dev.parent = &pdev->dev;
- if ((result = i2c_add_adapter(&i2c->adap)) < 0) {
+ if ((result = i2c_add_numbered_adapter(&i2c->adap)) < 0) {
printk(KERN_ERR "i2c-mpc - failed to add adapter\n");
goto fail_add;
}
--- at91.orig/arch/powerpc/platforms/83xx/mpc834x_itx.c 2007-05-12 23:31:24.000000000 -0700
+++ at91/arch/powerpc/platforms/83xx/mpc834x_itx.c 2007-05-13 11:22:36.000000000 -0700
@@ -23,6 +23,7 @@
#include <linux/delay.h>
#include <linux/seq_file.h>
#include <linux/root_dev.h>
+#include <linux/i2c.h>
#include <asm/system.h>
#include <asm/atomic.h>
@@ -48,6 +49,15 @@ unsigned long isa_mem_base = 0;
* Setup the architecture
*
*/
+
+static struct i2c_board_info __initdata mpc834x_itx_i2c_devices[] = {
+ { I2C_BOARD_INFO("rtc-ds1307", 0x68),
+ .type = "ds1339",
+ /* REVISIT .irq = IRQ2 ... this RTC has an alarm */
+ },
+ /* REVISIT: also has an eeprom */
+};
+
static void __init mpc834x_itx_setup_arch(void)
{
#ifdef CONFIG_PCI
@@ -63,6 +73,8 @@ static void __init mpc834x_itx_setup_arc
ppc_md.pci_exclude_device = mpc83xx_exclude_device;
#endif
+ i2c_register_board_info(0, mpc834x_itx_i2c_devices,
+ ARRAY_SIZE(mpc834x_itx_i2c_devices));
}
static void __init mpc834x_itx_init_IRQ(void)
--- at91.orig/arch/powerpc/platforms/83xx/mpc8313_rdb.c 2007-05-13 11:20:25.000000000 -0700
+++ at91/arch/powerpc/platforms/83xx/mpc8313_rdb.c 2007-05-13 11:21:49.000000000 -0700
@@ -14,6 +14,7 @@
*/
#include <linux/pci.h>
+#include <linux/i2c.h>
#include <asm/time.h>
#include <asm/ipic.h>
@@ -38,6 +39,14 @@ unsigned long isa_mem_base = 0;
* Setup the architecture
*
*/
+static struct i2c_board_info __initdata mpc8313_rdb_i2c_devices[] = {
+ { I2C_BOARD_INFO("rtc-ds1307", 0x68),
+ .type = "ds1339",
+ /* REVISIT .irq = IRQ4 ... this RTC has an alarm */
+ },
+ /* REVISIT: also has an eeprom and lm75 */
+};
+
static void __init mpc8313_rdb_setup_arch(void)
{
#ifdef CONFIG_PCI
@@ -53,6 +62,8 @@ static void __init mpc8313_rdb_setup_arc
ppc_md.pci_exclude_device = mpc83xx_exclude_device;
#endif
+ i2c_register_board_info(0, mpc8313_i2c_devices,
+ ARRAY_SIZE(mpc8313_i2c_devices));
}
void __init mpc8313_rdb_init_IRQ(void)
next reply other threads:[~2007-05-14 17:15 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-14 16:46 David Brownell [this message]
2007-05-14 17:44 ` [patch/rft 4/4] rtc-ds1307 platform update, powerpc mpc834x_itx and mpc8313_rdb Grant Likely
2007-05-14 18:25 ` David Brownell
2007-05-14 18:49 ` David Brownell
2007-05-14 19:02 ` Grant Likely
2007-05-15 13:24 ` [i2c] " Jean Delvare
2007-05-14 18:05 ` Olof Johansson
2007-05-14 18:37 ` David Brownell
2007-05-14 18:52 ` [rtc-linux] " Alessandro Zummo
2007-05-14 19:30 ` Olof Johansson
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=200705140946.41993.david-b@pacbell.net \
--to=david-b@pacbell.net \
--cc=i2c@lm-sensors.org \
--cc=jchapman@katalix.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=rtc-linux@googlegroups.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.