Skip to content

Commit

Permalink
usb: max-3421: Fix setting of I/O pins
Browse files Browse the repository at this point in the history
To update the I/O pins, the registers are read/modified/written. The
read operation incorrectly always read the first register. Although
wrong, there wasn't any impact as all the output pins are always
written, and the inputs are read only anyway.

Fixes: 2d53139 ("Add support for using a MAX3421E chip as a host driver.")
Signed-off-by: Mark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>
Link: https://lore.kernel.org/r/20230207033337.18112-1-mark.tomlinson@alliedtelesis.co.nz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Mark Tomlinson authored and Greg Kroah-Hartman committed Feb 7, 2023
1 parent 41070a7 commit a7efe3f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/host/max3421-hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1427,7 +1427,7 @@ max3421_spi_thread(void *dev_id)
* use spi_wr_buf().
*/
for (i = 0; i < ARRAY_SIZE(max3421_hcd->iopins); ++i) {
u8 val = spi_rd8(hcd, MAX3421_REG_IOPINS1);
u8 val = spi_rd8(hcd, MAX3421_REG_IOPINS1 + i);

val = ((val & 0xf0) |
(max3421_hcd->iopins[i] & 0x0f));
Expand Down

0 comments on commit a7efe3f

Please sign in to comment.