Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Platform data for Texas Instruments TLV320AIC3x codec
0004  *
0005  * Author: Jarkko Nikula <jarkko.nikula@bitmer.com>
0006  */
0007 #ifndef __TLV320AIC3x_H__
0008 #define __TLV320AIC3x_H__
0009 
0010 /* GPIO API */
0011 enum {
0012     AIC3X_GPIO1_FUNC_DISABLED       = 0,
0013     AIC3X_GPIO1_FUNC_AUDIO_WORDCLK_ADC  = 1,
0014     AIC3X_GPIO1_FUNC_CLOCK_MUX      = 2,
0015     AIC3X_GPIO1_FUNC_CLOCK_MUX_DIV2     = 3,
0016     AIC3X_GPIO1_FUNC_CLOCK_MUX_DIV4     = 4,
0017     AIC3X_GPIO1_FUNC_CLOCK_MUX_DIV8     = 5,
0018     AIC3X_GPIO1_FUNC_SHORT_CIRCUIT_IRQ  = 6,
0019     AIC3X_GPIO1_FUNC_AGC_NOISE_IRQ      = 7,
0020     AIC3X_GPIO1_FUNC_INPUT          = 8,
0021     AIC3X_GPIO1_FUNC_OUTPUT         = 9,
0022     AIC3X_GPIO1_FUNC_DIGITAL_MIC_MODCLK = 10,
0023     AIC3X_GPIO1_FUNC_AUDIO_WORDCLK      = 11,
0024     AIC3X_GPIO1_FUNC_BUTTON_IRQ     = 12,
0025     AIC3X_GPIO1_FUNC_HEADSET_DETECT_IRQ = 13,
0026     AIC3X_GPIO1_FUNC_HEADSET_DETECT_OR_BUTTON_IRQ   = 14,
0027     AIC3X_GPIO1_FUNC_ALL_IRQ        = 16
0028 };
0029 
0030 enum {
0031     AIC3X_GPIO2_FUNC_DISABLED       = 0,
0032     AIC3X_GPIO2_FUNC_HEADSET_DETECT_IRQ = 2,
0033     AIC3X_GPIO2_FUNC_INPUT          = 3,
0034     AIC3X_GPIO2_FUNC_OUTPUT         = 4,
0035     AIC3X_GPIO2_FUNC_DIGITAL_MIC_INPUT  = 5,
0036     AIC3X_GPIO2_FUNC_AUDIO_BITCLK       = 8,
0037     AIC3X_GPIO2_FUNC_HEADSET_DETECT_OR_BUTTON_IRQ = 9,
0038     AIC3X_GPIO2_FUNC_ALL_IRQ        = 10,
0039     AIC3X_GPIO2_FUNC_SHORT_CIRCUIT_OR_AGC_IRQ = 11,
0040     AIC3X_GPIO2_FUNC_HEADSET_OR_BUTTON_PRESS_OR_SHORT_CIRCUIT_IRQ = 12,
0041     AIC3X_GPIO2_FUNC_SHORT_CIRCUIT_IRQ  = 13,
0042     AIC3X_GPIO2_FUNC_AGC_NOISE_IRQ      = 14,
0043     AIC3X_GPIO2_FUNC_BUTTON_PRESS_IRQ   = 15
0044 };
0045 
0046 enum aic3x_micbias_voltage {
0047     AIC3X_MICBIAS_OFF = 0,
0048     AIC3X_MICBIAS_2_0V = 1,
0049     AIC3X_MICBIAS_2_5V = 2,
0050     AIC3X_MICBIAS_AVDDV = 3,
0051 };
0052 
0053 struct aic3x_setup_data {
0054     unsigned int gpio_func[2];
0055 };
0056 
0057 struct aic3x_pdata {
0058     int gpio_reset; /* < 0 if not used */
0059     struct aic3x_setup_data *setup;
0060 
0061     /* Selects the micbias voltage */
0062     enum aic3x_micbias_voltage micbias_vg;
0063 };
0064 
0065 #endif