]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/staging/tm6000/tm6000-core.c
v4l-dvb: update gfp/slab.h includes
[karo-tx-linux.git] / drivers / staging / tm6000 / tm6000-core.c
index 1259ae550547bedccbf62e2dd4f5194e63ad84f4..c3690e3580da05a002ab272a042804dfda78886f 100644 (file)
@@ -22,6 +22,7 @@
 
 #include <linux/module.h>
 #include <linux/kernel.h>
+#include <linux/slab.h>
 #include <linux/usb.h>
 #include <linux/i2c.h>
 #include "tm6000.h"
@@ -153,6 +154,22 @@ int tm6000_get_reg32 (struct tm6000_core *dev, u8 req, u16 value, u16 index)
        return buf[3] | buf[2] << 8 | buf[1] << 16 | buf[0] << 24;
 }
 
+int tm6000_i2c_reset(struct tm6000_core *dev, u16 tsleep)
+{
+       int rc;
+
+       rc = tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN, TM6000_GPIO_CLK, 0);
+       if (rc < 0)
+               return rc;
+
+       msleep(tsleep);
+
+       rc = tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN, TM6000_GPIO_CLK, 1);
+       msleep(tsleep);
+
+       return rc;
+}
+
 void tm6000_set_fourcc_format(struct tm6000_core *dev)
 {
        if (dev->dev_type == TM6010) {
@@ -323,6 +340,12 @@ int tm6000_init_analog_mode (struct tm6000_core *dev)
        tm6000_set_standard (dev, &dev->norm);
        tm6000_set_audio_bitrate (dev,48000);
 
+       /* switch dvb led off */
+       if (dev->gpio.dvb_led) {
+               tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN,
+                       dev->gpio.dvb_led, 0x01);
+       }
+
        return 0;
 }
 
@@ -375,6 +398,13 @@ int tm6000_init_digital_mode (struct tm6000_core *dev)
                tm6000_set_reg (dev, REQ_04_EN_DISABLE_MCU_INT, 0x0020, 0x00);
                msleep(100);
        }
+
+       /* switch dvb led on */
+       if (dev->gpio.dvb_led) {
+               tm6000_set_reg(dev, REQ_03_SET_GET_MCU_PIN,
+                       dev->gpio.dvb_led, 0x00);
+       }
+
        return 0;
 }