Marc
On 8/16/19 3:58 AM, Marc Kleine-Budde wrote:
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.
I will give it a test when I update the series for the interrupt binding
change.
Dan
Marc