Skip to contentSkip to conversation

i2c: SuperH Mobile I2C Bus Controller V5

PATCH In review Magnus Damm 2 participants 2 messages Apr 2, 2008 – Apr 5, 2008

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i2c: SuperH Mobile I2C Bus Controller V5

This is V5 of the SuperH Mobile I2C Controller Driver. A simple Master only driver for the I2C block included in processors such as sh7343, sh7722 and sh7723. Tested on a sh7722 MigoR using a rs5c732b rtc.

---

Changes since V4:
- Use sh_mobile_i2c_op enum
- Remove fast_mode and rx_ack_high code
- Use variable name retry_count instead of k
- Encoding fixes
- Use clk_enable() and clk_disable()
- Remove deactivate_ch() call from setup_channel()
- Use dev_err() if i2c_add_numbered_adapter() fails
- MODULE_LICENSE("GPL v2")
- Comment fix, cleaned up header
Changes since V3:
- Added SUPERH Kconfig dependency
- Use spin_lock_irqsave() and spin_unlock_irqrestore()
- Use IRQF_DISABLED
- Checkpatch fixes
Changes since V2:
- dev_xxx() use
- Kill off superfluous ioarea resource
- Add SMBus emulation
Changes since V1:
- Use clk_get()/clk_put()/clk_get_rate() to get peripheral clock rate.
- Use pdev->dev.bus_id instead of dev->name

Verified with the rtc-rs5c372 SMBus conversion patches currently in -mm.

 drivers/i2c/busses/Kconfig         |   10 
 drivers/i2c/busses/Makefile        |    1 
 drivers/i2c/busses/i2c-sh_mobile.c |  500 ++++++++++++++++++++++++++++++++++++
 3 files changed, 511 insertions(+)
drivers/i2c/busses/Kconfig +10 -0
@@ -672,4 +672,14 @@ config I2C_PMCMSP
 	  This driver can also be built as module. If so, the module
 	  will be called i2c-pmcmsp.
 
+config I2C_SH_MOBILE
+	tristate "SuperH Mobile I2C Controller"
+	depends on SUPERH
+	help
+	  If you say yes to this option, support will be included for the
+	  built-in I2C interface on the Renesas SH-Mobile processor.
+
+	  This driver can also be built as a module.  If so, the module
+	  will be called i2c-sh_mobile.
+
 endmenu
drivers/i2c/busses/Makefile +1 -0
@@ -52,6 +52,7 @@ obj-$(CONFIG_I2C_VIAPRO)	+= i2c-viapro.o
 obj-$(CONFIG_I2C_VOODOO3)	+= i2c-voodoo3.o
 obj-$(CONFIG_SCx200_ACB)	+= scx200_acb.o
 obj-$(CONFIG_SCx200_I2C)	+= scx200_i2c.o
+obj-$(CONFIG_I2C_SH_MOBILE)	+= i2c-sh_mobile.o
 
 ifeq ($(CONFIG_I2C_DEBUG_BUS),y)
 EXTRA_CFLAGS += -DDEBUG
drivers/i2c/busses/i2c-sh_mobile.c new file +500 -0

500 lines not on this page · raw message

#1 lore raw

Hi Magnus,

Quoted 31 lines · Magnus Damm

This is V5 of the SuperH Mobile I2C Controller Driver. A simple Master only driver for the I2C block included in processors such as sh7343, sh7722 and sh7723. Tested on a sh7722 MigoR using a rs5c732b rtc.

---

Changes since V4:
- Use sh_mobile_i2c_op enum
- Remove fast_mode and rx_ack_high code
- Use variable name retry_count instead of k
- Encoding fixes
- Use clk_enable() and clk_disable()
- Remove deactivate_ch() call from setup_channel()
- Use dev_err() if i2c_add_numbered_adapter() fails
- MODULE_LICENSE("GPL v2")
- Comment fix, cleaned up header
Changes since V3:
- Added SUPERH Kconfig dependency
- Use spin_lock_irqsave() and spin_unlock_irqrestore()
- Use IRQF_DISABLED
- Checkpatch fixes
Changes since V2:
- dev_xxx() use
- Kill off superfluous ioarea resource
- Add SMBus emulation
Changes since V1:
- Use clk_get()/clk_put()/clk_get_rate() to get peripheral clock rate.
- Use pdev->dev.bus_id instead of dev->name

Quoted 6 lines

Verified with the rtc-rs5c372 SMBus conversion patches currently in -mm.

 drivers/i2c/busses/Kconfig         |   10 
 drivers/i2c/busses/Makefile        |    1 
 drivers/i2c/busses/i2c-sh_mobile.c |  500 ++++++++++++++++++++++++++++++++++++
 3 files changed, 511 insertions(+)

Patch added to my i2c tree and queued up for merge in 2.6.26-rc1. Thanks to everyone who reviewed the previous versions of the driver.

Signature · 1 line
Jean Delvare