| 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | |
| 3 | #ifndef __DRIVERS_I2C_DA7219_CHIP_H__ |
| 4 | #define __DRIVERS_I2C_DA7219_CHIP_H__ |
| 5 | |
| 6 | #include <acpi/acpi_device.h> |
| 7 | |
| 8 | /* |
| 9 | * Dialog Semiconductor DA7219 Audio Codec devicetree bindings |
| 10 | * linux/Documentation/devicetree/bindings/sound/da7219.txt |
| 11 | */ |
| 12 | struct drivers_i2c_da7219_config { |
| 13 | /* Interrupt configuration */ |
| 14 | struct acpi_irq irq; |
| 15 | |
| 16 | /* Use GPIO based interrupt instead of PIRQ */ |
| 17 | struct acpi_gpio irq_gpio; |
| 18 | |
| 19 | /* I2C Bus Frequency in Hertz (default 400kHz) */ |
| 20 | unsigned int bus_speed; |
| 21 | |
| 22 | /* |
| 23 | * micbias-lvl : Voltage (mV) for Mic Bias |
| 24 | * [<1600>, <1800>, <2000>, <2200>, <2400>, <2600>] |
| 25 | */ |
| 26 | unsigned int micbias_lvl; |
| 27 | |
| 28 | /* |
| 29 | * mic-amp-in-sel : Mic input source type |
| 30 | * ["diff", "se_p", "se_n"] |
| 31 | */ |
| 32 | const char *mic_amp_in_sel; |
| 33 | |
| 34 | /* |
| 35 | * Properties for da7219_aad child node |
| 36 | */ |
| 37 | |
| 38 | /* |
| 39 | * micbias-pulse-lvl : Mic bias higher voltage pulse level (mV) |
| 40 | * [<2800>, <2900>] |
| 41 | */ |
| 42 | unsigned int micbias_pulse_lvl; |
| 43 | |
| 44 | /* |
| 45 | * micbias-pulse-time : Mic bias higher voltage pulse duration (ms) |
| 46 | */ |
| 47 | unsigned int micbias_pulse_time; |
| 48 | |
| 49 | /* |
| 50 | * btn-cfg : Periodic button press measurements for 4-pole jack (ms) |
| 51 | * [<2>, <5>, <10>, <50>, <100>, <200>, <500>] |
| 52 | */ |
| 53 | unsigned int btn_cfg; |
| 54 | |
| 55 | /* |
| 56 | * mic-det-thr : Impedance threshold for mic detection measurement (Ohms) |
| 57 | * [<200>, <500>, <750>, <1000>] |
| 58 | */ |
| 59 | unsigned int mic_det_thr; |
| 60 | |
| 61 | /* |
| 62 | * jack-ins-deb : Debounce time for jack insertion (ms) |
| 63 | * [<5>, <10>, <20>, <50>, <100>, <200>, <500>, <1000>] |
| 64 | */ |
| 65 | unsigned int jack_ins_deb; |
| 66 | |
| 67 | /* |
| 68 | * jack-det-rate : Jack type detection latency (3/4 pole) |
| 69 | * ["32ms_64ms", "64ms_128ms", "128ms_256ms", "256ms_512ms"] |
| 70 | */ |
| 71 | const char *jack_det_rate; |
| 72 | |
| 73 | /* |
| 74 | * jack-rem-deb : Debounce time for jack removal (ms) |
| 75 | * [<1>, <5>, <10>, <20>] |
| 76 | */ |
| 77 | unsigned int jack_rem_deb; |
| 78 | |
| 79 | /* |
| 80 | * a-d-btn-thr : Impedance threshold between buttons A and D |
| 81 | * [0x0 - 0xFF] |
| 82 | */ |
| 83 | unsigned int a_d_btn_thr; |
| 84 | |
| 85 | /* |
| 86 | * d-b-btn-thr : Impedance threshold between buttons D and B |
| 87 | * [0x0 - 0xFF] |
| 88 | */ |
| 89 | unsigned int d_b_btn_thr; |
| 90 | |
| 91 | /* |
| 92 | * b-c-btn-thr : Impedance threshold between buttons B and C |
| 93 | * [0x0 - 0xFF] |
| 94 | */ |
| 95 | unsigned int b_c_btn_thr; |
| 96 | |
| 97 | /* |
| 98 | * c-mic-btn-thr : Impedance threshold between button C and Mic |
| 99 | * [0x0 - 0xFF] |
| 100 | */ |
| 101 | unsigned int c_mic_btn_thr; |
| 102 | |
| 103 | /* |
| 104 | * btn-avg : Number of 8-bit readings for averaged button measurement |
| 105 | * [<1>, <2>, <4>, <8>] |
| 106 | */ |
| 107 | unsigned int btn_avg; |
| 108 | |
| 109 | /* |
| 110 | * adc-1bit-rpt : Repeat count for 1-bit button measurement |
| 111 | * [<1>, <2>, <4>, <8>] |
| 112 | */ |
| 113 | unsigned int adc_1bit_rpt; |
| 114 | |
| 115 | /* |
| 116 | * mclk-name : Pass the system clk to da7219 |
| 117 | * ["name of mclk" ] |
| 118 | */ |
| 119 | const char *mclk_name; |
| 120 | }; |
| 121 | |
| 122 | #endif /* __DRIVERS_I2C_DA7219_CHIP_H__ */ |