Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 07cf7cba authored by Bard Liao's avatar Bard Liao Committed by Mark Brown
Browse files

ASoC: add RT286 CODEC driver



This patch adds Realtek ALC286 codec driver.

ALC286 is a dual mode codec, which can run as HD-A or I2S mode.
It is controlled by HD-A verb commands via I2C protocol.
The following is the I/O difference between ALC286 and general I2S codecs.
1. A HD-A verb command contains three parts, NID, VID, and PID.
   And an I2S command contains only two parts: address and data.
2. Not only the register address is written, but the read command also
   includes the entire write command.
3. rt286 uses different registers for read and write the same bits.

We map verb command to regmap structure. However, we read most registers from
cache to prevent the asymmetry read/write issue in rt286.

Signed-off-by: default avatarBard Liao <bardliao@realtek.com>
Signed-off-by: default avatarGustaw Lewandowski <gustaw.lewandowski@intel.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 7171511e
Loading
Loading
Loading
Loading

include/sound/rt286.h

0 → 100644
+19 −0
Original line number Diff line number Diff line
/*
 * linux/sound/rt286.h -- Platform data for RT286
 *
 * Copyright 2013 Realtek Microelectronics
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

#ifndef __LINUX_SND_RT286_H
#define __LINUX_SND_RT286_H

struct rt286_platform_data {
	bool cbj_en; /*combo jack enable*/
	bool gpio2_en; /*GPIO2 enable*/
};

#endif
+4 −0
Original line number Diff line number Diff line
@@ -74,6 +74,7 @@ config SND_SOC_ALL_CODECS
	select SND_SOC_PCM3008
	select SND_SOC_PCM512x_I2C if I2C
	select SND_SOC_PCM512x_SPI if SPI_MASTER
	select SND_SOC_RT286 if I2C
	select SND_SOC_RT5631 if I2C
	select SND_SOC_RT5640 if I2C
	select SND_SOC_RT5645 if I2C
@@ -449,6 +450,9 @@ config SND_SOC_RL6231
	default m if SND_SOC_RT5645=m
	default m if SND_SOC_RT5651=m

config SND_SOC_RT286
	tristate

config SND_SOC_RT5631
	tristate

+2 −0
Original line number Diff line number Diff line
@@ -68,6 +68,7 @@ snd-soc-pcm512x-objs := pcm512x.o
snd-soc-pcm512x-i2c-objs := pcm512x-i2c.o
snd-soc-pcm512x-spi-objs := pcm512x-spi.o
snd-soc-rl6231-objs := rl6231.o
snd-soc-rt286-objs := rt286.o
snd-soc-rt5631-objs := rt5631.o
snd-soc-rt5640-objs := rt5640.o
snd-soc-rt5645-objs := rt5645.o
@@ -233,6 +234,7 @@ obj-$(CONFIG_SND_SOC_PCM512x) += snd-soc-pcm512x.o
obj-$(CONFIG_SND_SOC_PCM512x_I2C)	+= snd-soc-pcm512x-i2c.o
obj-$(CONFIG_SND_SOC_PCM512x_SPI)	+= snd-soc-pcm512x-spi.o
obj-$(CONFIG_SND_SOC_RL6231)	+= snd-soc-rl6231.o
obj-$(CONFIG_SND_SOC_RT286)	+= snd-soc-rt286.o
obj-$(CONFIG_SND_SOC_RT5631)	+= snd-soc-rt5631.o
obj-$(CONFIG_SND_SOC_RT5640)	+= snd-soc-rt5640.o
obj-$(CONFIG_SND_SOC_RT5645)	+= snd-soc-rt5645.o