summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/b2c2/flexcop.c
diff options
context:
space:
mode:
authorPatrick Boettcher <pb@linuxtv.org>2008-03-29 21:49:57 +0100
committerPatrick Boettcher <pb@linuxtv.org>2008-03-29 21:49:57 +0100
commit1be90df9422b4ee4d6343477eda998c5d3e3e488 (patch)
tree432d136dfd9cce61a3546fd14714b8396f93cad8 /linux/drivers/media/dvb/b2c2/flexcop.c
parent930f7c234a59cde31e520dc99f89314ba37f4d33 (diff)
downloadmediapointer-dvb-s2-1be90df9422b4ee4d6343477eda998c5d3e3e488.tar.gz
mediapointer-dvb-s2-1be90df9422b4ee4d6343477eda998c5d3e3e488.tar.bz2
Preparation for supporting new devices, cleanup and saneness
From: Patrick Boettcher <pb@linuxtv.org> To prepare the support for new device to the flexcop-family some preparation and cleanups was done + some saneness: - created an i2c-adapter for each i2c-port available. Easier usage for devices with several device on different i2c-busses - initialize i2c before doing the eeprom read - changed the way to attach the different frontends, easier to read now - enabled support for i2c-devices having no register address (1-byte access) Signed-off-by: Patrick Boettcher <pb@linuxtv.org>
Diffstat (limited to 'linux/drivers/media/dvb/b2c2/flexcop.c')
-rw-r--r--linux/drivers/media/dvb/b2c2/flexcop.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/linux/drivers/media/dvb/b2c2/flexcop.c b/linux/drivers/media/dvb/b2c2/flexcop.c
index 2ddafd071..205146c24 100644
--- a/linux/drivers/media/dvb/b2c2/flexcop.c
+++ b/linux/drivers/media/dvb/b2c2/flexcop.c
@@ -257,6 +257,12 @@ int flexcop_device_initialize(struct flexcop_device *fc)
if ((ret = flexcop_dvb_init(fc)))
goto error;
+ /* i2c has to be done before doing EEProm stuff -
+ * because the EEProm is accessed via i2c */
+ ret = flexcop_i2c_init(fc);
+ if (ret)
+ goto error;
+
/* do the MAC address reading after initializing the dvb_adapter */
if (fc->get_mac_addr(fc, 0) == 0) {
u8 *b = fc->dvb_adapter.proposed_mac;
@@ -266,10 +272,6 @@ int flexcop_device_initialize(struct flexcop_device *fc)
} else
warn("reading of MAC address failed.\n");
-
- if ((ret = flexcop_i2c_init(fc)))
- goto error;
-
if ((ret = flexcop_frontend_init(fc)))
goto error;