22 #include <linux/slab.h>
27 #define trace_eeprom(...) pvr2_trace(PVR2_TRACE_EEPROM,__VA_ARGS__)
42 #define EEPROM_SIZE 128
45 static u8 *pvr2_eeprom_fetch(
struct pvr2_hdw *hdw)
59 "Failed to allocate memory"
60 " required to read eeprom");
64 trace_eeprom(
"Value for eeprom addr from controller was 0x%x",
70 if (addr & 0x80) addr >>= 1;
76 eepromSize = (mode16 ? 4096 : 256);
78 " using %d bit addressing",eepromSize,addr,
83 msg[0].
len = mode16 ? 2 : 1;
95 if (pcnt + tcnt > EEPROM_SIZE) pcnt = EEPROM_SIZE-tcnt;
104 msg[1].
buf = eeprom+tcnt;
108 "eeprom fetch set offs err=%d",ret);
123 memset(&tvdata,0,
sizeof(tvdata));
125 eeprom = pvr2_eeprom_fetch(hdw);
126 if (!eeprom)
return -
EINVAL;