Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

serial: 8250_exar: Remove old exar_ee_read() and other unneeded code

Remove the old exar_ee_read() and associated helper functions.
Remove defines that are no longer needed after the switch to using the
eeprom_93cx6 driver.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Parker Newman <pnewman@connecttech.com>
Link: https://lore.kernel.org/r/ed756c48965a95ce3384ebb7fe2441b4928b4510.1727880931.git.pnewman@connecttech.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Parker Newman and committed by
Greg Kroah-Hartman
f5927d83 85eb2e57

-90
-90
drivers/tty/serial/8250/8250_exar.c
··· 136 136 #define UART_EXAR_REGB_EECS BIT(5) 137 137 #define UART_EXAR_REGB_EEDI BIT(6) 138 138 #define UART_EXAR_REGB_EEDO BIT(7) 139 - #define UART_EXAR_REGB_EE_ADDR_SIZE 6 140 - #define UART_EXAR_REGB_EE_DATA_SIZE 16 141 139 142 140 #define UART_EXAR_XR17C15X_PORT_OFFSET 0x200 143 141 #define UART_EXAR_XR17V25X_PORT_OFFSET 0x200 ··· 266 268 static inline u8 exar_read_reg(struct exar8250 *priv, unsigned int reg) 267 269 { 268 270 return readb(priv->virt + reg); 269 - } 270 - 271 - static inline void exar_ee_select(struct exar8250 *priv) 272 - { 273 - // Set chip select pin high to enable EEPROM reads/writes 274 - exar_write_reg(priv, UART_EXAR_REGB, UART_EXAR_REGB_EECS); 275 - // Min ~500ns delay needed between CS assert and EEPROM access 276 - udelay(1); 277 - } 278 - 279 - static inline void exar_ee_deselect(struct exar8250 *priv) 280 - { 281 - exar_write_reg(priv, UART_EXAR_REGB, 0x00); 282 - } 283 - 284 - static inline void exar_ee_write_bit(struct exar8250 *priv, u8 bit) 285 - { 286 - u8 value = UART_EXAR_REGB_EECS; 287 - 288 - if (bit) 289 - value |= UART_EXAR_REGB_EEDI; 290 - 291 - // Clock out the bit on the EEPROM interface 292 - exar_write_reg(priv, UART_EXAR_REGB, value); 293 - // 2us delay = ~500khz clock speed 294 - udelay(2); 295 - 296 - value |= UART_EXAR_REGB_EECK; 297 - 298 - exar_write_reg(priv, UART_EXAR_REGB, value); 299 - udelay(2); 300 - } 301 - 302 - static inline u8 exar_ee_read_bit(struct exar8250 *priv) 303 - { 304 - u8 regb; 305 - u8 value = UART_EXAR_REGB_EECS; 306 - 307 - // Clock in the bit on the EEPROM interface 308 - exar_write_reg(priv, UART_EXAR_REGB, value); 309 - // 2us delay = ~500khz clock speed 310 - udelay(2); 311 - 312 - value |= UART_EXAR_REGB_EECK; 313 - 314 - exar_write_reg(priv, UART_EXAR_REGB, value); 315 - udelay(2); 316 - 317 - regb = exar_read_reg(priv, UART_EXAR_REGB); 318 - 319 - return (regb & UART_EXAR_REGB_EEDO ? 1 : 0); 320 - } 321 - 322 - /** 323 - * exar_ee_read() - Read a word from the EEPROM 324 - * @priv: Device's private structure 325 - * @ee_addr: Offset of EEPROM to read word from 326 - * 327 - * Read a single 16bit word from an Exar UART's EEPROM. 328 - * The type of the EEPROM is AT93C46D. 329 - * 330 - * Return: EEPROM word 331 - */ 332 - static u16 exar_ee_read(struct exar8250 *priv, u8 ee_addr) 333 - { 334 - int i; 335 - u16 data = 0; 336 - 337 - exar_ee_select(priv); 338 - 339 - // Send read command (opcode 110) 340 - exar_ee_write_bit(priv, 1); 341 - exar_ee_write_bit(priv, 1); 342 - exar_ee_write_bit(priv, 0); 343 - 344 - // Send address to read from 345 - for (i = UART_EXAR_REGB_EE_ADDR_SIZE - 1; i >= 0; i--) 346 - exar_ee_write_bit(priv, ee_addr & BIT(i)); 347 - 348 - // Read data 1 bit at a time starting with a dummy bit 349 - for (i = UART_EXAR_REGB_EE_DATA_SIZE; i >= 0; i--) { 350 - if (exar_ee_read_bit(priv)) 351 - data |= BIT(i); 352 - } 353 - 354 - exar_ee_deselect(priv); 355 - 356 - return data; 357 271 } 358 272 359 273 static void exar_eeprom_93cx6_reg_read(struct eeprom_93cx6 *eeprom)