From: Jon Smirl <jonsmirl@gmail.com>
To: i2c@lm-sensors.org, linuxppc-dev@ozlabs.org
Subject: [PATCH 3/3] Add device tree compatible aliases to i2c drivers
Date: Mon, 28 Jan 2008 09:42:09 -0500 [thread overview]
Message-ID: <20080128144209.8410.37884.stgit@terra.home> (raw)
In-Reply-To: <20080128144202.8410.14647.stgit@terra.home>
PowerPC device trees use a different naming convention than the Linux kernel. Provide alias names for i2c drivers in order to allow them to be loaded by device tree name. The OF_ID macro ensures that the aliases are only present in powerpc builds and separated into their own namespace.
Signed-off-by: Jon Smirl <jonsmirl@gmail.com>
---
drivers/hwmon/f75375s.c | 2 ++
drivers/i2c/chips/ds1682.c | 1 +
drivers/i2c/chips/menelaus.c | 1 +
drivers/i2c/chips/tps65010.c | 4 ++++
drivers/i2c/chips/tsl2550.c | 1 +
drivers/rtc/rtc-ds1307.c | 6 ++++++
drivers/rtc/rtc-ds1374.c | 1 +
drivers/rtc/rtc-m41t80.c | 8 ++++++++
drivers/rtc/rtc-pcf8563.c | 2 ++
drivers/rtc/rtc-rs5c372.c | 4 ++++
10 files changed, 30 insertions(+), 0 deletions(-)
diff --git a/drivers/hwmon/f75375s.c b/drivers/hwmon/f75375s.c
index 4cb4db4..dd548e7 100644
--- a/drivers/hwmon/f75375s.c
+++ b/drivers/hwmon/f75375s.c
@@ -132,6 +132,8 @@ static struct i2c_driver f75375_legacy_driver = {
static const struct i2c_device_id f75375_id[] = {
{ "f75373", f75373 },
{ "f75375", f75375 },
+ OF_ID("fintek,f75373", f75373)
+ OF_ID("fintek,f75375", f75375)
{ },
};
MODULE_DEVICE_TABLE(i2c, f75375_id);
diff --git a/drivers/i2c/chips/ds1682.c b/drivers/i2c/chips/ds1682.c
index 51ff518..817ad1f 100644
--- a/drivers/i2c/chips/ds1682.c
+++ b/drivers/i2c/chips/ds1682.c
@@ -237,6 +237,7 @@ static int ds1682_remove(struct i2c_client *client)
static const struct i2c_device_id ds1682_id[] = {
{ "ds1682", 0 },
+ OF_ID("dallas,ds1682", 0)
{ },
};
MODULE_DEVICE_TABLE(i2c, ds1682_id);
diff --git a/drivers/i2c/chips/menelaus.c b/drivers/i2c/chips/menelaus.c
index 1f9ac5e..ba7d619 100644
--- a/drivers/i2c/chips/menelaus.c
+++ b/drivers/i2c/chips/menelaus.c
@@ -1245,6 +1245,7 @@ static int __exit menelaus_remove(struct i2c_client *client)
static const struct i2c_device_id menelaus_id[] = {
{ "menelaus", 0 },
+ OF_ID("ti,twl92330", 0)
{ },
};
MODULE_DEVICE_TABLE(i2c, menelaus_id);
diff --git a/drivers/i2c/chips/tps65010.c b/drivers/i2c/chips/tps65010.c
index e07274d..9cd1770 100644
--- a/drivers/i2c/chips/tps65010.c
+++ b/drivers/i2c/chips/tps65010.c
@@ -571,6 +571,10 @@ static const struct i2c_device_id tps65010_id[] = {
{ "tps65011", TPS65011 },
{ "tps65012", TPS65012 },
{ "tps65013", TPS65013 },
+ OF_ID("ti,tps65010", TPS65010)
+ OF_ID("ti,tps65011", TPS65011)
+ OF_ID("ti,tps65012", TPS65012)
+ OF_ID("ti,tps65013", TPS65013)
{ },
};
MODULE_DEVICE_TABLE(i2c, tps65010_id);
diff --git a/drivers/i2c/chips/tsl2550.c b/drivers/i2c/chips/tsl2550.c
index 2add8be..8071d6d 100644
--- a/drivers/i2c/chips/tsl2550.c
+++ b/drivers/i2c/chips/tsl2550.c
@@ -454,6 +454,7 @@ static int tsl2550_resume(struct i2c_client *client)
static const struct i2c_device_id tsl2550_id[] = {
{ "tsl2550", 0 },
+ OF_ID("taos,tsl2550", 0)
{ },
};
MODULE_DEVICE_TABLE(i2c, tsl2550_id);
diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c
index a5614ab..e363a5f 100644
--- a/drivers/rtc/rtc-ds1307.c
+++ b/drivers/rtc/rtc-ds1307.c
@@ -129,6 +129,12 @@ static const struct i2c_device_id ds1307_id[] = {
{ "ds1339", ds_1339 },
{ "ds1340", ds_1340 },
{ "m41t00", m41t00 },
+ OF_ID("dallas,ds1307", ds_1307)
+ OF_ID("dallas,ds1337", ds_1337)
+ OF_ID("dallas,ds1338", ds_1338)
+ OF_ID("dallas,ds1339", ds_1339)
+ OF_ID("dallas,ds1340", ds_1340)
+ OF_ID("stm,m41t00", m41t00)
{},
};
MODULE_DEVICE_TABLE(i2c, ds1307_id);
diff --git a/drivers/rtc/rtc-ds1374.c b/drivers/rtc/rtc-ds1374.c
index 376ceeb..e4f680a 100644
--- a/drivers/rtc/rtc-ds1374.c
+++ b/drivers/rtc/rtc-ds1374.c
@@ -43,6 +43,7 @@
static const struct i2c_device_id ds1374_id[] = {
{ "ds1374", 0 },
+ OF_ID("dallas,ds1374", 0)
{},
};
MODULE_DEVICE_TABLE(i2c, ds1374_id);
diff --git a/drivers/rtc/rtc-m41t80.c b/drivers/rtc/rtc-m41t80.c
index c672557..663f8b5 100644
--- a/drivers/rtc/rtc-m41t80.c
+++ b/drivers/rtc/rtc-m41t80.c
@@ -69,6 +69,14 @@ static const struct i2c_device_id m41t80_id[] = {
{ "m41st84", M41T80_FEATURE_HT | M41T80_FEATURE_BL },
{ "m41st85", M41T80_FEATURE_HT | M41T80_FEATURE_BL },
{ "m41st87", M41T80_FEATURE_HT | M41T80_FEATURE_BL },
+ OF_ID("stm,m41t80", 0)
+ OF_ID("stm,m41t81", M41T80_FEATURE_HT)
+ OF_ID("stm,m41t81s", M41T80_FEATURE_HT | M41T80_FEATURE_BL)
+ OF_ID("stm,m41t82", M41T80_FEATURE_HT | M41T80_FEATURE_BL)
+ OF_ID("stm,m41t83", M41T80_FEATURE_HT | M41T80_FEATURE_BL)
+ OF_ID("stm,m41st84", M41T80_FEATURE_HT | M41T80_FEATURE_BL)
+ OF_ID("stm,m41st85", M41T80_FEATURE_HT | M41T80_FEATURE_BL)
+ OF_ID("stm,m41st87", M41T80_FEATURE_HT | M41T80_FEATURE_BL)
{},
};
MODULE_DEVICE_TABLE(i2c, m41t80_id);
diff --git a/drivers/rtc/rtc-pcf8563.c b/drivers/rtc/rtc-pcf8563.c
index 8eff549..51d7471 100644
--- a/drivers/rtc/rtc-pcf8563.c
+++ b/drivers/rtc/rtc-pcf8563.c
@@ -263,6 +263,8 @@ static int pcf8563_remove(struct i2c_client *client)
static struct i2c_device_id pcf8563_id[] = {
{"pcf8563", 0},
{"rtc8564", 0},
+ OF_ID("phillips,pcf8563", 0)
+ OF_ID("epson,rtc8564", 0)
{},
};
MODULE_DEVICE_TABLE(i2c, pcf8563_id);
diff --git a/drivers/rtc/rtc-rs5c372.c b/drivers/rtc/rtc-rs5c372.c
index a3e4f8d..cdd26c3 100644
--- a/drivers/rtc/rtc-rs5c372.c
+++ b/drivers/rtc/rtc-rs5c372.c
@@ -74,6 +74,10 @@ static const struct i2c_device_id rs5c372_id[] = {
{ "rs5c372b", rtc_rs5c372b },
{ "rv5c386", rtc_rv5c386 },
{ "rv5c387a", rtc_rv5c387a },
+ OF_ID("ricoh,rs5c372a", rtc_rs5c372a)
+ OF_ID("ricoh,rs5c372b", rtc_rs5c372b)
+ OF_ID("ricoh,rv5c386", rtc_rv5c386)
+ OF_ID("ricoh,rv5c387a", rtc_rv5c387a)
{},
};
MODULE_DEVICE_TABLE(i2c, rs5c372_id);
next prev parent reply other threads:[~2008-01-28 14:42 UTC|newest]
Thread overview: 10+ 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
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 2/3] Convert PowerPC MPC i2c to of_platform_driver from platform_driver Jon Smirl
2008-01-28 16:12 ` Olof Johansson
2008-01-28 14:42 ` Jon Smirl [this message]
2008-01-28 17:10 ` [PATCH 3/3] Add device tree compatible aliases to i2c drivers Jon Loeliger
-- 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 3/3] Add device tree compatible aliases to i2c drivers Jon Smirl
2008-01-23 20:18 ` Matt Sealey
2008-01-23 20:30 ` Jon Smirl
2008-02-01 7:32 ` David Gibson
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=20080128144209.8410.37884.stgit@terra.home \
--to=jonsmirl@gmail.com \
--cc=i2c@lm-sensors.org \
--cc=linuxppc-dev@ozlabs.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;
as well as URLs for NNTP newsgroup(s).