hc
2024-05-14 bedbef8ad3e75a304af6361af235302bcc61d06b
kernel/drivers/soundwire/cadence_master.h
....@@ -8,6 +8,12 @@
88 #define SDW_CADENCE_GSYNC_KHZ 4 /* 4 kHz */
99 #define SDW_CADENCE_GSYNC_HZ (SDW_CADENCE_GSYNC_KHZ * 1000)
1010
11
+/*
12
+ * The Cadence IP supports up to 32 entries in the FIFO, though implementations
13
+ * can configure the IP to have a smaller FIFO.
14
+ */
15
+#define CDNS_MCP_IP_MAX_CMD_LEN 32
16
+
1117 /**
1218 * struct sdw_cdns_pdi: PDI (Physical Data Interface) instance
1319 *
....@@ -119,7 +125,12 @@
119125 struct sdw_bus bus;
120126 unsigned int instance;
121127
122
- u32 response_buf[0x80];
128
+ /*
129
+ * The datasheet says the RX FIFO AVAIL can be 2 entries more
130
+ * than the FIFO capacity, so allow for this.
131
+ */
132
+ u32 response_buf[CDNS_MCP_IP_MAX_CMD_LEN + 2];
133
+
123134 struct completion tx_complete;
124135 struct sdw_defer *defer;
125136