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 /** 26 * @brief Audio event type. 27 * 28 * referenc the 'drivers\peripheral\audio\interfaces\include\audio_events.h', 29 * the value don't modify! 30 * 31 * @since 1.0 32 */ 33 typedef enum AudioEventType { 34 HDF_AUDIO_DEVICE_ADD = 0x1, 35 HDF_AUDIO_DEVICE_REMOVE = 0x2, 36 } EVENT_TYPE; 37 38 typedef enum AudioDeviceType { 39 HDF_AUDIO_HEADPHONE = 0x2, 40 HDF_AUDIO_HEADSET = 0x4, 41 } DEVICE_TYPE; 42 43 struct AudioEvent { 44 uint32_t eventType; 45 uint32_t deviceType; 46 }; 47 48 enum JackInsertStatus { 49 JACK_STATUS_IN = 0, 50 JACK_STATUS_OUT, 51 }; 52 53 struct JackNotifyInfo { 54 uint16_t jackType; 55 bool jackStatus; 56 }; 57 58 #endif