Commit 92088477 authored by Daniel Baluta's avatar Daniel Baluta Committed by Mark Brown

ASoC: ak5558: Add support for AK5558 ADC driver

AK5558 is a 32-bit, 768 kHZ sampling, differential input ADC
for digital audio systems.

Datasheet is available at:

https://www.akm.com/akm/en/file/datasheet/AK5558VN.pdf

Initial patch includes support for normal and TDM modes.
Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: default avatarFabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: default avatarJunichi Wakasugi <wakasugi.jb@om.asahi-kasei.co.jp>
[initial coding for 3.18 kernel]
Signed-off-by: default avatarMihai Serban <mihai.serban@nxp.com>
[cleanups and porting to 4.9 kernel]
Signed-off-by: default avatarShengjiu Wang <shengjiu.wang@nxp.com>
[tdm support]
Signed-off-by: default avatarDaniel Baluta <daniel.baluta@nxp.com>
[pm support, cleanups and porting to latest kernel]
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 7928b2cb
......@@ -42,6 +42,7 @@ config SND_SOC_ALL_CODECS
select SND_SOC_AK4642 if I2C
select SND_SOC_AK4671 if I2C
select SND_SOC_AK5386
select SND_SOC_AK5558 if I2C
select SND_SOC_ALC5623 if I2C
select SND_SOC_ALC5632 if I2C
select SND_SOC_BT_SCO
......@@ -398,6 +399,11 @@ config SND_SOC_AK4671
config SND_SOC_AK5386
tristate "AKM AK5638 CODEC"
config SND_SOC_AK5558
tristate "AKM AK5558 CODEC"
depends on I2C
select REGMAP_I2C
config SND_SOC_ALC5623
tristate "Realtek ALC5623 CODEC"
depends on I2C
......
......@@ -34,6 +34,7 @@ snd-soc-ak4641-objs := ak4641.o
snd-soc-ak4642-objs := ak4642.o
snd-soc-ak4671-objs := ak4671.o
snd-soc-ak5386-objs := ak5386.o
snd-soc-ak5558-objs := ak5558.o
snd-soc-arizona-objs := arizona.o
snd-soc-bt-sco-objs := bt-sco.o
snd-soc-cq93vc-objs := cq93vc.o
......@@ -277,6 +278,7 @@ obj-$(CONFIG_SND_SOC_AK4641) += snd-soc-ak4641.o
obj-$(CONFIG_SND_SOC_AK4642) += snd-soc-ak4642.o
obj-$(CONFIG_SND_SOC_AK4671) += snd-soc-ak4671.o
obj-$(CONFIG_SND_SOC_AK5386) += snd-soc-ak5386.o
obj-$(CONFIG_SND_SOC_AK5558) += snd-soc-ak5558.o
obj-$(CONFIG_SND_SOC_ALC5623) += snd-soc-alc5623.o
obj-$(CONFIG_SND_SOC_ALC5632) += snd-soc-alc5632.o
obj-$(CONFIG_SND_SOC_ARIZONA) += snd-soc-arizona.o
......
This diff is collapsed.
// SPDX-License-Identifier: GPL-2.0
/*
* Audio driver header for AK5558
*
* Copyright (C) 2016 Asahi Kasei Microdevices Corporation
* Copyright 2018 NXP
*/
#ifndef _AK5558_H
#define _AK5558_H
#define AK5558_00_POWER_MANAGEMENT1 0x00
#define AK5558_01_POWER_MANAGEMENT2 0x01
#define AK5558_02_CONTROL1 0x02
#define AK5558_03_CONTROL2 0x03
#define AK5558_04_CONTROL3 0x04
#define AK5558_05_DSD 0x05
/* AK5558_02_CONTROL1 fields */
#define AK5558_DIF GENMASK(1, 1)
#define AK5558_DIF_MSB_MODE (0 << 1)
#define AK5558_DIF_I2S_MODE (1 << 1)
#define AK5558_BITS GENMASK(2, 2)
#define AK5558_DIF_24BIT_MODE (0 << 2)
#define AK5558_DIF_32BIT_MODE (1 << 2)
#define AK5558_CKS GENMASK(6, 3)
#define AK5558_CKS_128FS_192KHZ (0 << 3)
#define AK5558_CKS_192FS_192KHZ (1 << 3)
#define AK5558_CKS_256FS_48KHZ (2 << 3)
#define AK5558_CKS_256FS_96KHZ (3 << 3)
#define AK5558_CKS_384FS_96KHZ (4 << 3)
#define AK5558_CKS_384FS_48KHZ (5 << 3)
#define AK5558_CKS_512FS_48KHZ (6 << 3)
#define AK5558_CKS_768FS_48KHZ (7 << 3)
#define AK5558_CKS_64FS_384KHZ (8 << 3)
#define AK5558_CKS_32FS_768KHZ (9 << 3)
#define AK5558_CKS_96FS_384KHZ (10 << 3)
#define AK5558_CKS_48FS_768KHZ (11 << 3)
#define AK5558_CKS_64FS_768KHZ (12 << 3)
#define AK5558_CKS_1024FS_16KHZ (13 << 3)
#define AK5558_CKS_AUTO (15 << 3)
/* AK5558_03_CONTROL2 fields */
#define AK5558_MODE_BITS GENMASK(6, 5)
#define AK5558_MODE_NORMAL (0 << 5)
#define AK5558_MODE_TDM128 (1 << 5)
#define AK5558_MODE_TDM256 (2 << 5)
#define AK5558_MODE_TDM512 (3 << 5)
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment