Files
Bruno Martins dbcc8fefd9 treewide: Import Samsung changes from T725XXU2DUD1
Change-Id: I5c31dc4a8006a967910963fb9e7d1a0ab4ab9731
2022-02-23 22:14:25 +01:00

84 lines
2.0 KiB
C

/*
* Copyright (C) 2012 Samsung Electronics, Inc.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __ASM_ARCH_SEC_HEADSET_H
#define __ASM_ARCH_SEC_HEADSET_H
#ifdef __KERNEL__
enum sec_jack_type {
SEC_JACK_NO_DEVICE = 0x0,
SEC_HEADSET_4POLE = 0x01 << 0,
SEC_HEADSET_3POLE = 0x01 << 1,
SEC_EXTERNAL_ANTENNA = 0x01 << 2,
};
enum sec_jack_state {
SEC_JACK_NONE,
SEC_JACK_EARJACK,
SEC_JACK_MOISTURE,
SEC_JACK_ABNORMAL,
};
struct sec_jack_zone {
unsigned int adc_high;
unsigned int delay_us;
unsigned int check_count;
unsigned int jack_type;
};
struct sec_jack_buttons_zone {
unsigned int code;
unsigned int adc_low;
unsigned int adc_high;
};
struct sec_jack_control_data {
int snd_card_registered;
void (*set_micbias)(bool);
int (*get_adc)(void);
int (*get_moisture_adc)(void);
void (*hp_imp_detect)(void);
void (*hp_imp_unplug)(void);
int jack_type;
};
struct sec_jack_platform_data {
int det_gpio;
int key_gpio;
int ear_micbias_en_gpio;
int gnd_det_en;
bool det_active_high;
bool send_end_active_high;
bool use_moisture_det;
u32 mdet_range[2];
int key_debounce_time_ms;
int det_debounce_time_ms;
int ldet_en_gpio;
struct sec_jack_zone jack_zones[4];
struct sec_jack_buttons_zone jack_buttons_zones[4];
struct sec_jack_control_data *jack_controls;
struct pinctrl *jack_pinctrl;
struct pinctrl_state *jack_pins_active;
};
extern struct sec_jack_control_data jack_controls;
typedef void (*sec_jack_button_notify_cb)(int code, int event);
int sec_jack_register_button_notify_cb(sec_jack_button_notify_cb func);
int get_jack_state(void);
#endif
#endif