aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2009-10-31 22:14:35 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-08-02 15:42:45 -0400
commit7638699c253620a5745592d229b7e3ba9dbd218d (patch)
tree01c90f4d7763bc7075cac904254c17d0d2bcfea3 /drivers/media/dvb/frontends
parent73c994e4fb69b7bb85663e5175432c307657d207 (diff)
V4L/DVB: lgs8gxx: remove firmware for lgs8g75
The recently added support for lgs8g75 included some 8051 machine code without accompanying source code. Replace this with use of the firmware loader. Compile-tested only. Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/frontends')
-rw-r--r--drivers/media/dvb/frontends/Kconfig1
-rw-r--r--drivers/media/dvb/frontends/lgs8gxx.c50
2 files changed, 11 insertions, 40 deletions
diff --git a/drivers/media/dvb/frontends/Kconfig b/drivers/media/dvb/frontends/Kconfig
index cd7f9b7cbffa..51d578a758a7 100644
--- a/drivers/media/dvb/frontends/Kconfig
+++ b/drivers/media/dvb/frontends/Kconfig
@@ -584,6 +584,7 @@ config DVB_LGS8GL5
584config DVB_LGS8GXX 584config DVB_LGS8GXX
585 tristate "Legend Silicon LGS8913/LGS8GL5/LGS8GXX DMB-TH demodulator" 585 tristate "Legend Silicon LGS8913/LGS8GL5/LGS8GXX DMB-TH demodulator"
586 depends on DVB_CORE && I2C 586 depends on DVB_CORE && I2C
587 select FW_LOADER
587 default m if DVB_FE_CUSTOMISE 588 default m if DVB_FE_CUSTOMISE
588 help 589 help
589 A DMB-TH tuner module. Say Y when you want to support this frontend. 590 A DMB-TH tuner module. Say Y when you want to support this frontend.
diff --git a/drivers/media/dvb/frontends/lgs8gxx.c b/drivers/media/dvb/frontends/lgs8gxx.c
index dee53960e7e8..5ea28ae2ba8f 100644
--- a/drivers/media/dvb/frontends/lgs8gxx.c
+++ b/drivers/media/dvb/frontends/lgs8gxx.c
@@ -24,6 +24,7 @@
24 */ 24 */
25 25
26#include <asm/div64.h> 26#include <asm/div64.h>
27#include <linux/firmware.h>
27 28
28#include "dvb_frontend.h" 29#include "dvb_frontend.h"
29 30
@@ -46,42 +47,6 @@ module_param(fake_signal_str, int, 0644);
46MODULE_PARM_DESC(fake_signal_str, "fake signal strength for LGS8913." 47MODULE_PARM_DESC(fake_signal_str, "fake signal strength for LGS8913."
47"Signal strength calculation is slow.(default:on)."); 48"Signal strength calculation is slow.(default:on).");
48 49
49static const u8 lgs8g75_initdat[] = {
50 0x01, 0x30, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
51 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
52 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
53 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
54 0x00, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
55 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
56 0xE4, 0xF5, 0xA8, 0xF5, 0xB8, 0xF5, 0x88, 0xF5,
57 0x89, 0xF5, 0x87, 0x75, 0xD0, 0x00, 0x11, 0x50,
58 0x11, 0x50, 0xF4, 0xF5, 0x80, 0xF5, 0x90, 0xF5,
59 0xA0, 0xF5, 0xB0, 0x75, 0x81, 0x30, 0x80, 0x01,
60 0x32, 0x90, 0x80, 0x12, 0x74, 0xFF, 0xF0, 0x90,
61 0x80, 0x13, 0x74, 0x1F, 0xF0, 0x90, 0x80, 0x23,
62 0x74, 0x01, 0xF0, 0x90, 0x80, 0x22, 0xF0, 0x90,
63 0x00, 0x48, 0x74, 0x00, 0xF0, 0x90, 0x80, 0x4D,
64 0x74, 0x05, 0xF0, 0x90, 0x80, 0x09, 0xE0, 0x60,
65 0x21, 0x12, 0x00, 0xDD, 0x14, 0x60, 0x1B, 0x12,
66 0x00, 0xDD, 0x14, 0x60, 0x15, 0x12, 0x00, 0xDD,
67 0x14, 0x60, 0x0F, 0x12, 0x00, 0xDD, 0x14, 0x60,
68 0x09, 0x12, 0x00, 0xDD, 0x14, 0x60, 0x03, 0x12,
69 0x00, 0xDD, 0x90, 0x80, 0x42, 0xE0, 0x60, 0x0B,
70 0x14, 0x60, 0x0C, 0x14, 0x60, 0x0D, 0x14, 0x60,
71 0x0E, 0x01, 0xB3, 0x74, 0x04, 0x01, 0xB9, 0x74,
72 0x05, 0x01, 0xB9, 0x74, 0x07, 0x01, 0xB9, 0x74,
73 0x0A, 0xC0, 0xE0, 0x74, 0xC8, 0x12, 0x00, 0xE2,
74 0xD0, 0xE0, 0x14, 0x70, 0xF4, 0x90, 0x80, 0x09,
75 0xE0, 0x70, 0xAE, 0x12, 0x00, 0xF6, 0x12, 0x00,
76 0xFE, 0x90, 0x00, 0x48, 0xE0, 0x04, 0xF0, 0x90,
77 0x80, 0x4E, 0xF0, 0x01, 0x73, 0x90, 0x80, 0x08,
78 0xF0, 0x22, 0xF8, 0x7A, 0x0C, 0x79, 0xFD, 0x00,
79 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD9,
80 0xF6, 0xDA, 0xF2, 0xD8, 0xEE, 0x22, 0x90, 0x80,
81 0x65, 0xE0, 0x54, 0xFD, 0xF0, 0x22, 0x90, 0x80,
82 0x65, 0xE0, 0x44, 0xC2, 0xF0, 0x22
83};
84
85/* LGS8GXX internal helper functions */ 50/* LGS8GXX internal helper functions */
86 51
87static int lgs8gxx_write_reg(struct lgs8gxx_state *priv, u8 reg, u8 data) 52static int lgs8gxx_write_reg(struct lgs8gxx_state *priv, u8 reg, u8 data)
@@ -627,9 +592,14 @@ static int lgs8913_init(struct lgs8gxx_state *priv)
627 592
628static int lgs8g75_init_data(struct lgs8gxx_state *priv) 593static int lgs8g75_init_data(struct lgs8gxx_state *priv)
629{ 594{
630 const u8 *p = lgs8g75_initdat; 595 const struct firmware *fw;
596 int rc;
631 int i; 597 int i;
632 598
599 rc = request_firmware(&fw, "lgs8g75.fw", &priv->i2c->dev);
600 if (rc)
601 return rc;
602
633 lgs8gxx_write_reg(priv, 0xC6, 0x40); 603 lgs8gxx_write_reg(priv, 0xC6, 0x40);
634 604
635 lgs8gxx_write_reg(priv, 0x3D, 0x04); 605 lgs8gxx_write_reg(priv, 0x3D, 0x04);
@@ -640,16 +610,16 @@ static int lgs8g75_init_data(struct lgs8gxx_state *priv)
640 lgs8gxx_write_reg(priv, 0x3B, 0x00); 610 lgs8gxx_write_reg(priv, 0x3B, 0x00);
641 lgs8gxx_write_reg(priv, 0x38, 0x00); 611 lgs8gxx_write_reg(priv, 0x38, 0x00);
642 612
643 for (i = 0; i < sizeof(lgs8g75_initdat); i++) { 613 for (i = 0; i < fw->size; i++) {
644 lgs8gxx_write_reg(priv, 0x38, 0x00); 614 lgs8gxx_write_reg(priv, 0x38, 0x00);
645 lgs8gxx_write_reg(priv, 0x3A, (u8)(i&0xff)); 615 lgs8gxx_write_reg(priv, 0x3A, (u8)(i&0xff));
646 lgs8gxx_write_reg(priv, 0x3B, (u8)(i>>8)); 616 lgs8gxx_write_reg(priv, 0x3B, (u8)(i>>8));
647 lgs8gxx_write_reg(priv, 0x3C, *p); 617 lgs8gxx_write_reg(priv, 0x3C, fw->data[i]);
648 p++;
649 } 618 }
650 619
651 lgs8gxx_write_reg(priv, 0x38, 0x00); 620 lgs8gxx_write_reg(priv, 0x38, 0x00);
652 621
622 release_firmware(fw);
653 return 0; 623 return 0;
654} 624}
655 625