Skip to contentSkip to conversation

exynos: i2c: Use generic api to get i2c clk freq

PATCH New Akshay Saraswat 2 participants 5 messages Mar 25, 2013 – Jun 4, 2013

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

PATCH 1/1 exynos: i2c: Use generic api to get i2c clk freq

From: Padmavathi Venna <[email protected]>

Use generic api to get the i2c clock frequency. Tested on smdk5250 with the help of following commands. run
i2c dev 1
i2c dev 2
i2c speed

This patch depends on:
http://permalink.gmane.org/gmane.comp.boot-loaders.u-boot/154930

---
 drivers/i2c/s3c24x0_i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/s3c24x0_i2c.c +1 -1
index 769a2ba..a9f19e7 100644
@@ -151,7 +151,7 @@ static void i2c_ch_init(struct s3c24x0_i2c *i2c, int speed, int slaveadd)
 {
 	ulong freq, pres = 16, div;
 #if (defined CONFIG_EXYNOS4 || defined CONFIG_EXYNOS5)
-	freq = get_i2c_clk();
+	freq = clock_get_periph_rate(PERIPH_ID_I2C0);
 #else
 	freq = get_PCLK();
 #endif
Signature · 1 line
1.8.0
#1 lore raw

PATCH 1/1 exynos: uart: Use generic api to the uart clk freq

From: Padmavathi Venna <[email protected]>

Use generic api to get the uart clock frequency

This patch depends on:
http://permalink.gmane.org/gmane.comp.boot-loaders.u-boot/154930

---
 drivers/serial/serial_s5p.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/serial/serial_s5p.c +1 -1
index 3c41242..7058d55 100644
@@ -65,7 +65,7 @@ static const int udivslot[] = {
 void serial_setbrg_dev(const int dev_index)
 {
 	struct s5p_uart *const uart = s5p_get_base_uart(dev_index);
-	u32 uclk = get_uart_clk(dev_index);
+	u32 uclk = clock_get_periph_rate(PERIPH_ID_UART0 + dev_index);
 	u32 baudrate = gd->baudrate;
 	u32 val;
 
Signature · 1 line
1.8.0
#2 lore raw

PATCH 1/1 exynos: uart: Use generic api to the uart clk freq

Quoted 19 lines · Akshay Saraswat

From: Padmavathi Venna <[email protected]>

Use generic api to get the uart clock frequency

This patch depends on:
http://permalink.gmane.org/gmane.comp.boot-loaders.u-boot/154930

---
 drivers/serial/serial_s5p.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/serial/serial_s5p.c +0 -0
index 3c41242..7058d55 100644

drivers/serial/serial_s5p.c static const int udivslot[] = { · line 71

Quoted 8 lines
drivers/serial/serial_s5p.c +1 -1
@@ -65,7 +65,7 @@ static const int udivslot[] = {
 void serial_setbrg_dev(const int dev_index)
 {
 	struct s5p_uart *const uart = s5p_get_base_uart(dev_index);
-	u32 uclk = get_uart_clk(dev_index);
+	u32 uclk = clock_get_periph_rate(PERIPH_ID_UART0 + dev_index);
 	u32 baudrate = gd->baudrate;
 	u32 val;
 

Since clock_get_periph_rate did not implemented on exynos4, exynos4 will get zero. So, I'll not accept this patch.

Thanks,
Minkyu Kang.

#3 lore raw

PATCH 1/1 exynos: i2c: Use generic api to get i2c clk freq

In reply to Akshay Saraswat
Quoted 3 lines · Akshay Saraswat

From: Padmavathi Venna <[email protected]>

Use generic api to get the i2c clock frequency.

Please move following comments to under "---" line.

Quoted 21 lines

Tested on smdk5250 with the help of following commands. run
i2c dev 1
i2c dev 2
i2c speed

This patch depends on:
http://permalink.gmane.org/gmane.comp.boot-loaders.u-boot/154930

---
 drivers/i2c/s3c24x0_i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/s3c24x0_i2c.c +0 -0
index 769a2ba..a9f19e7 100644

drivers/i2c/s3c24x0_i2c.c static void i2c_ch_init(struct s3c24x0_i2c *i2c, int speed, int slaveadd) · line 157

Quoted 8 lines
drivers/i2c/s3c24x0_i2c.c +1 -1
@@ -151,7 +151,7 @@ static void i2c_ch_init(struct s3c24x0_i2c *i2c, int speed, int slaveadd)
 {
 	ulong freq, pres = 16, div;
 #if (defined CONFIG_EXYNOS4 || defined CONFIG_EXYNOS5)
-	freq = get_i2c_clk();
+	freq = clock_get_periph_rate(PERIPH_ID_I2C0);
 #else
 	freq = get_PCLK();
 #endif

Thanks,
Minkyu Kang.

#4 lore raw

PATCH 1/1 exynos: i2c: Use generic api to get i2c clk freq

In reply to Akshay Saraswat
Quoted 23 lines · Akshay Saraswat

From: Padmavathi Venna <[email protected]>

Use generic api to get the i2c clock frequency. Tested on smdk5250 with the help of following commands. run
i2c dev 1
i2c dev 2
i2c speed

This patch depends on:
http://permalink.gmane.org/gmane.comp.boot-loaders.u-boot/154930

---
 drivers/i2c/s3c24x0_i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/s3c24x0_i2c.c +0 -0
index 769a2ba..a9f19e7 100644

drivers/i2c/s3c24x0_i2c.c static void i2c_ch_init(struct s3c24x0_i2c *i2c, int speed, int slaveadd) · line 154

Quoted 5 lines
drivers/i2c/s3c24x0_i2c.c +1 -1
@@ -151,7 +151,7 @@ static void i2c_ch_init(struct s3c24x0_i2c *i2c, int speed, int slaveadd)
 {
 	ulong freq, pres = 16, div;
 #if (defined CONFIG_EXYNOS4 || defined CONFIG_EXYNOS5)
-	freq = get_i2c_clk();
+	freq = clock_get_periph_rate(PERIPH_ID_I2C0);

Since clock_get_periph_rate did not implemented on exynos4, exynos4 will get zero. So, I'll not accept this patch.

drivers/i2c/s3c24x0_i2c.c static void i2c_ch_init(struct s3c24x0_i2c *i2c, int speed, int slaveadd) · line 157

Quoted 4 lines
drivers/i2c/s3c24x0_i2c.c +0 -0
 #else
 	freq = get_PCLK();
 #endif

Thanks,
Minkyu Kang.