mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-14 16:46:23 +00:00
This CL adds the driver support for the WoV module which inludes the following files: - wov.c - wov_chip.h - apm.c - apm_chip.h It also supports the console commad "wov" which can test different configuration and audio quality by entering different parameters. The detail description of WoV console command is listed below: ------------------------------------------------------------------------ [Note]: Before changing any of settings, please make sure the operation mode is on the "OFF" state. (ie. run the command wov cfgmod off first) . > wov init Initialize WoV interface, including pin mux and interrupt registration etc. > wov mute <enable / disable > mute enable / disable. > wov cfgsrc <mono | stereo | left | right> set audio source, ex: wov cfgsrc left, means audio source from left MIC. > wov cfgbis <16|18|20|24> set audio resolution, ex: wov cfgbit 16 means audio resolution are 16bits. > wov cfgsfs <8000|12000|16000|24000|32000|48000> set audio sampling frequency rate, ex: wov cfgsfs 48000 means audio sampling rate are 48Khz. > wov cfgbck <32fs|48fs|64fs|128fs|256fs> set I2S bit clock rate, ex: wov cfgsfs 48000 and wov cfgbck 32fs means audio sampling rate are 1536Khz (32*48000). > wov cfgfmt <i2s|right|left|pcma|pcmb|tdm> set I2S but format, ex: wov cfgfmt right means audio I2S format are Right-Justify. > wov cfgmod <off|vad|ram|i2s|rami2s> set audio operation mode ,ex: wov cfgmod i2s means audio output via I2S bus. > wov cfgtdm <0~496 0~496 0~3> set TDM time slot, the first values is left channel delay counter, the second is right channel, and the 3rd is startup counting condition. (chosen LRCK raising or falling edge) . [Note: this command is just working on cfgmod equal to tdm] > wov cfgget retrieve above settings. > wov vadsens (currently not support, reserve for next version) > wov gain (0~31) set audio data gain value, ex: wov gain 10 means setting audio digital gain are 10dB. > wov cfgdck <1.0 | 2.4 | 3.0 > set digital MIC PDM clock rate. ex: wov cfgdck 2.4 means PDM clock are 2.4Mhz. ----------------------------------------------------------------------- This CL also adds the chip ID (0x24) for npcx7m7w. So the console command "version" can show the chip is npcx7m7w. BRANCH=none BUG=none TEST=No build errors for make buildall. TEST="BOARD=npcx7_evb make"; Flash the image on EVB; Test WoV function with console commands described above. Change-Id: Ief2b3e89edbd3e6d2a9d82d317a93c9f0b7a20cd Signed-off-by: Dror Goldstein <dror.goldstein@nuvoton.com> Signed-off-by: Simon Liang <CMLiang@nuvoton.com> Signed-off-by: CHLin <CHLIN56@nuvoton.com> Reviewed-on: https://chromium-review.googlesource.com/897314 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: CH Lin <chlin56@nuvoton.com> Reviewed-by: Scott Collyer <scollyer@chromium.org>
96 lines
2.8 KiB
C
96 lines
2.8 KiB
C
/* -*- mode:c -*-
|
|
*
|
|
* Copyright 2016 The Chromium OS Authors. All rights reserved.
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*/
|
|
|
|
CONSOLE_CHANNEL(CC_COMMAND, "command")
|
|
CONSOLE_CHANNEL(CC_ACCEL, "accel")
|
|
#ifdef CONFIG_BLUETOOTH_LE
|
|
CONSOLE_CHANNEL(CC_BLUETOOTH_LE, "bluetooth_le")
|
|
#ifdef CONFIG_BLUETOOTH_LL_DEBUG
|
|
CONSOLE_CHANNEL(CC_BLUETOOTH_LL, "bluetooth_ll")
|
|
#endif
|
|
#ifdef CONFIG_BLUETOOTH_HCI_DEBUG
|
|
CONSOLE_CHANNEL(CC_BLUETOOTH_HCI,"bluetooth_hci")
|
|
#endif
|
|
#endif /* CONFIG_BLUETOOTH_LE */
|
|
#ifdef CONFIG_EXTENSION_COMMAND
|
|
CONSOLE_CHANNEL(CC_EXTENSION, "extension")
|
|
#endif
|
|
#if defined(CONFIG_PHYSICAL_PRESENCE)
|
|
CONSOLE_CHANNEL(CC_CCD, "ccd")
|
|
#endif
|
|
CONSOLE_CHANNEL(CC_CHARGER, "charger")
|
|
CONSOLE_CHANNEL(CC_CHIPSET, "chipset")
|
|
CONSOLE_CHANNEL(CC_CLOCK, "clock")
|
|
#ifdef CONFIG_DMA
|
|
CONSOLE_CHANNEL(CC_DMA, "dma")
|
|
#endif
|
|
CONSOLE_CHANNEL(CC_EVENTS, "events")
|
|
#ifdef HAS_TASK_FPSENSOR
|
|
CONSOLE_CHANNEL(CC_FP, "fingerprint")
|
|
#endif
|
|
#ifdef CONFIG_GESTURE_SW_DETECTION
|
|
CONSOLE_CHANNEL(CC_GESTURE, "gesture")
|
|
#endif
|
|
CONSOLE_CHANNEL(CC_GPIO, "gpio")
|
|
#ifdef HAS_TASK_HOSTCMD
|
|
CONSOLE_CHANNEL(CC_HOSTCMD, "hostcmd")
|
|
#endif
|
|
#ifdef CONFIG_I2C
|
|
CONSOLE_CHANNEL(CC_I2C, "i2c")
|
|
#endif
|
|
CONSOLE_CHANNEL(CC_KEYBOARD, "keyboard")
|
|
CONSOLE_CHANNEL(CC_KEYSCAN, "keyscan")
|
|
CONSOLE_CHANNEL(CC_LIDANGLE, "lidangle")
|
|
#ifdef HAS_TASK_LIGHTBAR
|
|
CONSOLE_CHANNEL(CC_LIGHTBAR, "lightbar")
|
|
#endif
|
|
#ifdef CONFIG_LPC
|
|
CONSOLE_CHANNEL(CC_LPC, "lpc")
|
|
#endif
|
|
CONSOLE_CHANNEL(CC_MOTION_LID, "motionlid")
|
|
CONSOLE_CHANNEL(CC_MOTION_SENSE, "motionsense")
|
|
#ifdef HAS_TASK_PDCMD
|
|
CONSOLE_CHANNEL(CC_PD_HOST_CMD, "pdhostcm")
|
|
#endif
|
|
CONSOLE_CHANNEL(CC_PORT80, "port80")
|
|
#if defined(CONFIG_PWM) || defined(CONFIG_FANS)
|
|
CONSOLE_CHANNEL(CC_PWM, "pwm")
|
|
#endif
|
|
CONSOLE_CHANNEL(CC_SPI, "spi")
|
|
#ifdef CONFIG_RBOX
|
|
CONSOLE_CHANNEL(CC_RBOX, "rbox")
|
|
#endif
|
|
#ifdef CONFIG_SPS
|
|
CONSOLE_CHANNEL(CC_SPS, "sps")
|
|
#endif
|
|
#if defined(CONFIG_SWITCH) || defined(CONFIG_LID_SWITCH)
|
|
CONSOLE_CHANNEL(CC_SWITCH, "switch")
|
|
#endif
|
|
CONSOLE_CHANNEL(CC_SYSTEM, "system")
|
|
CONSOLE_CHANNEL(CC_TASK, "task")
|
|
#ifdef CONFIG_TOUCHPAD
|
|
CONSOLE_CHANNEL(CC_TOUCHPAD, "touchpad")
|
|
#endif
|
|
#ifdef CONFIG_DPTF
|
|
CONSOLE_CHANNEL(CC_DPTF, "dptf")
|
|
#endif
|
|
#ifdef CONFIG_ALS
|
|
CONSOLE_CHANNEL(CC_ALS, "als")
|
|
#endif
|
|
CONSOLE_CHANNEL(CC_THERMAL, "thermal")
|
|
CONSOLE_CHANNEL(CC_TPM, "tpm")
|
|
CONSOLE_CHANNEL(CC_USB, "usb")
|
|
CONSOLE_CHANNEL(CC_USBCHARGE, "usbcharge")
|
|
#if defined(CONFIG_USB_POWER_DELIVERY) || defined(CONFIG_USB_PD_TCPC)
|
|
CONSOLE_CHANNEL(CC_USBPD, "usbpd")
|
|
#endif
|
|
CONSOLE_CHANNEL(CC_VBOOT, "vboot")
|
|
#ifdef CONFIG_WAKE_ON_VOICE
|
|
CONSOLE_CHANNEL(CC_WOV, "wov")
|
|
#endif
|
|
CONSOLE_CHANNEL(CC_HOOK, "hook")
|