Skip to content

Commit 6514127

Browse files
committed
Merge remote-tracking branch 'soundwire/next' into sound/upstream-20260722
2 parents 4f6c60f + 6409292 commit 6514127

5 files changed

Lines changed: 63 additions & 19 deletions

File tree

Documentation/devicetree/bindings/soundwire/qcom,soundwire.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ properties:
9090
or applicable for the respective data port.
9191
More info in MIPI Alliance SoundWire 1.0 Specifications.
9292
minItems: 3
93-
maxItems: 16
93+
maxItems: 17
9494

9595
qcom,ports-sinterval-low:
9696
$ref: /schemas/types.yaml#/definitions/uint8-array
@@ -101,7 +101,7 @@ properties:
101101
or applicable for the respective data port.
102102
More info in MIPI Alliance SoundWire 1.0 Specifications.
103103
minItems: 3
104-
maxItems: 16
104+
maxItems: 17
105105

106106
qcom,ports-sinterval:
107107
$ref: /schemas/types.yaml#/definitions/uint16-array
@@ -112,7 +112,7 @@ properties:
112112
or applicable for the respective data port.
113113
More info in MIPI Alliance SoundWire 1.0 Specifications.
114114
minItems: 3
115-
maxItems: 16
115+
maxItems: 17
116116

117117
qcom,ports-offset1:
118118
$ref: /schemas/types.yaml#/definitions/uint8-array
@@ -123,7 +123,7 @@ properties:
123123
or applicable for the respective data port.
124124
More info in MIPI Alliance SoundWire 1.0 Specifications.
125125
minItems: 3
126-
maxItems: 16
126+
maxItems: 17
127127

128128
qcom,ports-offset2:
129129
$ref: /schemas/types.yaml#/definitions/uint8-array
@@ -134,7 +134,7 @@ properties:
134134
or applicable for the respective data port.
135135
More info in MIPI Alliance SoundWire 1.0 Specifications.
136136
minItems: 3
137-
maxItems: 16
137+
maxItems: 17
138138

139139
qcom,ports-lane-control:
140140
$ref: /schemas/types.yaml#/definitions/uint8-array
@@ -145,7 +145,7 @@ properties:
145145
or applicable for the respective data port.
146146
More info in MIPI Alliance SoundWire 1.0 Specifications.
147147
minItems: 3
148-
maxItems: 16
148+
maxItems: 17
149149

150150
qcom,ports-block-pack-mode:
151151
$ref: /schemas/types.yaml#/definitions/uint8-array
@@ -158,7 +158,7 @@ properties:
158158
or applicable for the respective data port.
159159
More info in MIPI Alliance SoundWire 1.0 Specifications.
160160
minItems: 3
161-
maxItems: 16
161+
maxItems: 17
162162
items:
163163
oneOf:
164164
- minimum: 0
@@ -175,7 +175,7 @@ properties:
175175
or applicable for the respective data port.
176176
More info in MIPI Alliance SoundWire 1.0 Specifications.
177177
minItems: 3
178-
maxItems: 16
178+
maxItems: 17
179179
items:
180180
oneOf:
181181
- minimum: 0
@@ -192,7 +192,7 @@ properties:
192192
or applicable for the respective data port.
193193
More info in MIPI Alliance SoundWire 1.0 Specifications.
194194
minItems: 3
195-
maxItems: 16
195+
maxItems: 17
196196
items:
197197
oneOf:
198198
- minimum: 0
@@ -208,7 +208,7 @@ properties:
208208
or applicable for the respective data port.
209209
More info in MIPI Alliance SoundWire 1.0 Specifications.
210210
minItems: 3
211-
maxItems: 16
211+
maxItems: 17
212212
items:
213213
oneOf:
214214
- minimum: 0

drivers/soundwire/bus.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ struct sdw_msg {
7373
};
7474

7575
/**
76-
* struct sdw_btp_section - Message section structure
76+
* struct sdw_bpt_section - Message section structure
7777
* @addr: Start Register address accessed in the Slave
7878
* @len: number of bytes to transfer. More than 64Kb can be transferred
7979
* but a practical limit of SDW_BPT_MSG_MAX_BYTES is enforced.
@@ -87,7 +87,7 @@ struct sdw_bpt_section {
8787
};
8888

8989
/**
90-
* struct sdw_btp_msg - Message structure
90+
* struct sdw_bpt_msg - Message structure
9191
* @sec: Pointer to array of sections
9292
* @sections: Number of sections in the array
9393
* @dev_num: Slave device number
@@ -110,7 +110,7 @@ int sdw_find_row_index(int row);
110110
int sdw_find_col_index(int col);
111111

112112
/**
113-
* sdw_port_runtime: Runtime port parameters for Master or Slave
113+
* struct sdw_port_runtime - Runtime port parameters for Master or Slave
114114
*
115115
* @num: Port number. For audio streams, valid port number ranges from
116116
* [1,14]
@@ -133,7 +133,7 @@ struct sdw_port_runtime {
133133
};
134134

135135
/**
136-
* sdw_slave_runtime: Runtime Stream parameters for Slave
136+
* struct sdw_slave_runtime - Runtime Stream parameters for Slave
137137
*
138138
* @slave: Slave handle
139139
* @direction: Data direction for Slave
@@ -151,7 +151,7 @@ struct sdw_slave_runtime {
151151
};
152152

153153
/**
154-
* sdw_master_runtime: Runtime stream parameters for Master
154+
* struct sdw_master_runtime - Runtime stream parameters for Master
155155
*
156156
* @bus: Bus handle
157157
* @stream: Stream runtime handle

drivers/soundwire/dmi-quirks.c

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ struct adr_remap {
1515
u64 remapped_adr;
1616
};
1717

18+
static const struct adr_remap global_ghost_adr[] = {
19+
{
20+
0x000000D010010500ull,
21+
0x0000000000000000ull
22+
},
23+
{}
24+
};
25+
1826
/*
1927
* Some TigerLake devices based on an initial Intel BIOS do not expose
2028
* the correct _ADR in the DSDT.
@@ -178,6 +186,13 @@ static const struct dmi_system_id adr_remap_quirk_table[] = {
178186
.driver_data = (void *)hp_omen_16,
179187
},
180188
/* PTL devices */
189+
{
190+
.matches = {
191+
DMI_MATCH(DMI_SYS_VENDOR, "ASUS"),
192+
DMI_MATCH(DMI_BOARD_NAME, "B9406CAA"),
193+
},
194+
.driver_data = (void *)ghost_realtek,
195+
},
181196
{
182197
.matches = {
183198
DMI_MATCH(DMI_SYS_VENDOR, "ASUS"),
@@ -205,6 +220,7 @@ static const struct dmi_system_id adr_remap_quirk_table[] = {
205220
u64 sdw_dmi_override_adr(struct sdw_bus *bus, u64 addr)
206221
{
207222
const struct dmi_system_id *dmi_id;
223+
int i;
208224

209225
/* check if any address remap quirk applies */
210226
dmi_id = dmi_first_match(adr_remap_quirk_table);
@@ -216,10 +232,20 @@ u64 sdw_dmi_override_adr(struct sdw_bus *bus, u64 addr)
216232
dev_dbg(bus->dev, "remapped _ADR 0x%llx as 0x%llx\n",
217233
addr, map->remapped_adr);
218234
addr = map->remapped_adr;
219-
break;
235+
goto out;
220236
}
221237
}
222238
}
223239

240+
/* remap the ghost ADRs */
241+
for (i = 0; i < ARRAY_SIZE(global_ghost_adr); i++) {
242+
if (global_ghost_adr[i].adr == addr) {
243+
dev_dbg(bus->dev, "remapped _ADR 0x%llx as 0x%llx\n",
244+
addr, global_ghost_adr[i].remapped_adr);
245+
addr = global_ghost_adr[i].remapped_adr;
246+
break;
247+
}
248+
}
249+
out:
224250
return addr;
225251
}

drivers/soundwire/intel_auxdevice.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ static struct wake_capable_part wake_capable_list[] = {
5454
{0x01fa, 0x2A30},
5555
{0x01fa, 0x2A3B},
5656
{0x01fa, 0x4243},
57+
{0x01fa, 0x4244},
5758
{0x01fa, 0x4245},
5859
{0x01fa, 0x4249},
5960
{0x01fa, 0x4747},

drivers/soundwire/qcom.c

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@
134134
#define TIMEOUT_MS 100
135135
#define QCOM_SWRM_MAX_RD_LEN 0x1
136136
#define DEFAULT_CLK_FREQ 9600000
137-
#define SWRM_MAX_DAIS 0xF
138137
#define SWR_INVALID_PARAM 0xFF
139138
#define SWR_HSTOP_MAX_VAL 0xF
140139
#define SWR_HSTART_MIN_VAL 0x0
@@ -215,7 +214,7 @@ struct qcom_swrm_ctrl {
215214
u8 wcmd_id;
216215
/* Port numbers are 1 - 14 */
217216
struct qcom_swrm_port_config *pconfig;
218-
struct sdw_stream_runtime *sruntime[SWRM_MAX_DAIS];
217+
struct sdw_stream_runtime **sruntime;
219218
enum sdw_slave_status status[SDW_MAX_DEVICES + 1];
220219
int (*reg_read)(struct qcom_swrm_ctrl *ctrl, int reg, u32 *val);
221220
int (*reg_write)(struct qcom_swrm_ctrl *ctrl, int reg, int val);
@@ -976,6 +975,20 @@ static enum sdw_command_response qcom_swrm_xfer_msg(struct sdw_bus *bus,
976975
struct qcom_swrm_ctrl *ctrl = to_qcom_sdw(bus);
977976
int ret, i, len;
978977

978+
if (msg->page) {
979+
ret = qcom_swrm_cmd_fifo_wr_cmd(ctrl, msg->addr_page1,
980+
msg->dev_num,
981+
SDW_SCP_ADDRPAGE1);
982+
if (ret)
983+
return ret;
984+
985+
ret = qcom_swrm_cmd_fifo_wr_cmd(ctrl, msg->addr_page2,
986+
msg->dev_num,
987+
SDW_SCP_ADDRPAGE2);
988+
if (ret)
989+
return ret;
990+
}
991+
979992
if (msg->flags == SDW_MSG_FLAG_READ) {
980993
for (i = 0; i < msg->len;) {
981994
len = min(msg->len - i, QCOM_SWRM_MAX_RD_LEN);
@@ -1271,7 +1284,7 @@ static int qcom_swrm_stream_alloc_ports(struct qcom_swrm_ctrl *ctrl,
12711284
else
12721285
pn = find_first_zero_bit(port_mask, maxport);
12731286

1274-
if (pn > maxport) {
1287+
if (pn >= maxport) {
12751288
dev_err(ctrl->dev, "All ports busy\n");
12761289
return -EBUSY;
12771290
}
@@ -1384,6 +1397,10 @@ static int qcom_swrm_register_dais(struct qcom_swrm_ctrl *ctrl)
13841397
struct device *dev = ctrl->dev;
13851398
int i;
13861399

1400+
ctrl->sruntime = devm_kcalloc(dev, num_dais, sizeof(*ctrl->sruntime), GFP_KERNEL);
1401+
if (!ctrl->sruntime)
1402+
return -ENOMEM;
1403+
13871404
/* PDM dais are only tested for now */
13881405
dais = devm_kcalloc(dev, num_dais, sizeof(*dais), GFP_KERNEL);
13891406
if (!dais)

0 commit comments

Comments
 (0)