]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
V4L/DVB (9366): Move S921 driver to the proper place and allow it to compile
authorMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 24 Oct 2008 16:44:38 +0000 (13:44 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 29 Dec 2008 19:53:13 +0000 (17:53 -0200)
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/frontends/Kconfig
drivers/media/dvb/frontends/Makefile
drivers/media/dvb/frontends/s921_core.c [moved from drivers/media/video/empia/sharp/s921_core.c with 56% similarity]
drivers/media/dvb/frontends/s921_core.h [moved from drivers/media/video/empia/sharp/s921_core.h with 100% similarity]
drivers/media/dvb/frontends/s921_module.c [moved from drivers/media/video/empia/sharp/s921_module.c with 93% similarity]
drivers/media/dvb/frontends/s921_module.h [moved from drivers/media/video/empia/sharp/s921_module.h with 100% similarity]
drivers/media/video/empia/sharp/Makefile [deleted file]

index 96b93e21a84bdbb6ddeb9ea2e3635b50ca0da149..8da1e81668e7ce23dea599a4d5622a2733dd3b13 100644 (file)
@@ -369,6 +369,17 @@ config DVB_S5H1411
          An ATSC 8VSB and QAM64/256 tuner module. Say Y when you want
          to support this frontend.
 
+comment "ISDB-T (terrestrial) frontends"
+       depends on DVB_CORE
+
+config DVB_S921
+       tristate "Sharp S921 tuner"
+       depends on DVB_CORE && I2C
+       default m if DVB_FE_CUSTOMISE
+       help
+         AN ISDB-T DQPSK, QPSK, 16QAM and 64QAM 1seg tuner module.
+         Say Y when you want to support this frontend.
+
 comment "Digital terrestrial only tuners/PLL"
        depends on DVB_CORE
 
index aba79f4a63a7217475079e694cb9fc4fbb052d34..11a5407ecdb7d86c97651d9f3f7327fea7d2a448 100644 (file)
@@ -5,6 +5,8 @@
 EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core/
 EXTRA_CFLAGS += -Idrivers/media/common/tuners/
 
+s921-objs := s921_module.o s921_core.o
+
 obj-$(CONFIG_DVB_PLL) += dvb-pll.o
 obj-$(CONFIG_DVB_STV0299) += stv0299.o
 obj-$(CONFIG_DVB_SP8870) += sp8870.o
@@ -55,3 +57,4 @@ obj-$(CONFIG_DVB_CX24116) += cx24116.o
 obj-$(CONFIG_DVB_SI21XX) += si21xx.o
 obj-$(CONFIG_DVB_STV0288) += stv0288.o
 obj-$(CONFIG_DVB_STB6000) += stb6000.o
+obj-$(CONFIG_DVB_S921) += s921.o
similarity index 56%
rename from drivers/media/video/empia/sharp/s921_core.c
rename to drivers/media/dvb/frontends/s921_core.c
index 01a7caebc0e9fb3640dcca3b66726a4529fdc13c..974b52be9aead87ea3f58b20ac56e85ee294a2ea 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <linux/kernel.h>
 #include <linux/module.h>
+#include <linux/delay.h>
 #include "s921_core.h"
 
 static int s921_isdb_init(struct s921_isdb_t *dev);
@@ -16,49 +17,49 @@ static int s921_isdb_tune(struct s921_isdb_t *dev, struct s921_isdb_t_tune_param
 static int s921_isdb_get_status(struct s921_isdb_t *dev, void *data);
 
 static u8 init_table[]={ 0x01, 0x40, 0x02, 0x00, 0x03, 0x40, 0x04, 0x01,
-                         0x05, 0x00, 0x06, 0x00, 0x07, 0x00, 0x08, 0x00,
-                         0x09, 0x00, 0x0a, 0x00, 0x0b, 0x5a, 0x0c, 0x00,
-                         0x0d, 0x00, 0x0f, 0x00, 0x13, 0x1b, 0x14, 0x80,
-                         0x15, 0x40, 0x17, 0x70, 0x18, 0x01, 0x19, 0x12,
-                         0x1a, 0x01, 0x1b, 0x12, 0x1c, 0xa0, 0x1d, 0x00,
-                         0x1e, 0x0a, 0x1f, 0x08, 0x20, 0x40, 0x21, 0xff,
-                         0x22, 0x4c, 0x23, 0x4e, 0x24, 0x4c, 0x25, 0x00,
-                         0x26, 0x00, 0x27, 0xf4, 0x28, 0x60, 0x29, 0x88,
-                         0x2a, 0x40, 0x2b, 0x40, 0x2c, 0xff, 0x2d, 0x00,
-                         0x2e, 0xff, 0x2f, 0x00, 0x30, 0x20, 0x31, 0x06,
-                         0x32, 0x0c, 0x34, 0x0f, 0x37, 0xfe, 0x38, 0x00,
-                         0x39, 0x63, 0x3a, 0x10, 0x3b, 0x10, 0x47, 0x00,
-                         0x49, 0xe5, 0x4b, 0x00, 0x50, 0xc0, 0x52, 0x20,
-                         0x54, 0x5a, 0x55, 0x5b, 0x56, 0x40, 0x57, 0x70,
-                         0x5c, 0x50, 0x5d, 0x00, 0x62, 0x17, 0x63, 0x2f,
-                         0x64, 0x6f, 0x68, 0x00, 0x69, 0x89, 0x6a, 0x00,
-                         0x6b, 0x00, 0x6c, 0x00, 0x6d, 0x00, 0x6e, 0x00,
-                         0x70, 0x00, 0x71, 0x00, 0x75, 0x00, 0x76, 0x30,
-                         0x77, 0x01, 0xaf, 0x00, 0xb0, 0xa0, 0xb2, 0x3d,
-                         0xb3, 0x25, 0xb4, 0x8b, 0xb5, 0x4b, 0xb6, 0x3f,
-                         0xb7, 0xff, 0xb8, 0xff, 0xb9, 0xfc, 0xba, 0x00,
-                         0xbb, 0x00, 0xbc, 0x00, 0xd0, 0x30, 0xe4, 0x84,
-                         0xf0, 0x48, 0xf1, 0x19, 0xf2, 0x5a, 0xf3, 0x8e,
-                         0xf4, 0x2d, 0xf5, 0x07, 0xf6, 0x5a, 0xf7, 0xba,
-                         0xf8, 0xd7 };
+                        0x05, 0x00, 0x06, 0x00, 0x07, 0x00, 0x08, 0x00,
+                        0x09, 0x00, 0x0a, 0x00, 0x0b, 0x5a, 0x0c, 0x00,
+                        0x0d, 0x00, 0x0f, 0x00, 0x13, 0x1b, 0x14, 0x80,
+                        0x15, 0x40, 0x17, 0x70, 0x18, 0x01, 0x19, 0x12,
+                        0x1a, 0x01, 0x1b, 0x12, 0x1c, 0xa0, 0x1d, 0x00,
+                        0x1e, 0x0a, 0x1f, 0x08, 0x20, 0x40, 0x21, 0xff,
+                        0x22, 0x4c, 0x23, 0x4e, 0x24, 0x4c, 0x25, 0x00,
+                        0x26, 0x00, 0x27, 0xf4, 0x28, 0x60, 0x29, 0x88,
+                        0x2a, 0x40, 0x2b, 0x40, 0x2c, 0xff, 0x2d, 0x00,
+                        0x2e, 0xff, 0x2f, 0x00, 0x30, 0x20, 0x31, 0x06,
+                        0x32, 0x0c, 0x34, 0x0f, 0x37, 0xfe, 0x38, 0x00,
+                        0x39, 0x63, 0x3a, 0x10, 0x3b, 0x10, 0x47, 0x00,
+                        0x49, 0xe5, 0x4b, 0x00, 0x50, 0xc0, 0x52, 0x20,
+                        0x54, 0x5a, 0x55, 0x5b, 0x56, 0x40, 0x57, 0x70,
+                        0x5c, 0x50, 0x5d, 0x00, 0x62, 0x17, 0x63, 0x2f,
+                        0x64, 0x6f, 0x68, 0x00, 0x69, 0x89, 0x6a, 0x00,
+                        0x6b, 0x00, 0x6c, 0x00, 0x6d, 0x00, 0x6e, 0x00,
+                        0x70, 0x00, 0x71, 0x00, 0x75, 0x00, 0x76, 0x30,
+                        0x77, 0x01, 0xaf, 0x00, 0xb0, 0xa0, 0xb2, 0x3d,
+                        0xb3, 0x25, 0xb4, 0x8b, 0xb5, 0x4b, 0xb6, 0x3f,
+                        0xb7, 0xff, 0xb8, 0xff, 0xb9, 0xfc, 0xba, 0x00,
+                        0xbb, 0x00, 0xbc, 0x00, 0xd0, 0x30, 0xe4, 0x84,
+                        0xf0, 0x48, 0xf1, 0x19, 0xf2, 0x5a, 0xf3, 0x8e,
+                        0xf4, 0x2d, 0xf5, 0x07, 0xf6, 0x5a, 0xf7, 0xba,
+                        0xf8, 0xd7 };
 
 static u8 c_table[]={ 0x58, 0x8a, 0x7b, 0x59, 0x8c, 0x7b, 0x5a, 0x8e, 0x5b,
-                      0x5b, 0x90, 0x5b, 0x5c, 0x92, 0x5b, 0x5d, 0x94, 0x5b,
-                      0x5e, 0x96, 0x5b, 0x5f, 0x98, 0x3b, 0x60, 0x9a, 0x3b,
-                      0x61, 0x9c, 0x3b, 0x62, 0x9e, 0x3b, 0x63, 0xa0, 0x3b,
-                      0x64, 0xa2, 0x1b, 0x65, 0xa4, 0x1b, 0x66, 0xa6, 0x1b,
-                      0x67, 0xa8, 0x1b, 0x68, 0xaa, 0x1b, 0x69, 0xac, 0x1b,
-                      0x6a, 0xae, 0x1b, 0x6b, 0xb0, 0x1b, 0x6c, 0xb2, 0x1b,
-                      0x6d, 0xb4, 0xfb, 0x6e, 0xb6, 0xfb, 0x6f, 0xb8, 0xfb,
-                      0x70, 0xba, 0xfb, 0x71, 0xbc, 0xdb, 0x72, 0xbe, 0xdb,
-                      0x73, 0xc0, 0xdb, 0x74, 0xc2, 0xdb, 0x75, 0xc4, 0xdb,
-                      0x76, 0xc6, 0xdb, 0x77, 0xc8, 0xbb, 0x78, 0xca, 0xbb,
-                      0x79, 0xcc, 0xbb, 0x7a, 0xce, 0xbb, 0x7b, 0xd0, 0xbb,
-                      0x7c, 0xd2, 0xbb, 0x7d, 0xd4, 0xbb, 0x7e, 0xd6, 0xbb,
-                      0x7f, 0xd8, 0xbb, 0x80, 0xda, 0x9b, 0x81, 0xdc, 0x9b,
-                      0x82, 0xde, 0x9b, 0x83, 0xe0, 0x9b, 0x84, 0xe2, 0x9b,
-                      0x85, 0xe4, 0x9b, 0x86, 0xe6, 0x9b, 0x87, 0xe8, 0x9b,
-                      0x88, 0xea, 0x9b, 0x89, 0xec, 0x9b };
+                     0x5b, 0x90, 0x5b, 0x5c, 0x92, 0x5b, 0x5d, 0x94, 0x5b,
+                     0x5e, 0x96, 0x5b, 0x5f, 0x98, 0x3b, 0x60, 0x9a, 0x3b,
+                     0x61, 0x9c, 0x3b, 0x62, 0x9e, 0x3b, 0x63, 0xa0, 0x3b,
+                     0x64, 0xa2, 0x1b, 0x65, 0xa4, 0x1b, 0x66, 0xa6, 0x1b,
+                     0x67, 0xa8, 0x1b, 0x68, 0xaa, 0x1b, 0x69, 0xac, 0x1b,
+                     0x6a, 0xae, 0x1b, 0x6b, 0xb0, 0x1b, 0x6c, 0xb2, 0x1b,
+                     0x6d, 0xb4, 0xfb, 0x6e, 0xb6, 0xfb, 0x6f, 0xb8, 0xfb,
+                     0x70, 0xba, 0xfb, 0x71, 0xbc, 0xdb, 0x72, 0xbe, 0xdb,
+                     0x73, 0xc0, 0xdb, 0x74, 0xc2, 0xdb, 0x75, 0xc4, 0xdb,
+                     0x76, 0xc6, 0xdb, 0x77, 0xc8, 0xbb, 0x78, 0xca, 0xbb,
+                     0x79, 0xcc, 0xbb, 0x7a, 0xce, 0xbb, 0x7b, 0xd0, 0xbb,
+                     0x7c, 0xd2, 0xbb, 0x7d, 0xd4, 0xbb, 0x7e, 0xd6, 0xbb,
+                     0x7f, 0xd8, 0xbb, 0x80, 0xda, 0x9b, 0x81, 0xdc, 0x9b,
+                     0x82, 0xde, 0x9b, 0x83, 0xe0, 0x9b, 0x84, 0xe2, 0x9b,
+                     0x85, 0xe4, 0x9b, 0x86, 0xe6, 0x9b, 0x87, 0xe8, 0x9b,
+                     0x88, 0xea, 0x9b, 0x89, 0xec, 0x9b };
 
 int s921_isdb_cmd(struct s921_isdb_t *dev, u32 cmd, void *data) {
        switch(cmd) {
@@ -84,7 +85,7 @@ int s921_isdb_cmd(struct s921_isdb_t *dev, u32 cmd, void *data) {
 static int s921_isdb_init(struct s921_isdb_t *dev) {
        unsigned int i;
        unsigned int ret;
-        printk("isdb_init\n");
+       printk("isdb_init\n");
        for (i = 0; i < sizeof(init_table); i+=2) {
                ret = dev->i2c_write(dev->priv_dev, init_table[i], init_table[i+1]);
                if (ret != 0) {
similarity index 93%
rename from drivers/media/video/empia/sharp/s921_module.c
rename to drivers/media/dvb/frontends/s921_module.c
index 0f03d24ccb8a86f55f3b7c86a475bb1d21873284..3cbb9cb2cf47a34d6015e9369177cbc936c62fd2 100644 (file)
@@ -23,10 +23,10 @@ MODULE_PARM_DESC(debug,"s921 debugging (default off)");
 
 struct s921_state
 {
-        struct dvb_frontend frontend;
-        fe_modulation_t current_modulation;
-        __u32 snr;
-        __u32 current_frequency;
+       struct dvb_frontend frontend;
+       fe_modulation_t current_modulation;
+       __u32 snr;
+       __u32 current_frequency;
        __u8 addr;
        struct s921_isdb_t dev;
        struct i2c_adapter *i2c;
@@ -46,7 +46,7 @@ static int s921_set_parameters(struct dvb_frontend *fe, struct dvb_frontend_para
 
 static int s921_init(struct dvb_frontend *fe) {
        printk("s921 init\n");
-        return 0;
+       return 0;
 }
 
 static int s921_sleep(struct dvb_frontend *fe) {
@@ -127,7 +127,7 @@ static struct dvb_frontend_ops demod_s921={
 static int s921_write(void *dev, u8 reg, u8 val) {
        struct s921_state *state = dev;
        char buf[2]={reg,val};
-        int err;
+       int err;
        struct i2c_msg i2cmsgs = {
                .addr = state->addr,
                .flags = 0,
@@ -137,11 +137,11 @@ static int s921_write(void *dev, u8 reg, u8 val) {
 
        if((err = i2c_transfer(state->i2c, &i2cmsgs, 1))<0) {
                printk("%s i2c_transfer error %d\n", __FUNCTION__, err);
-                if (err < 0)
-                        return err;
-                else
-                        return -EREMOTEIO;
-        }
+               if (err < 0)
+                       return err;
+               else
+                       return -EREMOTEIO;
+       }
 
        return 0;
 }
diff --git a/drivers/media/video/empia/sharp/Makefile b/drivers/media/video/empia/sharp/Makefile
deleted file mode 100644 (file)
index 5105611..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-s921-objs := s921_module.o s921_core.o
-
-obj-m += s921.o