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

i2c: octeon: remove 10-bit addressing support

The driver gives the illusion of 10-bit address support, but the upper
3 bits of the given address are always thrown away. Remove unnecessary
considerations for 10 bit addressing and always complete 7 bit ops when
using the hlc methods.

Signed-off-by: Aryan Srivastava <aryan.srivastava@alliedtelesis.co.nz>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://lore.kernel.org/r/20250318021632.2710792-3-aryan.srivastava@alliedtelesis.co.nz
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>

authored by

Aryan Srivastava and committed by
Andi Shyti
b1c010bd 7202745e

+4 -19
+4 -19
drivers/i2c/busses/i2c-octeon-core.c
··· 421 421 octeon_i2c_hlc_enable(i2c); 422 422 octeon_i2c_hlc_int_clear(i2c); 423 423 424 - cmd = SW_TWSI_V | SW_TWSI_R | SW_TWSI_SOVR; 424 + cmd = SW_TWSI_V | SW_TWSI_R | SW_TWSI_SOVR | SW_TWSI_OP_7; 425 425 /* SIZE */ 426 426 cmd |= (u64)(msgs[0].len - 1) << SW_TWSI_SIZE_SHIFT; 427 427 /* A */ 428 428 cmd |= (u64)(msgs[0].addr & 0x7full) << SW_TWSI_ADDR_SHIFT; 429 - 430 - if (msgs[0].flags & I2C_M_TEN) 431 - cmd |= SW_TWSI_OP_10; 432 - else 433 - cmd |= SW_TWSI_OP_7; 434 429 435 430 octeon_i2c_writeq_flush(cmd, i2c->twsi_base + OCTEON_REG_SW_TWSI(i2c)); 436 431 ret = octeon_i2c_hlc_wait(i2c); ··· 458 463 octeon_i2c_hlc_enable(i2c); 459 464 octeon_i2c_hlc_int_clear(i2c); 460 465 461 - cmd = SW_TWSI_V | SW_TWSI_SOVR; 466 + cmd = SW_TWSI_V | SW_TWSI_SOVR | SW_TWSI_OP_7; 462 467 /* SIZE */ 463 468 cmd |= (u64)(msgs[0].len - 1) << SW_TWSI_SIZE_SHIFT; 464 469 /* A */ 465 470 cmd |= (u64)(msgs[0].addr & 0x7full) << SW_TWSI_ADDR_SHIFT; 466 - 467 - if (msgs[0].flags & I2C_M_TEN) 468 - cmd |= SW_TWSI_OP_10; 469 - else 470 - cmd |= SW_TWSI_OP_7; 471 471 472 472 for (i = 0, j = msgs[0].len - 1; i < msgs[0].len && i < 4; i++, j--) 473 473 cmd |= (u64)msgs[0].buf[j] << (8 * i); ··· 503 513 bool set_ext = false; 504 514 u64 cmd = 0; 505 515 506 - if (msg.flags & I2C_M_TEN) 507 - cmd |= SW_TWSI_OP_10_IA; 508 - else 509 - cmd |= SW_TWSI_OP_7_IA; 510 - 511 516 if (msg.len == 2) { 512 517 cmd |= SW_TWSI_EIA; 513 518 *ext = (u64)msg.buf[0] << SW_TWSI_IA_SHIFT; ··· 535 550 536 551 octeon_i2c_hlc_enable(i2c); 537 552 538 - cmd = SW_TWSI_V | SW_TWSI_R | SW_TWSI_SOVR; 553 + cmd = SW_TWSI_V | SW_TWSI_R | SW_TWSI_SOVR | SW_TWSI_OP_7_IA; 539 554 /* SIZE */ 540 555 cmd |= (u64)(msgs[1].len - 1) << SW_TWSI_SIZE_SHIFT; 541 556 /* A */ ··· 572 587 573 588 octeon_i2c_hlc_enable(i2c); 574 589 575 - cmd = SW_TWSI_V | SW_TWSI_SOVR; 590 + cmd = SW_TWSI_V | SW_TWSI_SOVR | SW_TWSI_OP_7_IA; 576 591 /* SIZE */ 577 592 cmd |= (u64)(msgs[1].len - 1) << SW_TWSI_SIZE_SHIFT; 578 593 /* A */