1 /* SPDX-License-Identifier: GPL-2.0
3 * tcan4x5x - Texas Instruments TCAN4x5x Family CAN controller driver
5 * Copyright (c) 2020 Pengutronix,
12 #include <linux/gpio/consumer.h>
13 #include <linux/regmap.h>
14 #include <linux/regulator/consumer.h>
15 #include <linux/spi/spi.h>
19 #define TCAN4X5X_SANITIZE_SPI 1
21 struct __packed tcan4x5x_buf_cmd {
27 struct tcan4x5x_map_buf {
28 struct tcan4x5x_buf_cmd cmd;
29 u8 data[256 * sizeof(u32)];
30 } ____cacheline_aligned;
32 struct tcan4x5x_priv {
33 struct m_can_classdev cdev;
35 struct regmap *regmap;
36 struct spi_device *spi;
38 struct gpio_desc *reset_gpio;
39 struct gpio_desc *device_wake_gpio;
40 struct gpio_desc *device_state_gpio;
41 struct regulator *power;
43 struct tcan4x5x_map_buf map_buf_rx;
44 struct tcan4x5x_map_buf map_buf_tx;
48 tcan4x5x_spi_cmd_set_len(struct tcan4x5x_buf_cmd *cmd, u8 len)
54 int tcan4x5x_regmap_init(struct tcan4x5x_priv *priv);