18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci#ifndef _ACI_H_ 38c2ecf20Sopenharmony_ci#define _ACI_H_ 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_ci#define ACI_REG_COMMAND 0 /* write register offset */ 68c2ecf20Sopenharmony_ci#define ACI_REG_STATUS 1 /* read register offset */ 78c2ecf20Sopenharmony_ci#define ACI_REG_BUSY 2 /* busy register offset */ 88c2ecf20Sopenharmony_ci#define ACI_REG_RDS 2 /* PCM20: RDS register offset */ 98c2ecf20Sopenharmony_ci#define ACI_MINTIME 500 /* ACI time out limit */ 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci#define ACI_SET_MUTE 0x0d 128c2ecf20Sopenharmony_ci#define ACI_SET_POWERAMP 0x0f 138c2ecf20Sopenharmony_ci#define ACI_SET_TUNERMUTE 0xa3 148c2ecf20Sopenharmony_ci#define ACI_SET_TUNERMONO 0xa4 158c2ecf20Sopenharmony_ci#define ACI_SET_IDE 0xd0 168c2ecf20Sopenharmony_ci#define ACI_SET_WSS 0xd1 178c2ecf20Sopenharmony_ci#define ACI_SET_SOLOMODE 0xd2 188c2ecf20Sopenharmony_ci#define ACI_SET_PREAMP 0x03 198c2ecf20Sopenharmony_ci#define ACI_GET_PREAMP 0x21 208c2ecf20Sopenharmony_ci#define ACI_WRITE_TUNE 0xa7 218c2ecf20Sopenharmony_ci#define ACI_READ_TUNERSTEREO 0xa8 228c2ecf20Sopenharmony_ci#define ACI_READ_TUNERSTATION 0xa9 238c2ecf20Sopenharmony_ci#define ACI_READ_VERSION 0xf1 248c2ecf20Sopenharmony_ci#define ACI_READ_IDCODE 0xf2 258c2ecf20Sopenharmony_ci#define ACI_INIT 0xff 268c2ecf20Sopenharmony_ci#define ACI_STATUS 0xf0 278c2ecf20Sopenharmony_ci#define ACI_S_GENERAL 0x00 288c2ecf20Sopenharmony_ci#define ACI_ERROR_OP 0xdf 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_ci/* ACI Mixer */ 318c2ecf20Sopenharmony_ci 328c2ecf20Sopenharmony_ci/* These are the values for the right channel GET registers. 338c2ecf20Sopenharmony_ci Add an offset of 0x01 for the left channel register. 348c2ecf20Sopenharmony_ci (left=right+0x01) */ 358c2ecf20Sopenharmony_ci 368c2ecf20Sopenharmony_ci#define ACI_GET_MASTER 0x03 378c2ecf20Sopenharmony_ci#define ACI_GET_MIC 0x05 388c2ecf20Sopenharmony_ci#define ACI_GET_LINE 0x07 398c2ecf20Sopenharmony_ci#define ACI_GET_CD 0x09 408c2ecf20Sopenharmony_ci#define ACI_GET_SYNTH 0x0b 418c2ecf20Sopenharmony_ci#define ACI_GET_PCM 0x0d 428c2ecf20Sopenharmony_ci#define ACI_GET_LINE1 0x10 /* Radio on PCM20 */ 438c2ecf20Sopenharmony_ci#define ACI_GET_LINE2 0x12 448c2ecf20Sopenharmony_ci 458c2ecf20Sopenharmony_ci#define ACI_GET_EQ1 0x22 /* from Bass ... */ 468c2ecf20Sopenharmony_ci#define ACI_GET_EQ2 0x24 478c2ecf20Sopenharmony_ci#define ACI_GET_EQ3 0x26 488c2ecf20Sopenharmony_ci#define ACI_GET_EQ4 0x28 498c2ecf20Sopenharmony_ci#define ACI_GET_EQ5 0x2a 508c2ecf20Sopenharmony_ci#define ACI_GET_EQ6 0x2c 518c2ecf20Sopenharmony_ci#define ACI_GET_EQ7 0x2e /* ... to Treble */ 528c2ecf20Sopenharmony_ci 538c2ecf20Sopenharmony_ci/* And these are the values for the right channel SET registers. 548c2ecf20Sopenharmony_ci For left channel access you have to add an offset of 0x08. 558c2ecf20Sopenharmony_ci MASTER is an exception, which needs an offset of 0x01 */ 568c2ecf20Sopenharmony_ci 578c2ecf20Sopenharmony_ci#define ACI_SET_MASTER 0x00 588c2ecf20Sopenharmony_ci#define ACI_SET_MIC 0x30 598c2ecf20Sopenharmony_ci#define ACI_SET_LINE 0x31 608c2ecf20Sopenharmony_ci#define ACI_SET_CD 0x34 618c2ecf20Sopenharmony_ci#define ACI_SET_SYNTH 0x33 628c2ecf20Sopenharmony_ci#define ACI_SET_PCM 0x32 638c2ecf20Sopenharmony_ci#define ACI_SET_LINE1 0x35 /* Radio on PCM20 */ 648c2ecf20Sopenharmony_ci#define ACI_SET_LINE2 0x36 658c2ecf20Sopenharmony_ci 668c2ecf20Sopenharmony_ci#define ACI_SET_EQ1 0x40 /* from Bass ... */ 678c2ecf20Sopenharmony_ci#define ACI_SET_EQ2 0x41 688c2ecf20Sopenharmony_ci#define ACI_SET_EQ3 0x42 698c2ecf20Sopenharmony_ci#define ACI_SET_EQ4 0x43 708c2ecf20Sopenharmony_ci#define ACI_SET_EQ5 0x44 718c2ecf20Sopenharmony_ci#define ACI_SET_EQ6 0x45 728c2ecf20Sopenharmony_ci#define ACI_SET_EQ7 0x46 /* ... to Treble */ 738c2ecf20Sopenharmony_ci 748c2ecf20Sopenharmony_cistruct snd_miro_aci { 758c2ecf20Sopenharmony_ci unsigned long aci_port; 768c2ecf20Sopenharmony_ci int aci_vendor; 778c2ecf20Sopenharmony_ci int aci_product; 788c2ecf20Sopenharmony_ci int aci_version; 798c2ecf20Sopenharmony_ci int aci_amp; 808c2ecf20Sopenharmony_ci int aci_preamp; 818c2ecf20Sopenharmony_ci int aci_solomode; 828c2ecf20Sopenharmony_ci 838c2ecf20Sopenharmony_ci struct mutex aci_mutex; 848c2ecf20Sopenharmony_ci}; 858c2ecf20Sopenharmony_ci 868c2ecf20Sopenharmony_ciint snd_aci_cmd(struct snd_miro_aci *aci, int write1, int write2, int write3); 878c2ecf20Sopenharmony_ci 888c2ecf20Sopenharmony_cistruct snd_miro_aci *snd_aci_get_aci(void); 898c2ecf20Sopenharmony_ci 908c2ecf20Sopenharmony_ci#endif /* _ACI_H_ */ 918c2ecf20Sopenharmony_ci 92