Re: [PATCH v12 4/5] can: tcan4x5x: Add tcan4x5x driver to the kernel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux