From: lhh <lhh@rock-chips.com>
Date: Sat, 4 Dec 2010 03:54:21 +0000 (+0800)
Subject: add rtc and update i2s
X-Git-Tag: firefly_0821_release~11000
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=30c2f6473f9606876e5e28be38fb62a3e5cae950;p=firefly-linux-kernel-4.4.55.git

add rtc and update i2s
---

diff --git a/arch/arm/mach-rk29/board-rk29sdk.c b/arch/arm/mach-rk29/board-rk29sdk.c
index 608df99963cf..6390ec601a46 100755
--- a/arch/arm/mach-rk29/board-rk29sdk.c
+++ b/arch/arm/mach-rk29/board-rk29sdk.c
@@ -309,6 +309,13 @@ static struct i2c_board_info __initdata board_i2c0_devices[] = {
 		.flags			= 0,
 	},
 #endif
+#if defined (CONFIG_SND_SOC_WM8900)
+	{
+		.type    		= "wm8900",
+		.addr           = 0x1A,
+		.flags			= 0,
+	},
+#endif
 #if defined (CONFIG_BATTERY_STC3100)
 	{
 		.type    		= "stc3100-battery",
@@ -323,6 +330,14 @@ static struct i2c_board_info __initdata board_i2c0_devices[] = {
 		.flags			= 0,
 	},
 #endif
+#if defined (CONFIG_RTC_HYM8563)
+	{
+		.type    		= "rtc_hym8563",
+		.addr           = 0x51,
+		.flags			= 0,
+		///.irq            = RK2818_PIN_PA4,
+	},
+#endif
 };
 #endif
 
diff --git a/drivers/i2c/busses/i2c-rk29.c b/drivers/i2c/busses/i2c-rk29.c
index b1916ec06c91..45f4afb0e1fe 100755
--- a/drivers/i2c/busses/i2c-rk29.c
+++ b/drivers/i2c/busses/i2c-rk29.c
@@ -35,7 +35,7 @@
 #define RK2818_I2C_TIMEOUT		(msecs_to_jiffies(500))
 #define RK2818_DELAY_TIME		2
 
-#if 1
+#if 0
 #define i2c_dbg(dev, format, arg...)		\
 	dev_printk(KERN_INFO , dev , format , ## arg)
 #else
diff --git a/drivers/rtc/Kconfig b/drivers/rtc/Kconfig
index 7e4ee792ee5c..9a1495575e22 100755
--- a/drivers/rtc/Kconfig
+++ b/drivers/rtc/Kconfig
@@ -147,8 +147,8 @@ comment "I2C RTC drivers"
 if I2C
 
 config RTC_HYM8563
-        tristate "RK2818 extern HYM8563 RTC"
-	depends on I2C_RK2818
+        tristate "RK2818 or RK29 extern HYM8563 RTC"
+	depends on I2C_RK2818 || I2C_RK29
         help
           If you say yes here you will get support for the
           HYM8563 I2C RTC chip.
diff --git a/sound/soc/rk29/rk29_i2s.c b/sound/soc/rk29/rk29_i2s.c
index 4dc352fc7688..510fd7094b17 100755
--- a/sound/soc/rk29/rk29_i2s.c
+++ b/sound/soc/rk29/rk29_i2s.c
@@ -128,12 +128,10 @@ static void rockchip_snd_txctrl(struct rk29_i2s_info *i2s, int on)
         u32 opr,xfer,fifosts;
     
         I2S_DBG("Enter %s, %d >>>>>>>>>>>\n", __func__, __LINE__);
-        
-        opr  = readl(pheadi2s->I2S_DMACR);
-        xfer = readl(pheadi2s->I2S_XFER);
-        
+        opr  = readl(&(pheadi2s->I2S_DMACR));
+        xfer = readl(&(pheadi2s->I2S_XFER));
         opr  &= ~I2S_TRAN_DMA_ENABLE;
-        xfer &= ~I2S_TX_TRAN_START;        
+        xfer &= ~I2S_TX_TRAN_START;       
         if (on) 
         {                
                 writel(opr, &(pheadi2s->I2S_DMACR));
@@ -149,7 +147,7 @@ static void rockchip_snd_txctrl(struct rk29_i2s_info *i2s, int on)
         {
                 writel(opr, &(pheadi2s->I2S_DMACR));
                 writel(xfer, &(pheadi2s->I2S_XFER));
-        }  
+        } 
 }
 
 static void rockchip_snd_rxctrl(struct rk29_i2s_info *i2s, int on)
@@ -158,8 +156,8 @@ static void rockchip_snd_rxctrl(struct rk29_i2s_info *i2s, int on)
           
         I2S_DBG("Enter %s, %d >>>>>>>>>>>\n", __func__, __LINE__);
 
-        opr  = readl(pheadi2s->I2S_DMACR);
-        xfer = readl(pheadi2s->I2S_XFER);
+        opr  = readl(&(pheadi2s->I2S_DMACR));
+        xfer = readl(&(pheadi2s->I2S_XFER));
         
         opr  &= ~I2S_RECE_DMA_ENABLE;
         xfer &= ~I2S_RX_TRAN_START;
@@ -450,7 +448,7 @@ static int rk29_i2s_probe(struct platform_device *pdev,
 		base = res->start;
 	}
 
-	i2s->regs = ioremap(base, resource_size(res));
+	i2s->regs = ioremap(base, (res->end - res->start) + 1); ////res));
 	if (i2s->regs == NULL) {
 		dev_err(dev, "cannot ioremap registers\n");
 		return -ENXIO;
diff --git a/sound/soc/rk29/rk29_i2s.h b/sound/soc/rk29/rk29_i2s.h
index 8b7e8fc3b67d..dba88944e977 100755
--- a/sound/soc/rk29/rk29_i2s.h
+++ b/sound/soc/rk29/rk29_i2s.h
@@ -122,7 +122,7 @@
 #define I2S_TX_LRCK_OUT_I2S             (0<<5)
 #define I2S_TX_LRCK_OUT_PCM             (1<<5)
 
-#define I2S_DATA_WIDTH(w)               ((&0x1F)<<0)
+#define I2S_DATA_WIDTH(w)               ((w&0x1F)<<0)
 
 /* */