On 8/16/19 9:48 AM, Marc Kleine-Budde wrote: > On 5/9/19 6:11 PM, Dan Murphy wrote: >> +static int regmap_spi_gather_write(void *context, const void *reg, >> + size_t reg_len, const void *val, >> + size_t val_len) >> +{ >> + struct device *dev = context; >> + struct spi_device *spi = to_spi_device(dev); >> + struct spi_message m; >> + u32 addr; >> + struct spi_transfer t[2] = { >> + { .tx_buf = &addr, .len = reg_len, .cs_change = 0,}, >> + { .tx_buf = val, .len = val_len, }, >> + }; >> + >> + addr = TCAN4X5X_WRITE_CMD | (*((u16 *)reg) << 8) | val_len >> 3; > > Why do you shift the len by 3? This means division by 8, but AFAICS the > chip expects the number of words (32 bit) you want to read. I see. Can you please test "[PATCH] can: tcan4x5x: fix data length in regmap write path", that I've just send to the mailinglist. Marc -- Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
Attachment:
signature.asc
Description: OpenPGP digital signature