diff options
author | Michael Hunold <devnull@localhost> | 2004-05-03 11:15:31 +0000 |
---|---|---|
committer | Michael Hunold <devnull@localhost> | 2004-05-03 11:15:31 +0000 |
commit | 30970c2a967560590b306f6965aea609d7fd3a54 (patch) | |
tree | 1546c38a1f6394165ed95326b13814661fc42477 /linux/drivers/media/dvb/ttpci/ttpci-eeprom.c | |
parent | a9135ebb9e7ffd0934fa6e9bd6b0a0a4e5ff912d (diff) | |
download | mediapointer-dvb-s2-30970c2a967560590b306f6965aea609d7fd3a54.tar.gz mediapointer-dvb-s2-30970c2a967560590b306f6965aea609d7fd3a54.tar.bz2 |
Overhaul frontend i2c subsystem because of the recent discussion about
the usage of the syscall interface to load binary firmware used by some
frontend drivers.
- add dvb_register_frontend_new() and dvb_unregister_frontend_new() which
register a frontend driver using the kernel i2c interface instead of the
dvb i2c interface.
- register kernel i2c interface in av7110/budget driver properly
- port stv0299 and ves1x93 to kernel i2c api
Other DVB drivers and frontend drivers still can use the old DVB i2c
interface.
Diffstat (limited to 'linux/drivers/media/dvb/ttpci/ttpci-eeprom.c')
-rw-r--r-- | linux/drivers/media/dvb/ttpci/ttpci-eeprom.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/linux/drivers/media/dvb/ttpci/ttpci-eeprom.c b/linux/drivers/media/dvb/ttpci/ttpci-eeprom.c index 08b71c151..07c7fb611 100644 --- a/linux/drivers/media/dvb/ttpci/ttpci-eeprom.c +++ b/linux/drivers/media/dvb/ttpci/ttpci-eeprom.c @@ -35,8 +35,8 @@ #include <linux/init.h> #include <linux/module.h> #include <linux/string.h> +#include <linux/i2c.h> -#include "dvb_i2c.h" #include "dvb_functions.h" #if 1 @@ -85,7 +85,7 @@ static int getmac_tt(u8 * decodedMAC, u8 * encodedMAC) return 0; } -static int ttpci_eeprom_read_encodedMAC(struct dvb_i2c_bus *i2c, u8 * encodedMAC) +static int ttpci_eeprom_read_encodedMAC(struct i2c_adapter *adapter, u8 * encodedMAC) { int ret; u8 b0[] = { 0xcc }; @@ -97,7 +97,7 @@ static int ttpci_eeprom_read_encodedMAC(struct dvb_i2c_bus *i2c, u8 * encodedMAC /* dprintk("%s\n", __FUNCTION__); */ - ret = i2c->xfer(i2c, msg, 2); + ret = i2c_transfer(adapter, msg, 2); if (ret != 2) /* Assume EEPROM isn't there */ return (-ENODEV); @@ -106,36 +106,34 @@ static int ttpci_eeprom_read_encodedMAC(struct dvb_i2c_bus *i2c, u8 * encodedMAC } -int ttpci_eeprom_parse_mac(struct dvb_i2c_bus *i2c) +int ttpci_eeprom_parse_mac(struct i2c_adapter *adapter, u8 *proposed_mac) { int ret, i; u8 encodedMAC[20]; u8 decodedMAC[6]; - ret = ttpci_eeprom_read_encodedMAC(i2c, encodedMAC); + ret = ttpci_eeprom_read_encodedMAC(adapter, encodedMAC); if (ret != 0) { /* Will only be -ENODEV */ dprintk("Couldn't read from EEPROM: not there?\n"); - memset(i2c->adapter->proposed_mac, 0, 6); + memset(proposed_mac, 0, 6); return ret; } ret = getmac_tt(decodedMAC, encodedMAC); if( ret != 0 ) { - dprintk("%s adapter %i failed MAC signature check\n", - i2c->adapter->name, i2c->adapter->num); + dprintk("adapter failed MAC signature check\n"); dprintk("encoded MAC from EEPROM was " ); for(i=0; i<19; i++) { dprintk( "%.2x:", encodedMAC[i]); } dprintk("%.2x\n", encodedMAC[19]); - memset(i2c->adapter->proposed_mac, 0, 6); + memset(proposed_mac, 0, 6); return ret; } - memcpy(i2c->adapter->proposed_mac, decodedMAC, 6); - dprintk("%s adapter %i has MAC addr = %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n", - i2c->adapter->name, i2c->adapter->num, + memcpy(proposed_mac, decodedMAC, 6); + dprintk("adapter has MAC addr = %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n", decodedMAC[0], decodedMAC[1], decodedMAC[2], decodedMAC[3], decodedMAC[4], decodedMAC[5]); return 0; |