Skip to content

Commit 904ad93

Browse files
authored
Merge pull request thesofproject#4200 from plbossart/sdw/intel-shim2
SoundWire: add support for ACE2.x
2 parents 93c60ab + 9e3bd69 commit 904ad93

12 files changed

Lines changed: 711 additions & 11 deletions

File tree

drivers/soundwire/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ soundwire-cadence-y := cadence_master.o
2020
obj-$(CONFIG_SOUNDWIRE_CADENCE) += soundwire-cadence.o
2121

2222
#Intel driver
23-
soundwire-intel-y := intel.o intel_auxdevice.o intel_init.o dmi-quirks.o \
23+
soundwire-intel-y := intel.o intel_ace2x.o intel_ace2x_debugfs.o \
24+
intel_auxdevice.o intel_init.o dmi-quirks.o \
2425
intel_bus_common.o
2526
obj-$(CONFIG_SOUNDWIRE_INTEL) += soundwire-intel.o
2627

drivers/soundwire/bus.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,9 @@ static int sdw_assign_device_num(struct sdw_slave *slave)
716716
/* After xfer of msg, restore dev_num */
717717
slave->dev_num = slave->dev_num_sticky;
718718

719+
if (bus->ops && bus->ops->new_peripheral_assigned)
720+
bus->ops->new_peripheral_assigned(bus, dev_num);
721+
719722
return 0;
720723
}
721724

drivers/soundwire/cadence_master.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
*/
1515
#define CDNS_MCP_IP_MAX_CMD_LEN 32
1616

17+
#define SDW_CADENCE_MCP_IP_OFFSET 0x4000
18+
1719
/**
1820
* struct sdw_cdns_pdi: PDI (Physical Data Interface) instance
1921
*

drivers/soundwire/intel.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@
44
#ifndef __SDW_INTEL_LOCAL_H
55
#define __SDW_INTEL_LOCAL_H
66

7+
struct hdac_bus;
8+
79
/**
810
* struct sdw_intel_link_res - Soundwire Intel link resource structure,
911
* typically populated by the controller driver.
1012
* @hw_ops: platform-specific ops
1113
* @mmio_base: mmio base of SoundWire registers
1214
* @registers: Link IO registers base
15+
* @ip_offset: offset for MCP_IP registers
1316
* @shim: Audio shim pointer
17+
* @shim_vs: Audio vendor-specific shim pointer
1418
* @alh: ALH (Audio Link Hub) pointer
1519
* @irq: Interrupt line
1620
* @ops: Shim callback ops
@@ -21,13 +25,16 @@
2125
* @link_mask: global mask needed for power-up/down sequences
2226
* @cdns: Cadence master descriptor
2327
* @list: used to walk-through all masters exposed by the same controller
28+
* @hbus: hdac_bus pointer, needed for power management
2429
*/
2530
struct sdw_intel_link_res {
2631
const struct sdw_intel_hw_ops *hw_ops;
2732

2833
void __iomem *mmio_base; /* not strictly needed, useful for debug */
2934
void __iomem *registers;
35+
u32 ip_offset;
3036
void __iomem *shim;
37+
void __iomem *shim_vs;
3138
void __iomem *alh;
3239
int irq;
3340
const struct sdw_intel_ops *ops;
@@ -38,6 +45,7 @@ struct sdw_intel_link_res {
3845
u32 link_mask;
3946
struct sdw_cdns *cdns;
4047
struct list_head list;
48+
struct hdac_bus *hbus;
4149
};
4250

4351
struct sdw_intel {
@@ -87,6 +95,14 @@ static inline void intel_writew(void __iomem *base, int offset, u16 value)
8795
(sdw)->link_res->hw_ops->cb)
8896
#define SDW_INTEL_OPS(sdw, cb) ((sdw)->link_res->hw_ops->cb)
8997

98+
#ifdef CONFIG_DEBUG_FS
99+
void intel_ace2x_debugfs_init(struct sdw_intel *sdw);
100+
void intel_ace2x_debugfs_exit(struct sdw_intel *sdw);
101+
#else
102+
static inline void intel_ace2x_debugfs_init(struct sdw_intel *sdw) {}
103+
static inline void intel_ace2x_debugfs_exit(struct sdw_intel *sdw) {}
104+
#endif
105+
90106
static inline void sdw_intel_debugfs_init(struct sdw_intel *sdw)
91107
{
92108
if (SDW_INTEL_CHECK_OPS(sdw, debugfs_init))

0 commit comments

Comments
 (0)