Skip to content

Commit a640aca

Browse files
crojewsk-intelrafaeljw
authored andcommitted
ACPI: NHLT: Streamline struct naming
Few recently introduced structs are named 'nhlt2' instead of 'nhlt' to avoid naming conflicts. With duplicate types gone, the conflicts are no more. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 659a949 commit a640aca

File tree

3 files changed

+52
-52
lines changed

3 files changed

+52
-52
lines changed

drivers/acpi/nhlt.c

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
#include <linux/types.h>
1717
#include <acpi/nhlt.h>
1818

19-
static struct acpi_table_nhlt2 *acpi_gbl_nhlt;
19+
static struct acpi_table_nhlt *acpi_gbl_nhlt;
2020

21-
static struct acpi_table_nhlt2 empty_nhlt = {
21+
static struct acpi_table_nhlt empty_nhlt = {
2222
.header = {
2323
.signature = ACPI_SIG_NHLT,
2424
},
@@ -65,7 +65,7 @@ EXPORT_SYMBOL_GPL(acpi_nhlt_put_gbl_table);
6565
*
6666
* Return: %true if endpoint matches specified criteria or %false otherwise.
6767
*/
68-
bool acpi_nhlt_endpoint_match(const struct acpi_nhlt2_endpoint *ep,
68+
bool acpi_nhlt_endpoint_match(const struct acpi_nhlt_endpoint *ep,
6969
int link_type, int dev_type, int dir, int bus_id)
7070
{
7171
return ep &&
@@ -90,11 +90,11 @@ EXPORT_SYMBOL_GPL(acpi_nhlt_endpoint_match);
9090
* Return: A pointer to endpoint matching the criteria, %NULL if not found or
9191
* an ERR_PTR() otherwise.
9292
*/
93-
struct acpi_nhlt2_endpoint *
94-
acpi_nhlt_tb_find_endpoint(const struct acpi_table_nhlt2 *tb,
93+
struct acpi_nhlt_endpoint *
94+
acpi_nhlt_tb_find_endpoint(const struct acpi_table_nhlt *tb,
9595
int link_type, int dev_type, int dir, int bus_id)
9696
{
97-
struct acpi_nhlt2_endpoint *ep;
97+
struct acpi_nhlt_endpoint *ep;
9898

9999
for_each_nhlt_endpoint(tb, ep)
100100
if (acpi_nhlt_endpoint_match(ep, link_type, dev_type, dir, bus_id))
@@ -116,7 +116,7 @@ EXPORT_SYMBOL_GPL(acpi_nhlt_tb_find_endpoint);
116116
* Return: A pointer to endpoint matching the criteria, %NULL if not found or
117117
* an ERR_PTR() otherwise.
118118
*/
119-
struct acpi_nhlt2_endpoint *
119+
struct acpi_nhlt_endpoint *
120120
acpi_nhlt_find_endpoint(int link_type, int dev_type, int dir, int bus_id)
121121
{
122122
/* TODO: Currently limited to table of index 0. */
@@ -136,12 +136,12 @@ EXPORT_SYMBOL_GPL(acpi_nhlt_find_endpoint);
136136
* Return: A pointer to format matching the criteria, %NULL if not found or
137137
* an ERR_PTR() otherwise.
138138
*/
139-
struct acpi_nhlt2_format_config *
140-
acpi_nhlt_endpoint_find_fmtcfg(const struct acpi_nhlt2_endpoint *ep,
139+
struct acpi_nhlt_format_config *
140+
acpi_nhlt_endpoint_find_fmtcfg(const struct acpi_nhlt_endpoint *ep,
141141
u16 ch, u32 rate, u16 vbps, u16 bps)
142142
{
143-
struct acpi_nhlt2_wave_formatext *wav;
144-
struct acpi_nhlt2_format_config *fmt;
143+
struct acpi_nhlt_wave_formatext *wav;
144+
struct acpi_nhlt_format_config *fmt;
145145

146146
for_each_nhlt_endpoint_fmtcfg(ep, fmt) {
147147
wav = &fmt->format;
@@ -176,13 +176,13 @@ EXPORT_SYMBOL_GPL(acpi_nhlt_endpoint_find_fmtcfg);
176176
* Return: A pointer to format matching the criteria, %NULL if not found or
177177
* an ERR_PTR() otherwise.
178178
*/
179-
struct acpi_nhlt2_format_config *
180-
acpi_nhlt_tb_find_fmtcfg(const struct acpi_table_nhlt2 *tb,
179+
struct acpi_nhlt_format_config *
180+
acpi_nhlt_tb_find_fmtcfg(const struct acpi_table_nhlt *tb,
181181
int link_type, int dev_type, int dir, int bus_id,
182182
u16 ch, u32 rate, u16 vbps, u16 bps)
183183
{
184-
struct acpi_nhlt2_format_config *fmt;
185-
struct acpi_nhlt2_endpoint *ep;
184+
struct acpi_nhlt_format_config *fmt;
185+
struct acpi_nhlt_endpoint *ep;
186186

187187
for_each_nhlt_endpoint(tb, ep) {
188188
if (!acpi_nhlt_endpoint_match(ep, link_type, dev_type, dir, bus_id))
@@ -215,7 +215,7 @@ EXPORT_SYMBOL_GPL(acpi_nhlt_tb_find_fmtcfg);
215215
* Return: A pointer to format matching the criteria, %NULL if not found or
216216
* an ERR_PTR() otherwise.
217217
*/
218-
struct acpi_nhlt2_format_config *
218+
struct acpi_nhlt_format_config *
219219
acpi_nhlt_find_fmtcfg(int link_type, int dev_type, int dir, int bus_id,
220220
u16 ch, u32 rate, u16 vbps, u16 bps)
221221
{
@@ -244,10 +244,10 @@ static bool acpi_nhlt_config_is_vendor_micdevice(struct acpi_nhlt_config *cfg)
244244
*
245245
* Return: A number of microphones or an error code if an invalid endpoint is provided.
246246
*/
247-
int acpi_nhlt_endpoint_mic_count(const struct acpi_nhlt2_endpoint *ep)
247+
int acpi_nhlt_endpoint_mic_count(const struct acpi_nhlt_endpoint *ep)
248248
{
249249
union acpi_nhlt_device_config *devcfg;
250-
struct acpi_nhlt2_format_config *fmt;
250+
struct acpi_nhlt_format_config *fmt;
251251
struct acpi_nhlt_config *cfg;
252252
u16 max_ch = 0;
253253

include/acpi/actbl2.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1894,7 +1894,7 @@ struct nfit_device_handle {
18941894
*
18951895
******************************************************************************/
18961896

1897-
struct acpi_table_nhlt2 {
1897+
struct acpi_table_nhlt {
18981898
struct acpi_table_header header; /* Common ACPI table header */
18991899
u8 endpoints_count;
19001900
/*
@@ -1903,7 +1903,7 @@ struct acpi_table_nhlt2 {
19031903
*/
19041904
};
19051905

1906-
struct acpi_nhlt2_endpoint {
1906+
struct acpi_nhlt_endpoint {
19071907
u32 length;
19081908
u8 link_type;
19091909
u8 instance_id;
@@ -1990,7 +1990,7 @@ struct acpi_nhlt_micdevice_config {
19901990
#define ACPI_NHLT_ARRAYTYPE_LINEAR4_GEO2 0xE
19911991
#define ACPI_NHLT_ARRAYTYPE_VENDOR 0xF
19921992

1993-
struct acpi_nhlt2_vendor_mic_config {
1993+
struct acpi_nhlt_vendor_mic_config {
19941994
u8 type;
19951995
u8 panel;
19961996
u16 speaker_position_distance; /* mm */
@@ -2031,7 +2031,7 @@ struct acpi_nhlt_vendor_micdevice_config {
20312031
u8 config_type;
20322032
u8 array_type;
20332033
u8 mics_count;
2034-
struct acpi_nhlt2_vendor_mic_config mics[];
2034+
struct acpi_nhlt_vendor_mic_config mics[];
20352035
};
20362036

20372037
union acpi_nhlt_device_config {
@@ -2042,7 +2042,7 @@ union acpi_nhlt_device_config {
20422042
};
20432043

20442044
/* Inherited from Microsoft's WAVEFORMATEXTENSIBLE. */
2045-
struct acpi_nhlt2_wave_formatext {
2045+
struct acpi_nhlt_wave_formatext {
20462046
u16 format_tag;
20472047
u16 channel_count;
20482048
u32 samples_per_sec;
@@ -2055,25 +2055,25 @@ struct acpi_nhlt2_wave_formatext {
20552055
u8 subformat[16];
20562056
};
20572057

2058-
struct acpi_nhlt2_format_config {
2059-
struct acpi_nhlt2_wave_formatext format;
2058+
struct acpi_nhlt_format_config {
2059+
struct acpi_nhlt_wave_formatext format;
20602060
struct acpi_nhlt_config config;
20612061
};
20622062

2063-
struct acpi_nhlt2_formats_config {
2063+
struct acpi_nhlt_formats_config {
20642064
u8 formats_count;
2065-
struct acpi_nhlt2_format_config formats[];
2065+
struct acpi_nhlt_format_config formats[];
20662066
};
20672067

2068-
struct acpi_nhlt2_device_info {
2068+
struct acpi_nhlt_device_info {
20692069
u8 id[16];
20702070
u8 instance_id;
20712071
u8 port_id;
20722072
};
20732073

20742074
struct acpi_nhlt_devices_info {
20752075
u8 devices_count;
2076-
struct acpi_nhlt2_device_info devices[];
2076+
struct acpi_nhlt_device_info devices[];
20772077
};
20782078

20792079
/*******************************************************************************

include/acpi/nhlt.h

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
*
2424
* Return: A pointer to the formats configuration space.
2525
*/
26-
static inline struct acpi_nhlt2_formats_config *
27-
acpi_nhlt_endpoint_fmtscfg(const struct acpi_nhlt2_endpoint *ep)
26+
static inline struct acpi_nhlt_formats_config *
27+
acpi_nhlt_endpoint_fmtscfg(const struct acpi_nhlt_endpoint *ep)
2828
{
2929
struct acpi_nhlt_config *cfg = __acpi_nhlt_endpoint_config(ep);
3030

31-
return (struct acpi_nhlt2_formats_config *)((u8 *)(cfg + 1) + cfg->capabilities_size);
31+
return (struct acpi_nhlt_formats_config *)((u8 *)(cfg + 1) + cfg->capabilities_size);
3232
}
3333

3434
#define __acpi_nhlt_first_endpoint(tb) \
@@ -99,24 +99,24 @@ acpi_nhlt_endpoint_fmtscfg(const struct acpi_nhlt2_endpoint *ep)
9999
acpi_status acpi_nhlt_get_gbl_table(void);
100100
void acpi_nhlt_put_gbl_table(void);
101101

102-
bool acpi_nhlt_endpoint_match(const struct acpi_nhlt2_endpoint *ep,
102+
bool acpi_nhlt_endpoint_match(const struct acpi_nhlt_endpoint *ep,
103103
int link_type, int dev_type, int dir, int bus_id);
104-
struct acpi_nhlt2_endpoint *
105-
acpi_nhlt_tb_find_endpoint(const struct acpi_table_nhlt2 *tb,
104+
struct acpi_nhlt_endpoint *
105+
acpi_nhlt_tb_find_endpoint(const struct acpi_table_nhlt *tb,
106106
int link_type, int dev_type, int dir, int bus_id);
107-
struct acpi_nhlt2_endpoint *
107+
struct acpi_nhlt_endpoint *
108108
acpi_nhlt_find_endpoint(int link_type, int dev_type, int dir, int bus_id);
109-
struct acpi_nhlt2_format_config *
110-
acpi_nhlt_endpoint_find_fmtcfg(const struct acpi_nhlt2_endpoint *ep,
109+
struct acpi_nhlt_format_config *
110+
acpi_nhlt_endpoint_find_fmtcfg(const struct acpi_nhlt_endpoint *ep,
111111
u16 ch, u32 rate, u16 vbps, u16 bps);
112-
struct acpi_nhlt2_format_config *
113-
acpi_nhlt_tb_find_fmtcfg(const struct acpi_table_nhlt2 *tb,
112+
struct acpi_nhlt_format_config *
113+
acpi_nhlt_tb_find_fmtcfg(const struct acpi_table_nhlt *tb,
114114
int link_type, int dev_type, int dir, int bus_id,
115115
u16 ch, u32 rate, u16 vpbs, u16 bps);
116-
struct acpi_nhlt2_format_config *
116+
struct acpi_nhlt_format_config *
117117
acpi_nhlt_find_fmtcfg(int link_type, int dev_type, int dir, int bus_id,
118118
u16 ch, u32 rate, u16 vpbs, u16 bps);
119-
int acpi_nhlt_endpoint_mic_count(const struct acpi_nhlt2_endpoint *ep);
119+
int acpi_nhlt_endpoint_mic_count(const struct acpi_nhlt_endpoint *ep);
120120

121121
#else /* !CONFIG_ACPI_NHLT */
122122

@@ -130,46 +130,46 @@ static inline void acpi_nhlt_put_gbl_table(void)
130130
}
131131

132132
static inline bool
133-
acpi_nhlt_endpoint_match(const struct acpi_nhlt2_endpoint *ep,
133+
acpi_nhlt_endpoint_match(const struct acpi_nhlt_endpoint *ep,
134134
int link_type, int dev_type, int dir, int bus_id)
135135
{
136136
return false;
137137
}
138138

139-
static inline struct acpi_nhlt2_endpoint *
140-
acpi_nhlt_tb_find_endpoint(const struct acpi_table_nhlt2 *tb,
139+
static inline struct acpi_nhlt_endpoint *
140+
acpi_nhlt_tb_find_endpoint(const struct acpi_table_nhlt *tb,
141141
int link_type, int dev_type, int dir, int bus_id)
142142
{
143143
return NULL;
144144
}
145145

146-
static inline struct acpi_nhlt2_format_config *
147-
acpi_nhlt_endpoint_find_fmtcfg(const struct acpi_nhlt2_endpoint *ep,
146+
static inline struct acpi_nhlt_format_config *
147+
acpi_nhlt_endpoint_find_fmtcfg(const struct acpi_nhlt_endpoint *ep,
148148
u16 ch, u32 rate, u16 vbps, u16 bps)
149149
{
150150
return NULL;
151151
}
152152

153-
static inline struct acpi_nhlt2_format_config *
154-
acpi_nhlt_tb_find_fmtcfg(const struct acpi_table_nhlt2 *tb,
153+
static inline struct acpi_nhlt_format_config *
154+
acpi_nhlt_tb_find_fmtcfg(const struct acpi_table_nhlt *tb,
155155
int link_type, int dev_type, int dir, int bus_id,
156156
u16 ch, u32 rate, u16 vpbs, u16 bps)
157157
{
158158
return NULL;
159159
}
160160

161-
static inline int acpi_nhlt_endpoint_mic_count(const struct acpi_nhlt2_endpoint *ep)
161+
static inline int acpi_nhlt_endpoint_mic_count(const struct acpi_nhlt_endpoint *ep)
162162
{
163163
return 0;
164164
}
165165

166-
static inline struct acpi_nhlt2_endpoint *
166+
static inline struct acpi_nhlt_endpoint *
167167
acpi_nhlt_find_endpoint(int link_type, int dev_type, int dir, int bus_id)
168168
{
169169
return NULL;
170170
}
171171

172-
static inline struct acpi_nhlt2_format_config *
172+
static inline struct acpi_nhlt_format_config *
173173
acpi_nhlt_find_fmtcfg(int link_type, int dev_type, int dir, int bus_id,
174174
u16 ch, u32 rate, u16 vpbs, u16 bps)
175175
{

0 commit comments

Comments
 (0)