Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Cezary Rojewski and committed by
Rafael J. Wysocki
a640acab 659a9490

+52 -52
+18 -18
drivers/acpi/nhlt.c
··· 16 16 #include <linux/types.h> 17 17 #include <acpi/nhlt.h> 18 18 19 - static struct acpi_table_nhlt2 *acpi_gbl_nhlt; 19 + static struct acpi_table_nhlt *acpi_gbl_nhlt; 20 20 21 - static struct acpi_table_nhlt2 empty_nhlt = { 21 + static struct acpi_table_nhlt empty_nhlt = { 22 22 .header = { 23 23 .signature = ACPI_SIG_NHLT, 24 24 }, ··· 65 65 * 66 66 * Return: %true if endpoint matches specified criteria or %false otherwise. 67 67 */ 68 - bool acpi_nhlt_endpoint_match(const struct acpi_nhlt2_endpoint *ep, 68 + bool acpi_nhlt_endpoint_match(const struct acpi_nhlt_endpoint *ep, 69 69 int link_type, int dev_type, int dir, int bus_id) 70 70 { 71 71 return ep && ··· 90 90 * Return: A pointer to endpoint matching the criteria, %NULL if not found or 91 91 * an ERR_PTR() otherwise. 92 92 */ 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, 95 95 int link_type, int dev_type, int dir, int bus_id) 96 96 { 97 - struct acpi_nhlt2_endpoint *ep; 97 + struct acpi_nhlt_endpoint *ep; 98 98 99 99 for_each_nhlt_endpoint(tb, ep) 100 100 if (acpi_nhlt_endpoint_match(ep, link_type, dev_type, dir, bus_id)) ··· 116 116 * Return: A pointer to endpoint matching the criteria, %NULL if not found or 117 117 * an ERR_PTR() otherwise. 118 118 */ 119 - struct acpi_nhlt2_endpoint * 119 + struct acpi_nhlt_endpoint * 120 120 acpi_nhlt_find_endpoint(int link_type, int dev_type, int dir, int bus_id) 121 121 { 122 122 /* TODO: Currently limited to table of index 0. */ ··· 136 136 * Return: A pointer to format matching the criteria, %NULL if not found or 137 137 * an ERR_PTR() otherwise. 138 138 */ 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, 141 141 u16 ch, u32 rate, u16 vbps, u16 bps) 142 142 { 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; 145 145 146 146 for_each_nhlt_endpoint_fmtcfg(ep, fmt) { 147 147 wav = &fmt->format; ··· 176 176 * Return: A pointer to format matching the criteria, %NULL if not found or 177 177 * an ERR_PTR() otherwise. 178 178 */ 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, 181 181 int link_type, int dev_type, int dir, int bus_id, 182 182 u16 ch, u32 rate, u16 vbps, u16 bps) 183 183 { 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; 186 186 187 187 for_each_nhlt_endpoint(tb, ep) { 188 188 if (!acpi_nhlt_endpoint_match(ep, link_type, dev_type, dir, bus_id)) ··· 215 215 * Return: A pointer to format matching the criteria, %NULL if not found or 216 216 * an ERR_PTR() otherwise. 217 217 */ 218 - struct acpi_nhlt2_format_config * 218 + struct acpi_nhlt_format_config * 219 219 acpi_nhlt_find_fmtcfg(int link_type, int dev_type, int dir, int bus_id, 220 220 u16 ch, u32 rate, u16 vbps, u16 bps) 221 221 { ··· 244 244 * 245 245 * Return: A number of microphones or an error code if an invalid endpoint is provided. 246 246 */ 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) 248 248 { 249 249 union acpi_nhlt_device_config *devcfg; 250 - struct acpi_nhlt2_format_config *fmt; 250 + struct acpi_nhlt_format_config *fmt; 251 251 struct acpi_nhlt_config *cfg; 252 252 u16 max_ch = 0; 253 253
+11 -11
include/acpi/actbl2.h
··· 1894 1894 * 1895 1895 ******************************************************************************/ 1896 1896 1897 - struct acpi_table_nhlt2 { 1897 + struct acpi_table_nhlt { 1898 1898 struct acpi_table_header header; /* Common ACPI table header */ 1899 1899 u8 endpoints_count; 1900 1900 /* ··· 1903 1903 */ 1904 1904 }; 1905 1905 1906 - struct acpi_nhlt2_endpoint { 1906 + struct acpi_nhlt_endpoint { 1907 1907 u32 length; 1908 1908 u8 link_type; 1909 1909 u8 instance_id; ··· 1990 1990 #define ACPI_NHLT_ARRAYTYPE_LINEAR4_GEO2 0xE 1991 1991 #define ACPI_NHLT_ARRAYTYPE_VENDOR 0xF 1992 1992 1993 - struct acpi_nhlt2_vendor_mic_config { 1993 + struct acpi_nhlt_vendor_mic_config { 1994 1994 u8 type; 1995 1995 u8 panel; 1996 1996 u16 speaker_position_distance; /* mm */ ··· 2031 2031 u8 config_type; 2032 2032 u8 array_type; 2033 2033 u8 mics_count; 2034 - struct acpi_nhlt2_vendor_mic_config mics[]; 2034 + struct acpi_nhlt_vendor_mic_config mics[]; 2035 2035 }; 2036 2036 2037 2037 union acpi_nhlt_device_config { ··· 2042 2042 }; 2043 2043 2044 2044 /* Inherited from Microsoft's WAVEFORMATEXTENSIBLE. */ 2045 - struct acpi_nhlt2_wave_formatext { 2045 + struct acpi_nhlt_wave_formatext { 2046 2046 u16 format_tag; 2047 2047 u16 channel_count; 2048 2048 u32 samples_per_sec; ··· 2055 2055 u8 subformat[16]; 2056 2056 }; 2057 2057 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; 2060 2060 struct acpi_nhlt_config config; 2061 2061 }; 2062 2062 2063 - struct acpi_nhlt2_formats_config { 2063 + struct acpi_nhlt_formats_config { 2064 2064 u8 formats_count; 2065 - struct acpi_nhlt2_format_config formats[]; 2065 + struct acpi_nhlt_format_config formats[]; 2066 2066 }; 2067 2067 2068 - struct acpi_nhlt2_device_info { 2068 + struct acpi_nhlt_device_info { 2069 2069 u8 id[16]; 2070 2070 u8 instance_id; 2071 2071 u8 port_id; ··· 2073 2073 2074 2074 struct acpi_nhlt_devices_info { 2075 2075 u8 devices_count; 2076 - struct acpi_nhlt2_device_info devices[]; 2076 + struct acpi_nhlt_device_info devices[]; 2077 2077 }; 2078 2078 2079 2079 /*******************************************************************************
+23 -23
include/acpi/nhlt.h
··· 23 23 * 24 24 * Return: A pointer to the formats configuration space. 25 25 */ 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) 28 28 { 29 29 struct acpi_nhlt_config *cfg = __acpi_nhlt_endpoint_config(ep); 30 30 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); 32 32 } 33 33 34 34 #define __acpi_nhlt_first_endpoint(tb) \ ··· 99 99 acpi_status acpi_nhlt_get_gbl_table(void); 100 100 void acpi_nhlt_put_gbl_table(void); 101 101 102 - bool acpi_nhlt_endpoint_match(const struct acpi_nhlt2_endpoint *ep, 102 + bool acpi_nhlt_endpoint_match(const struct acpi_nhlt_endpoint *ep, 103 103 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, 106 106 int link_type, int dev_type, int dir, int bus_id); 107 - struct acpi_nhlt2_endpoint * 107 + struct acpi_nhlt_endpoint * 108 108 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, 111 111 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, 114 114 int link_type, int dev_type, int dir, int bus_id, 115 115 u16 ch, u32 rate, u16 vpbs, u16 bps); 116 - struct acpi_nhlt2_format_config * 116 + struct acpi_nhlt_format_config * 117 117 acpi_nhlt_find_fmtcfg(int link_type, int dev_type, int dir, int bus_id, 118 118 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); 120 120 121 121 #else /* !CONFIG_ACPI_NHLT */ 122 122 ··· 130 130 } 131 131 132 132 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, 134 134 int link_type, int dev_type, int dir, int bus_id) 135 135 { 136 136 return false; 137 137 } 138 138 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, 141 141 int link_type, int dev_type, int dir, int bus_id) 142 142 { 143 143 return NULL; 144 144 } 145 145 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, 148 148 u16 ch, u32 rate, u16 vbps, u16 bps) 149 149 { 150 150 return NULL; 151 151 } 152 152 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, 155 155 int link_type, int dev_type, int dir, int bus_id, 156 156 u16 ch, u32 rate, u16 vpbs, u16 bps) 157 157 { 158 158 return NULL; 159 159 } 160 160 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) 162 162 { 163 163 return 0; 164 164 } 165 165 166 - static inline struct acpi_nhlt2_endpoint * 166 + static inline struct acpi_nhlt_endpoint * 167 167 acpi_nhlt_find_endpoint(int link_type, int dev_type, int dir, int bus_id) 168 168 { 169 169 return NULL; 170 170 } 171 171 172 - static inline struct acpi_nhlt2_format_config * 172 + static inline struct acpi_nhlt_format_config * 173 173 acpi_nhlt_find_fmtcfg(int link_type, int dev_type, int dir, int bus_id, 174 174 u16 ch, u32 rate, u16 vpbs, u16 bps) 175 175 {