ASoC: wcd9xxx: Add wcd9320 codec slimbus slave support
Update slimbus slave driver to use updated address depending on discovered The wcd9320 Taiko codec introduced a new register address map to configure slimbus slave device. Change-Id: I41e9ebabd1d375a1904b6033e46736b2fb6365f9 Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
This commit is contained in:
committed by
Stephen Boyd
parent
a9f7f0ea55
commit
7ad053abe0
@@ -16,10 +16,6 @@
|
||||
#include <linux/slimbus/slimbus.h>
|
||||
#include <linux/mfd/wcd9xxx/core.h>
|
||||
|
||||
/* Local to the core only */
|
||||
#define SLIM_MAX_RX_PORTS 7
|
||||
#define SLIM_MAX_TX_PORTS 10
|
||||
|
||||
/* Channel numbers to be used for each port */
|
||||
enum {
|
||||
SLIM_TX_1 = 128,
|
||||
@@ -43,20 +39,43 @@ enum {
|
||||
};
|
||||
|
||||
/*
|
||||
* client is expected to give port ids in the range of 1-10 for Tx ports and
|
||||
* 1-7 for Rx ports, we need to add offset for getting the absolute slave
|
||||
* client is expected to give port ids in the range of
|
||||
* 1-10 for pre Taiko Tx ports and 1-16 for Taiko
|
||||
* 1-7 for pre Taiko Rx ports and 1-16 for Tako,
|
||||
* we need to add offset for getting the absolute slave
|
||||
* port id before configuring the HW
|
||||
*/
|
||||
#define SB_PGD_MAX_NUMBER_OF_TX_SLAVE_DEV_PORTS 10
|
||||
#define SB_PGD_OFFSET_OF_TX_SLAVE_DEV_PORTS -1
|
||||
#define SB_PGD_MAX_NUMBER_OF_RX_SLAVE_DEV_PORTS 7
|
||||
#define SB_PGD_OFFSET_OF_RX_SLAVE_DEV_PORTS 9
|
||||
#define TABLA_SB_PGD_MAX_NUMBER_OF_TX_SLAVE_DEV_PORTS 10
|
||||
#define TAIKO_SB_PGD_MAX_NUMBER_OF_TX_SLAVE_DEV_PORTS 16
|
||||
|
||||
#define SLIM_MAX_TX_PORTS TAIKO_SB_PGD_MAX_NUMBER_OF_TX_SLAVE_DEV_PORTS
|
||||
|
||||
#define TABLA_SB_PGD_OFFSET_OF_RX_SLAVE_DEV_PORTS \
|
||||
TABLA_SB_PGD_MAX_NUMBER_OF_TX_SLAVE_DEV_PORTS
|
||||
#define TAIKO_SB_PGD_OFFSET_OF_RX_SLAVE_DEV_PORTS \
|
||||
TAIKO_SB_PGD_MAX_NUMBER_OF_TX_SLAVE_DEV_PORTS
|
||||
|
||||
#define TABLA_SB_PGD_MAX_NUMBER_OF_RX_SLAVE_DEV_PORTS 7
|
||||
#define TAIKO_SB_PGD_MAX_NUMBER_OF_RX_SLAVE_DEV_PORTS 13
|
||||
|
||||
#define SLIM_MAX_RX_PORTS TAIKO_SB_PGD_MAX_NUMBER_OF_RX_SLAVE_DEV_PORTS
|
||||
|
||||
#define TABLA_SB_PGD_RX_PORT_MULTI_CHANNEL_0_START_PORT_ID \
|
||||
TABLA_SB_PGD_OFFSET_OF_RX_SLAVE_DEV_PORTS
|
||||
#define TAIKO_SB_PGD_RX_PORT_MULTI_CHANNEL_0_START_PORT_ID \
|
||||
TAIKO_SB_PGD_OFFSET_OF_RX_SLAVE_DEV_PORTS
|
||||
|
||||
#define TABLA_SB_PGD_RX_PORT_MULTI_CHANNEL_0_END_PORT_ID 16
|
||||
#define TAIKO_SB_PGD_RX_PORT_MULTI_CHANNEL_0_END_PORT_ID 31
|
||||
|
||||
#define TABLA_SB_PGD_TX_PORT_MULTI_CHANNEL_1_END_PORT_ID 9
|
||||
#define TAIKO_SB_PGD_TX_PORT_MULTI_CHANNEL_1_END_PORT_ID 15
|
||||
|
||||
/* below details are taken from SLIMBUS slave SWI */
|
||||
#define SB_PGD_PORT_BASE 0x000
|
||||
|
||||
#define SB_PGD_PORT_CFG_BYTE_ADDR(port_num) \
|
||||
(SB_PGD_PORT_BASE + 0x040 + 1*port_num)
|
||||
#define SB_PGD_PORT_CFG_BYTE_ADDR(offset, port_num) \
|
||||
(SB_PGD_PORT_BASE + offset + (1 * port_num))
|
||||
|
||||
#define SB_PGD_TX_PORT_MULTI_CHANNEL_0(port_num) \
|
||||
(SB_PGD_PORT_BASE + 0x100 + 4*port_num)
|
||||
@@ -66,12 +85,9 @@ enum {
|
||||
#define SB_PGD_TX_PORT_MULTI_CHANNEL_1(port_num) \
|
||||
(SB_PGD_PORT_BASE + 0x101 + 4*port_num)
|
||||
#define SB_PGD_TX_PORT_MULTI_CHANNEL_1_START_PORT_ID 8
|
||||
#define SB_PGD_TX_PORT_MULTI_CHANNEL_1_END_PORT_ID 9
|
||||
|
||||
#define SB_PGD_RX_PORT_MULTI_CHANNEL_0(port_num) \
|
||||
(SB_PGD_PORT_BASE + 0x180 + 4*port_num)
|
||||
#define SB_PGD_RX_PORT_MULTI_CHANNEL_0_START_PORT_ID 10
|
||||
#define SB_PGD_RX_PORT_MULTI_CHANNEL_0_END_PORT_ID 16
|
||||
#define SB_PGD_RX_PORT_MULTI_CHANNEL_0(offset, port_num) \
|
||||
(SB_PGD_PORT_BASE + offset + (4 * port_num))
|
||||
|
||||
/* slave port water mark level
|
||||
* (0: 6bytes, 1: 9bytes, 2: 12 bytes, 3: 15 bytes)
|
||||
|
||||
Reference in New Issue
Block a user