Skip to contentSkip to conversation

Two I2C Chips drivers from Blackfin team

PATCH In review Bryan Wu 4 participants 8 messages May 12, 2008 – May 14, 2008 5 messages not in the archive I2C subsystem host drivers

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 1210586847-8955-1-git-send-email-cooloney-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org

author
#2 lore raw

PATCH 1/2 : add AD5252 chip driver

From: Michael Hennerich <[email protected]>

---
 drivers/i2c/chips/Kconfig  |    7 ++
 drivers/i2c/chips/Makefile |    1 +
 drivers/i2c/chips/ad5252.c |  252 ++++++++++++++++++++++++++++++++++++++++++++
 include/linux/i2c-id.h     |    1 +
 4 files changed, 261 insertions(+), 0 deletions(-)
 create mode 100644 drivers/i2c/chips/ad5252.c
drivers/i2c/chips/Kconfig +7 -0
index 2da2edf..1222e36 100644
@@ -14,6 +14,13 @@ config DS1682
 	  This driver can also be built as a module.  If so, the module
 	  will be called ds1682.
 
+config SENSORS_AD5252
+	tristate "Analog Devices AD5252 and AD5251 Digital Potentiometers"
+	depends on I2C && EXPERIMENTAL
+	help
+	  If you say yes here you get support for Analog Devices and AD5252
+	  AD5251 chips.
+
 config SENSORS_EEPROM
 	tristate "EEPROM reader"
 	depends on EXPERIMENTAL
drivers/i2c/chips/Makefile +1 -0
index e47aca0..866def2 100644
@@ -9,6 +9,7 @@
 # * I/O expander drivers go to drivers/gpio
 #
 
+obj-$(CONFIG_SENSORS_AD5252)	+= ad5252.o
 obj-$(CONFIG_DS1682)		+= ds1682.o
 obj-$(CONFIG_SENSORS_EEPROM)	+= eeprom.o
 obj-$(CONFIG_SENSORS_MAX6875)	+= max6875.o
drivers/i2c/chips/ad5252.c new file +252 -0

252 lines not on this page · raw message

include/linux/i2c-id.h +1 -0
index 580acc9..adfcf71 100644
@@ -94,6 +94,7 @@
 #define I2C_DRIVERID_I2CDEV	900
 
 #define I2C_DRIVERID_OV7670 1048	/* Omnivision 7670 camera */
+#define I2C_DRIVERID_AD5252 1049
 
 /*
  * ---- Adapter types ----------------------------------------------------
Signature · 7 lines
1.5.5


_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c
author
#3 lore raw

PATCH 2/2 add PCA9543 chip driver

In reply to a message not in the archive

From: Michael Hennerich <[email protected]>

---
 drivers/i2c/chips/Kconfig   |   13 +++
 drivers/i2c/chips/Makefile  |    1 +
 drivers/i2c/chips/pca9543.c |  212 +++++++++++++++++++++++++++++++++++++++++++
 include/linux/i2c-id.h      |    1 +
 4 files changed, 227 insertions(+), 0 deletions(-)
 create mode 100644 drivers/i2c/chips/pca9543.c
drivers/i2c/chips/Kconfig +13 -0
index 1222e36..908fe9a 100644
@@ -60,6 +60,19 @@ config PCF8575
 	  This device is hard to detect and is rarely found on mainstream
 	  hardware.  If unsure, say N.
 
+config SENSORS_PCA9543
+	tristate "Philips PCA9543 bi-directional translating switch"
+	depends on I2C && EXPERIMENTAL
+	default n
+	help
+	  If you say yes here you get support for Philips PCA9543.
+
+	  This driver can also be built as a module.  If so, the module
+	  will be called pca9543.
+
+	  These devices are hard to detect and rarely found on mainstream
+	  hardware.  If unsure, say N.
+
 config SENSORS_PCA9539
 	tristate "Philips PCA9539 16-bit I/O port (DEPRECATED)"
 	depends on EXPERIMENTAL && GPIO_PCA9539 = "n"
drivers/i2c/chips/Makefile +1 -0
index 866def2..7b292e6 100644
@@ -14,6 +14,7 @@ obj-$(CONFIG_DS1682)		+= ds1682.o
 obj-$(CONFIG_SENSORS_EEPROM)	+= eeprom.o
 obj-$(CONFIG_SENSORS_MAX6875)	+= max6875.o
 obj-$(CONFIG_SENSORS_PCA9539)	+= pca9539.o
+obj-$(CONFIG_SENSORS_PCA9543)	+= pca9543.o
 obj-$(CONFIG_SENSORS_PCF8574)	+= pcf8574.o
 obj-$(CONFIG_PCF8575)		+= pcf8575.o
 obj-$(CONFIG_SENSORS_PCF8591)	+= pcf8591.o
drivers/i2c/chips/pca9543.c new file +212 -0

212 lines not on this page · raw message

include/linux/i2c-id.h +1 -0
index adfcf71..72c246a 100644
@@ -95,6 +95,7 @@
 
 #define I2C_DRIVERID_OV7670 1048	/* Omnivision 7670 camera */
 #define I2C_DRIVERID_AD5252 1049
+#define I2C_DRIVERID_PCF8575 1050
 
 /*
  * ---- Adapter types ----------------------------------------------------
Signature · 7 lines
1.5.5


_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c

A message that is not in the archive (sent off-list or not yet received): 1210586847-8955-3-git-send-email-cooloney-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org

#5 lore raw

Re: [PATCH 2/2] [I2C] add PCA9543 chip driver

drivers/i2c/chips/pca9543.c line 3

Quoted 8 lines · Bryan Wu

From: Michael Hennerich

drivers/i2c/chips/pca9543.c new file +3 -0
@@ -0,0 +1,212 @@
+/*
+    pca9543.c - Part of lm_sensors, Linux kernel modules for hardware
+             monitoring

Not a sensor chip..

drivers/i2c/chips/pca9543.c line 40

Quoted 13 lines
drivers/i2c/chips/pca9543.c new file +12 -0
+/* A few notes about the PCA9543:
+
+*   The PCA9543 is a bi-directional translating switch, controlled by the
+    I2C bus. The SCL/SDA upstream pair fans out to two downstream
+    pairs, or channels. Any individual SCx/SDx channels or combination
+    of channels can be selected, determined by the contents of the
+    programmable control register. Two interrupt inputs, INT0 to INT3,
+    one for each of the downstream pairs, are provided. One interrupt
+    output INT, which acts as an AND of the two interrupt inputs, is
+    provided.
+
+*/

You might want to add a url to the datasheet, rather than a copypaste from it. Any description in the driver sould

drivers/i2c/chips/pca9543.c line 74

Quoted 11 lines
drivers/i2c/chips/pca9543.c new file +10 -0
+
+/* This is the driver that will be inserted */
+static struct i2c_driver pca9543_driver = {
+	.driver = {
+		.name	= "pca9543",
+	},
+	.id		= I2C_DRIVERID_PCF8574,
+	.attach_adapter	= pca9543_attach_adapter,
+	.detach_client	= pca9543_detach_client,
+};

Since the chip is undetectable, and used on embedded platform, I think you should consider a "new-style" driver with .probe/remove instead. See i2c/writing-clients

drivers/i2c/chips/pca9543.c line 150

Quoted 10 lines
drivers/i2c/chips/pca9543.c new file +7 -0
+	struct i2c_client *new_client;
 
+	new_client = &data->client;
+	i2c_set_clientdata(new_client, data);
+	new_client->addr = address;
+	new_client->adapter = adapter;
+	new_client->driver = &pca9543_driver;
+	new_client->flags = 0;

s/new_client/client/ please.

drivers/i2c/chips/pca9543.c line 154

Quoted 4 lines
drivers/i2c/chips/pca9543.c new file +3 -0
+	/* Now, we would do the remaining detection. But the PCF8574 is plainly
+	   impossible to detect! Stupid chip. */
+

copypaste from PCF8574 driver? :) Again, consider if the new style drivers would me more useful for your platform.

_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c

A message that is not in the archive (sent off-list or not yet received): [email protected]

#7 lore raw

Re: [PATCH 2/2] [I2C] add PCA9543 chip driver

Quoted 9 lines

-----Original Message-----
From: Riku Voipio [mailto:[email protected]]
Sent: Montag, 12. Mai 2008 14:31
To: Bryan Wu
Cc: [email protected]; [email protected]; Michael Hennerich
Subject: Re: [i2c] [PATCH 2/2] [I2C] add PCA9543 chip driver

Quoted 7 lines

drivers/i2c/chips/pca9543.c line 2

Quoted 6 lines · Bryan Wu

From: Michael Hennerich

drivers/i2c/chips/pca9543.c new file +2 -0
@@ -0,0 +1,212 @@
+/*
+    pca9543.c - Part of lm_sensors, Linux kernel modules for

hardware

Quoted 6 lines

drivers/i2c/chips/pca9543.c line 3

Quoted 2 lines
drivers/i2c/chips/pca9543.c new file +1 -0
+             monitoring

Not a sensor chip..

drivers/i2c/chips/pca9543.c

Quoted 3 lines
drivers/i2c/chips/pca9543.c new file +3 -0
+/* A few notes about the PCA9543:
+
+*   The PCA9543 is a bi-directional translating switch, controlled

by

Quoted 3 lines

the

Quoted 2 lines
drivers/i2c/chips/pca9543.c new file +2 -0
+    I2C bus. The SCL/SDA upstream pair fans out to two downstream
+    pairs, or channels. Any individual SCx/SDx channels or

combination

Quoted 2 lines

drivers/i2c/chips/pca9543.c line 10

Quoted 2 lines
drivers/i2c/chips/pca9543.c new file +2 -0
+    of channels can be selected, determined by the contents of the
+    programmable control register. Two interrupt inputs, INT0 to

INT3,

Quoted 1 line

drivers/i2c/chips/pca9543.c line 11

Quoted 1 line
drivers/i2c/chips/pca9543.c new file +1 -0
+    one for each of the downstream pairs, are provided. One

interrupt

Quoted 7 lines

drivers/i2c/chips/pca9543.c line 40

Quoted 5 lines
drivers/i2c/chips/pca9543.c new file +4 -0
+    output INT, which acts as an AND of the two interrupt inputs, is
+    provided.
+
+*/

You might want to add a url to the datasheet, rather than a copypaste from it. Any description in the driver sould

Quoted 12 lines

drivers/i2c/chips/pca9543.c line 74

Quoted 11 lines
drivers/i2c/chips/pca9543.c new file +10 -0
+
+/* This is the driver that will be inserted */
+static struct i2c_driver pca9543_driver = {
+	.driver = {
+		.name	= "pca9543",
+	},
+	.id		= I2C_DRIVERID_PCF8574,
+	.attach_adapter	= pca9543_attach_adapter,
+	.detach_client	= pca9543_detach_client,
+};

Since the chip is undetectable, and used on embedded platform, I think

you

Quoted 13 lines

should consider a "new-style" driver with .probe/remove instead. See i2c/writing-clients

drivers/i2c/chips/pca9543.c line 150

Quoted 10 lines
drivers/i2c/chips/pca9543.c new file +7 -0
+	struct i2c_client *new_client;
 
+	new_client = &data->client;
+	i2c_set_clientdata(new_client, data);
+	new_client->addr = address;
+	new_client->adapter = adapter;
+	new_client->driver = &pca9543_driver;
+	new_client->flags = 0;

s/new_client/client/ please.

Quoted 6 lines

drivers/i2c/chips/pca9543.c

Quoted 1 line
drivers/i2c/chips/pca9543.c new file +1 -0
+	/* Now, we would do the remaining detection. But the PCF8574 is

plainly

drivers/i2c/chips/pca9543.c line 154

Quoted 3 lines
drivers/i2c/chips/pca9543.c new file +2 -0
+	   impossible to detect! Stupid chip. */
+

copypaste from PCF8574 driver? :) Again, consider if the new style

drivers

Quoted 1 line

would me more useful for your platform.

Yes copypaste from PCF8574 driver. There is not much value in here, we either send a new patch including your feedback or drop this.

Best regards,
Michael

_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c

A message that is not in the archive (sent off-list or not yet received): 8A42379416420646B9BFAC9682273B6D015F5379-pcKY8lWzTjquVPpjEGsWsTcYPEmu4y7e@public.gmane.org

author
#9 lore raw

Re: [PATCH 2/2] [I2C] add PCA9543 chip driver

Quoted 72 lines · Michael
Quoted 10 lines

-----Original Message-----
From: Riku Voipio [mailto:[email protected]]
Sent: Montag, 12. Mai 2008 14:31
To: Bryan Wu
Cc: [email protected]; [email protected]; Michael Hennerich
Subject: Re: [i2c] [PATCH 2/2] [I2C] add PCA9543 chip driver

Quoted 7 lines

drivers/i2c/chips/pca9543.c line 2

Quoted 6 lines · Bryan Wu

From: Michael Hennerich

drivers/i2c/chips/pca9543.c new file +2 -0
@@ -0,0 +1,212 @@
+/*
+    pca9543.c - Part of lm_sensors, Linux kernel modules for

hardware

Quoted 6 lines

drivers/i2c/chips/pca9543.c line 3

Quoted 2 lines
drivers/i2c/chips/pca9543.c new file +1 -0
+             monitoring

Not a sensor chip..

drivers/i2c/chips/pca9543.c

Quoted 3 lines
drivers/i2c/chips/pca9543.c new file +3 -0
+/* A few notes about the PCA9543:
+
+*   The PCA9543 is a bi-directional translating switch, controlled

by

Quoted 3 lines

the

Quoted 2 lines
drivers/i2c/chips/pca9543.c new file +2 -0
+    I2C bus. The SCL/SDA upstream pair fans out to two downstream
+    pairs, or channels. Any individual SCx/SDx channels or

combination

Quoted 2 lines

drivers/i2c/chips/pca9543.c line 10

Quoted 2 lines
drivers/i2c/chips/pca9543.c new file +2 -0
+    of channels can be selected, determined by the contents of the
+    programmable control register. Two interrupt inputs, INT0 to

INT3,

Quoted 1 line

drivers/i2c/chips/pca9543.c line 11

Quoted 1 line
drivers/i2c/chips/pca9543.c new file +1 -0
+    one for each of the downstream pairs, are provided. One

interrupt

Quoted 7 lines

drivers/i2c/chips/pca9543.c line 40

Quoted 5 lines
drivers/i2c/chips/pca9543.c new file +4 -0
+    output INT, which acts as an AND of the two interrupt inputs, is
+    provided.
+
+*/

You might want to add a url to the datasheet, rather than a copypaste from it. Any description in the driver sould

Quoted 12 lines

drivers/i2c/chips/pca9543.c line 74

Quoted 11 lines
drivers/i2c/chips/pca9543.c new file +10 -0
+
+/* This is the driver that will be inserted */
+static struct i2c_driver pca9543_driver = {
+    .driver = {
+            .name   = "pca9543",
+    },
+    .id             = I2C_DRIVERID_PCF8574,
+    .attach_adapter = pca9543_attach_adapter,
+    .detach_client  = pca9543_detach_client,
+};

Since the chip is undetectable, and used on embedded platform, I think

you

Quoted 18 lines

should consider a "new-style" driver with .probe/remove instead. See i2c/writing-clients

drivers/i2c/chips/pca9543.c line 150

Quoted 10 lines
drivers/i2c/chips/pca9543.c new file +7 -0
+    struct i2c_client *new_client;
 
+    new_client = &data->client;
+    i2c_set_clientdata(new_client, data);
+    new_client->addr = address;
+    new_client->adapter = adapter;
+    new_client->driver = &pca9543_driver;
+    new_client->flags = 0;

s/new_client/client/ please.

Quoted 1 line

+ /* Now, we would do the remaining detection. But the PCF8574 is

plainly

Quoted 3 lines
drivers/i2c/chips/pca9543.c new file +2 -0
+       impossible to detect! Stupid chip. */
+
Quoted 7 lines
Quoted 1 line

copypaste from PCF8574 driver? :) Again, consider if the new style

drivers

Quoted 1 line

would me more useful for your platform.

Yes copypaste from PCF8574 driver. There is not much value in here, we either send a new patch including your feedback or drop this.

Right, as Michael said, I dropped this patch from my guilt repo.

Thanks
-Bryan

_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c

#10 lore raw
In reply to a message not in the archive

Hi Bryan,

Quoted 2 lines · Bryan Wu

Sorry for resending this 2 patches, because I delete that useless I2C ID patch from my previous patch set.

Resending patches if fine, no problem with this.

Quoted 1 line

Could you please review these patches?

I'm awfully busy these days, and I already have several patch reviews pending, so it is unlikely that I will have the time to review these patches in a near future, sorry.

Signature · 6 lines
Jean Delvare

_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#12 lore raw
Quoted 7 lines · Jean Delvare

Hi Bryan,

Quoted 2 lines · Bryan Wu

Sorry for resending this 2 patches, because I delete that useless I2C ID patch from my previous patch set.

Quoted 9 lines

Resending patches if fine, no problem with this.

Quoted 1 line

Could you please review these patches?

I'm awfully busy these days, and I already have several patch reviews pending, so it is unlikely that I will have the time to review these patches in a near future, sorry.

Understand, would you please add these patches into you review pending queue. When you got time, please help us to review these. IMO, these drive may be helpful for
other developers.

Thanks
-Bryan Wu

_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c