Implement codec_detect to collect information about codec_state, wdsp_stat count, hardware info pn and speaker impedance records for codec hardware data. model path: /sys/devices/platform/codec_detect design copied from b/144901001 Bug:144900113 Test: manually test $ adb shell cat /sys/devices/platform/codec_detect 0 $ adb shell cat /sys/devices/platform/hwinfo_part_number rt5514 $ adb shell cat /sys/devices/platform/wdsp_stat 22333,0,0,0 $ adb shell cat /sys/devices/platform/codec_detect/resistance_left_right 0.0,0.0 Change-Id: I95d8ec644805e7967efeb33a893f791ff397ec2d Signed-off-by: rogerfang <rogerfang@google.com>
37 lines
841 B
C
37 lines
841 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
/*
|
|
* codec-misc.h -- codec misc driver
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 and
|
|
* only version 2 as published by the Free Software Foundation.
|
|
*
|
|
*/
|
|
|
|
#ifndef _CODEC_MISC_H
|
|
#define _CODEC_MISC_H
|
|
|
|
typedef int (*state_cb)(void);
|
|
typedef char* (*number_cb)(void);
|
|
|
|
bool codec_detect_available(void);
|
|
void codec_detect_state_callback(state_cb cb);
|
|
void codec_detect_hs_state_callback(state_cb cb);
|
|
void codec_detect_number_callback(number_cb cb);
|
|
int codec_detect_status_notifier(unsigned long val);
|
|
int codec_misc_amp_put(int ch, long val);
|
|
|
|
enum {
|
|
CODEC_STATE_UNKNOWN = -99,
|
|
CODEC_STATE_ONLINE = 0,
|
|
};
|
|
|
|
enum {
|
|
WDSP_STAT_CRASH = 0,
|
|
WDSP_STAT_DOWN,
|
|
WDSP_STAT_UP,
|
|
};
|
|
|
|
#endif /* _CODEC_MISC_H */
|