[alsa-devel] [PATCH v4] ASoC: add RT286 CODEC driver

Takashi Iwai tiwai at suse.de
Tue Feb 25 09:23:33 CET 2014


At Tue, 25 Feb 2014 14:59:49 +0800,
<bardliao at realtek.com> wrote:
> 
> From: Bard Liao <bardliao at realtek.com>
> 
> This patch adds the ALC286 codec driver.
> 
> Signed-off-by: Bard Liao <bardliao at realtek.com>
> Signed-off-by: Gustaw Lewandowski <gustaw.lewandowski at 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.
> 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.
> 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 at 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


More information about the Alsa-devel mailing list