• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef ANALOG_HEADSET_EV_H
17 #define ANALOG_HEADSET_EV_H
18 
19 #define HEADSET_JACK_INDEX     3   // 0, 1=touch, 2=no response, 3=jack, 4 not found
20 #define INDEV_TYPE_HEADSET     4
21 #define KEY_JACK_HEADSET       20  // EXTCON_JACK_MICROPHONE(20)
22 #define KEY_JACK_HEADPHONE     21  // EXTCON_JACK_HEADPHONE(21)
23 #define KEY_JACK_HOOK          226 // KEY_MEDIA (226)
24 
25 enum JackType {
26     JACK_TYPE_HEADSET = 0,
27     JACK_TYPE_HEADPHONE,
28     JACK_TYPE_LINEOUT,
29     JACK_TYPE_UNKNOWN = 10,
30 };
31 
32 enum JackInsertStatus {
33     JACK_STATUS_IN = 0,
34     JACK_STATUS_OUT,
35 };
36 
37 enum JackState {
38     JACK_STATE_HEADSET_OUT = 0,
39     JACK_STATE_HEADPHONE_OUT,
40     JACK_STATE_HEADSET_IN,
41     JACK_STATE_HEADPHONE_IN,
42     JACK_STATE_UNKNOWN,
43 };
44 
45 struct JackNotifyInfo {
46     uint16_t jackType;
47     bool jackStatus;
48     uint16_t jackState;
49 };
50 
51 #endif