~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/sound/tas2781-dsp.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /include/sound/tas2781-dsp.h (Architecture ppc) and /include/sound/tas2781-dsp.h (Architecture sparc64)


  1 /* SPDX-License-Identifier: GPL-2.0 */              1 /* SPDX-License-Identifier: GPL-2.0 */
  2 //                                                  2 //
  3 // ALSA SoC Texas Instruments TAS2781 Audio Sm      3 // ALSA SoC Texas Instruments TAS2781 Audio Smart Amplifier
  4 //                                                  4 //
  5 // Copyright (C) 2022 - 2024 Texas Instruments      5 // Copyright (C) 2022 - 2024 Texas Instruments Incorporated
  6 // https://www.ti.com                               6 // https://www.ti.com
  7 //                                                  7 //
  8 // The TAS2781 driver implements a flexible an      8 // The TAS2781 driver implements a flexible and configurable
  9 // algo coefficient setting for one, two, or e      9 // algo coefficient setting for one, two, or even multiple
 10 // TAS2781 chips.                                  10 // TAS2781 chips.
 11 //                                                 11 //
 12 // Author: Shenghao Ding <shenghao-ding@ti.com     12 // Author: Shenghao Ding <shenghao-ding@ti.com>
 13 // Author: Kevin Lu <kevin-lu@ti.com>              13 // Author: Kevin Lu <kevin-lu@ti.com>
 14 //                                                 14 //
 15                                                    15 
 16 #ifndef __TAS2781_DSP_H__                          16 #ifndef __TAS2781_DSP_H__
 17 #define __TAS2781_DSP_H__                          17 #define __TAS2781_DSP_H__
 18                                                    18 
 19 #define MAIN_ALL_DEVICES                           19 #define MAIN_ALL_DEVICES                        0x0d
 20 #define MAIN_DEVICE_A                              20 #define MAIN_DEVICE_A                           0x01
 21 #define MAIN_DEVICE_B                              21 #define MAIN_DEVICE_B                           0x08
 22 #define MAIN_DEVICE_C                              22 #define MAIN_DEVICE_C                           0x10
 23 #define MAIN_DEVICE_D                              23 #define MAIN_DEVICE_D                           0x14
 24 #define COEFF_DEVICE_A                             24 #define COEFF_DEVICE_A                          0x03
 25 #define COEFF_DEVICE_B                             25 #define COEFF_DEVICE_B                          0x0a
 26 #define COEFF_DEVICE_C                             26 #define COEFF_DEVICE_C                          0x11
 27 #define COEFF_DEVICE_D                             27 #define COEFF_DEVICE_D                          0x15
 28 #define PRE_DEVICE_A                               28 #define PRE_DEVICE_A                            0x04
 29 #define PRE_DEVICE_B                               29 #define PRE_DEVICE_B                            0x0b
 30 #define PRE_DEVICE_C                               30 #define PRE_DEVICE_C                            0x12
 31 #define PRE_DEVICE_D                               31 #define PRE_DEVICE_D                            0x16
 32                                                    32 
 33 #define PPC3_VERSION                               33 #define PPC3_VERSION                            0x4100
 34 #define PPC3_VERSION_TAS2781                       34 #define PPC3_VERSION_TAS2781                    0x14600
 35 #define TASDEVICE_DEVICE_SUM                       35 #define TASDEVICE_DEVICE_SUM                    8
 36 #define TASDEVICE_CONFIG_SUM                       36 #define TASDEVICE_CONFIG_SUM                    64
 37                                                    37 
 38 #define TASDEVICE_MAX_CHANNELS                     38 #define TASDEVICE_MAX_CHANNELS                  8
 39                                                    39 
 40 enum tasdevice_dsp_dev_idx {                       40 enum tasdevice_dsp_dev_idx {
 41         TASDEVICE_DSP_TAS_2555 = 0,                41         TASDEVICE_DSP_TAS_2555 = 0,
 42         TASDEVICE_DSP_TAS_2555_STEREO,             42         TASDEVICE_DSP_TAS_2555_STEREO,
 43         TASDEVICE_DSP_TAS_2557_MONO,               43         TASDEVICE_DSP_TAS_2557_MONO,
 44         TASDEVICE_DSP_TAS_2557_DUAL_MONO,          44         TASDEVICE_DSP_TAS_2557_DUAL_MONO,
 45         TASDEVICE_DSP_TAS_2559,                    45         TASDEVICE_DSP_TAS_2559,
 46         TASDEVICE_DSP_TAS_2563,                    46         TASDEVICE_DSP_TAS_2563,
 47         TASDEVICE_DSP_TAS_2563_DUAL_MONO = 7,      47         TASDEVICE_DSP_TAS_2563_DUAL_MONO = 7,
 48         TASDEVICE_DSP_TAS_2563_QUAD,               48         TASDEVICE_DSP_TAS_2563_QUAD,
 49         TASDEVICE_DSP_TAS_2563_21,                 49         TASDEVICE_DSP_TAS_2563_21,
 50         TASDEVICE_DSP_TAS_2781,                    50         TASDEVICE_DSP_TAS_2781,
 51         TASDEVICE_DSP_TAS_2781_DUAL_MONO,          51         TASDEVICE_DSP_TAS_2781_DUAL_MONO,
 52         TASDEVICE_DSP_TAS_2781_21,                 52         TASDEVICE_DSP_TAS_2781_21,
 53         TASDEVICE_DSP_TAS_2781_QUAD,               53         TASDEVICE_DSP_TAS_2781_QUAD,
 54         TASDEVICE_DSP_TAS_MAX_DEVICE               54         TASDEVICE_DSP_TAS_MAX_DEVICE
 55 };                                                 55 };
 56                                                    56 
 57 struct tasdevice_fw_fixed_hdr {                    57 struct tasdevice_fw_fixed_hdr {
 58         unsigned int fwsize;                       58         unsigned int fwsize;
 59         unsigned int ppcver;                       59         unsigned int ppcver;
 60         unsigned int drv_ver;                      60         unsigned int drv_ver;
 61 };                                                 61 };
 62                                                    62 
 63 struct tasdevice_dspfw_hdr {                       63 struct tasdevice_dspfw_hdr {
 64         struct tasdevice_fw_fixed_hdr fixed_hd     64         struct tasdevice_fw_fixed_hdr fixed_hdr;
 65         unsigned short device_family;              65         unsigned short device_family;
 66         unsigned short device;                     66         unsigned short device;
 67         unsigned char ndev;                        67         unsigned char ndev;
 68 };                                                 68 };
 69                                                    69 
 70 struct tasdev_blk {                                70 struct tasdev_blk {
 71         int nr_retry;                              71         int nr_retry;
 72         unsigned int type;                         72         unsigned int type;
 73         unsigned char is_pchksum_present;          73         unsigned char is_pchksum_present;
 74         unsigned char pchksum;                     74         unsigned char pchksum;
 75         unsigned char is_ychksum_present;          75         unsigned char is_ychksum_present;
 76         unsigned char ychksum;                     76         unsigned char ychksum;
 77         unsigned int nr_cmds;                      77         unsigned int nr_cmds;
 78         unsigned int blk_size;                     78         unsigned int blk_size;
 79         unsigned int nr_subblocks;                 79         unsigned int nr_subblocks;
 80         /* fixed m68k compiling issue, storing     80         /* fixed m68k compiling issue, storing the dev_idx as a member of block
 81          * can reduce unnecessary timeand syst     81          * can reduce unnecessary timeand system resource comsumption of
 82          * dev_idx mapping every time the bloc     82          * dev_idx mapping every time the block data writing to the dsp.
 83          */                                        83          */
 84         unsigned char dev_idx;                     84         unsigned char dev_idx;
 85         unsigned char *data;                       85         unsigned char *data;
 86 };                                                 86 };
 87                                                    87 
 88 struct tasdevice_data {                            88 struct tasdevice_data {
 89         char name[64];                             89         char name[64];
 90         unsigned int nr_blk;                       90         unsigned int nr_blk;
 91         struct tasdev_blk *dev_blks;               91         struct tasdev_blk *dev_blks;
 92 };                                                 92 };
 93                                                    93 
 94 struct tasdevice_prog {                            94 struct tasdevice_prog {
 95         unsigned int prog_size;                    95         unsigned int prog_size;
 96         struct tasdevice_data dev_data;            96         struct tasdevice_data dev_data;
 97 };                                                 97 };
 98                                                    98 
 99 struct tasdevice_config {                          99 struct tasdevice_config {
100         unsigned int cfg_size;                    100         unsigned int cfg_size;
101         char name[64];                            101         char name[64];
102         struct tasdevice_data dev_data;           102         struct tasdevice_data dev_data;
103 };                                                103 };
104                                                   104 
105 struct tasdevice_calibration {                    105 struct tasdevice_calibration {
106         struct tasdevice_data dev_data;           106         struct tasdevice_data dev_data;
107 };                                                107 };
108                                                   108 
109 struct tasdevice_fw {                             109 struct tasdevice_fw {
110         struct tasdevice_dspfw_hdr fw_hdr;        110         struct tasdevice_dspfw_hdr fw_hdr;
111         unsigned short nr_programs;               111         unsigned short nr_programs;
112         struct tasdevice_prog *programs;          112         struct tasdevice_prog *programs;
113         unsigned short nr_configurations;         113         unsigned short nr_configurations;
114         struct tasdevice_config *configs;         114         struct tasdevice_config *configs;
115         unsigned short nr_calibrations;           115         unsigned short nr_calibrations;
116         struct tasdevice_calibration *calibrat    116         struct tasdevice_calibration *calibrations;
117         struct device *dev;                       117         struct device *dev;
118 };                                                118 };
119                                                   119 
120 enum tasdevice_fw_state {                         120 enum tasdevice_fw_state {
121         /* Driver in startup mode, not load an    121         /* Driver in startup mode, not load any firmware. */
122         TASDEVICE_DSP_FW_PENDING,                 122         TASDEVICE_DSP_FW_PENDING,
123         /* DSP firmware in the system, but par    123         /* DSP firmware in the system, but parsing error. */
124         TASDEVICE_DSP_FW_FAIL,                    124         TASDEVICE_DSP_FW_FAIL,
125         /*                                        125         /*
126          * Only RCA (Reconfigurable Architectu    126          * Only RCA (Reconfigurable Architecture) firmware load
127          * successfully.                          127          * successfully.
128          */                                       128          */
129         TASDEVICE_RCA_FW_OK,                      129         TASDEVICE_RCA_FW_OK,
130         /* Both RCA and DSP firmware load succ    130         /* Both RCA and DSP firmware load successfully. */
131         TASDEVICE_DSP_FW_ALL_OK,                  131         TASDEVICE_DSP_FW_ALL_OK,
132 };                                                132 };
133                                                   133 
134 enum tasdevice_bin_blk_type {                     134 enum tasdevice_bin_blk_type {
135         TASDEVICE_BIN_BLK_COEFF = 1,              135         TASDEVICE_BIN_BLK_COEFF = 1,
136         TASDEVICE_BIN_BLK_POST_POWER_UP,          136         TASDEVICE_BIN_BLK_POST_POWER_UP,
137         TASDEVICE_BIN_BLK_PRE_SHUTDOWN,           137         TASDEVICE_BIN_BLK_PRE_SHUTDOWN,
138         TASDEVICE_BIN_BLK_PRE_POWER_UP,           138         TASDEVICE_BIN_BLK_PRE_POWER_UP,
139         TASDEVICE_BIN_BLK_POST_SHUTDOWN           139         TASDEVICE_BIN_BLK_POST_SHUTDOWN
140 };                                                140 };
141                                                   141 
142 struct tasdevice_rca_hdr {                        142 struct tasdevice_rca_hdr {
143         unsigned int img_sz;                      143         unsigned int img_sz;
144         unsigned int checksum;                    144         unsigned int checksum;
145         unsigned int binary_version_num;          145         unsigned int binary_version_num;
146         unsigned int drv_fw_version;              146         unsigned int drv_fw_version;
147         unsigned char plat_type;                  147         unsigned char plat_type;
148         unsigned char dev_family;                 148         unsigned char dev_family;
149         unsigned char reserve;                    149         unsigned char reserve;
150         unsigned char ndev;                       150         unsigned char ndev;
151         unsigned char devs[TASDEVICE_DEVICE_SU    151         unsigned char devs[TASDEVICE_DEVICE_SUM];
152         unsigned int nconfig;                     152         unsigned int nconfig;
153         unsigned int config_size[TASDEVICE_CON    153         unsigned int config_size[TASDEVICE_CONFIG_SUM];
154 };                                                154 };
155                                                   155 
156 struct tasdev_blk_data {                          156 struct tasdev_blk_data {
157         unsigned char dev_idx;                    157         unsigned char dev_idx;
158         unsigned char block_type;                 158         unsigned char block_type;
159         unsigned short yram_checksum;             159         unsigned short yram_checksum;
160         unsigned int block_size;                  160         unsigned int block_size;
161         unsigned int n_subblks;                   161         unsigned int n_subblks;
162         unsigned char *regdata;                   162         unsigned char *regdata;
163 };                                                163 };
164                                                   164 
165 struct tasdevice_config_info {                    165 struct tasdevice_config_info {
166         unsigned int nblocks;                     166         unsigned int nblocks;
167         unsigned int real_nblocks;                167         unsigned int real_nblocks;
168         unsigned char active_dev;                 168         unsigned char active_dev;
169         struct tasdev_blk_data **blk_data;        169         struct tasdev_blk_data **blk_data;
170 };                                                170 };
171                                                   171 
172 struct tasdevice_rca {                            172 struct tasdevice_rca {
173         struct tasdevice_rca_hdr fw_hdr;          173         struct tasdevice_rca_hdr fw_hdr;
174         int ncfgs;                                174         int ncfgs;
175         struct tasdevice_config_info **cfg_inf    175         struct tasdevice_config_info **cfg_info;
176         int profile_cfg_id;                       176         int profile_cfg_id;
177 };                                                177 };
178                                                   178 
179 void tasdevice_select_cfg_blk(void *context, i    179 void tasdevice_select_cfg_blk(void *context, int conf_no,
180         unsigned char block_type);                180         unsigned char block_type);
181 void tasdevice_config_info_remove(void *contex    181 void tasdevice_config_info_remove(void *context);
182 void tasdevice_dsp_remove(void *context);         182 void tasdevice_dsp_remove(void *context);
183 int tasdevice_dsp_parser(void *context);          183 int tasdevice_dsp_parser(void *context);
184 int tasdevice_rca_parser(void *context, const     184 int tasdevice_rca_parser(void *context, const struct firmware *fmw);
185 void tasdevice_dsp_remove(void *context);         185 void tasdevice_dsp_remove(void *context);
186 void tasdevice_calbin_remove(void *context);      186 void tasdevice_calbin_remove(void *context);
187 int tasdevice_select_tuningprm_cfg(void *conte    187 int tasdevice_select_tuningprm_cfg(void *context, int prm,
188         int cfg_no, int rca_conf_no);             188         int cfg_no, int rca_conf_no);
189 int tasdevice_prmg_load(void *context, int prm    189 int tasdevice_prmg_load(void *context, int prm_no);
190 void tasdevice_tuning_switch(void *context, in    190 void tasdevice_tuning_switch(void *context, int state);
191 int tas2781_load_calibration(void *context, ch    191 int tas2781_load_calibration(void *context, char *file_name,
192         unsigned short i);                        192         unsigned short i);
193                                                   193 
194 #endif                                            194 #endif
195                                                   195 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php