At Tue, 25 Feb 2014 14:59:49 +0800, bardliao@realtek.com wrote:
From: Bard Liao bardliao@realtek.com
This patch adds the ALC286 codec driver.
Signed-off-by: Bard Liao bardliao@realtek.com Signed-off-by: Gustaw Lewandowski gustaw.lewandowski@intel.com
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.
- A HD-A verb command contains three parts, NID, VID, and PID. And an I2S command contains only two parts: address and data.
- Not only the register address is written, but the read command also includes the entire write command.
- rt286 uses different registers for read and write the same bits.
As a result, standard regmap is difficult to be used on ALC286. We don't request a standard I/O by snd_soc_codec_set_cache_io anymore. Now we have ,reg_write and .reg_read functions for ALC286's I/O. And we don't use cache due to item 3 above. Some dummy registers (address <= 0xff) are defined for dapm routing. Thhe dummy registers are cache only. Due to item 2 above, HD-A verb commands are put into the address part of regmap. When we issue HD-A verb write commands, the data part of regmap is zero.
The jack detection function is done by Lewandowski Gustaw. So I add Gustaw's Signed-off-by line in this patch
The difference between this version and previous version is listed below.
- Use regmap_read/write instead of rt286_read/write to read write codec.
- Use the standard jack detection APIs for jack detection.
- Power off on bias level STANDBY.
- Add .symmetric_rates = 1.
- Add gpio2_en and remove irq_en in platform data.
- Other minor changes.
You should put these in the patch changelog. The texts after the line "---" are ignored when applied to git.
--- /dev/null +++ b/sound/soc/codecs/rt286.c @@ -0,0 +1,1369 @@ +/*
- rt286.c -- RT286 ALSA SoC audio codec driver
- Copyright 2013 Realtek Semiconductor Corp.
- Author: Bard Liao bardliao@realtek.com
- 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.
- */
+#include <linux/module.h> +#include <linux/moduleparam.h> +#include <linux/init.h> +#include <linux/delay.h> +#include <linux/pm.h> +#include <linux/i2c.h> +#include <linux/platform_device.h> +#include <linux/spi/spi.h> +#include <linux/acpi.h> +#include <sound/core.h> +#include <sound/pcm.h> +#include <sound/pcm_params.h> +#include <sound/soc.h> +#include <sound/soc-dapm.h> +#include <sound/initval.h> +#include <sound/tlv.h> +#include <sound/jack.h> +#include <sound/rt286.h>
+#include "../../pci/hda/hda_codec.h"
Don't include this header here. The HD-audio verbs are defined in sound/hda_verbs.h in the usptream tree, so include it instead.
Takashi