From: "Amadeusz Sławiński" <amadeuszx.slawinski@linux.intel.com>
To: Raphael-Xu <13691752556@139.com>, broonie@kernel.org
Cc: alsa-devel@alsa-project.org, raphael-xu@ti.com,
shenghao-ding@ti.com, navada@ti.com
Subject: Re: [PATCH v1] add tas2780
Date: Mon, 4 Jul 2022 14:30:09 +0200 [thread overview]
Message-ID: <f1ebe9c6-0809-084e-2361-4d13c09b2037@linux.intel.com> (raw)
In-Reply-To: <20220704104759.21083-1-13691752556@139.com>
On 7/4/2022 12:47 PM, Raphael-Xu wrote:
> 1.update Kconfig and Makefile 2.add tas2780.c and tas2780.h
>
> Signed-off-by: Raphael-Xu <13691752556@139.com>
> ---
...
> diff --git a/sound/soc/codecs/tas2780.c b/sound/soc/codecs/tas2780.c
> new file mode 100644
> index 000000000000..0e452c7464fb
> --- /dev/null
> +++ b/sound/soc/codecs/tas2780.c
> @@ -0,0 +1,726 @@
> +// SPDX-License-Identifier: GPL-2.0
> +// Driver for the Texas Instruments TAS2780 Mono
> +// Audio amplifier
> +// Copyright (C) 2022 Texas Instruments Inc.
> +
> +#include <linux/module.h>
> +#include <linux/moduleparam.h>
> +#include <linux/err.h>
> +#include <linux/init.h>
> +#include <linux/delay.h>
> +#include <linux/pm.h>
> +#include <linux/i2c.h>
> +#include <linux/gpio.h>
> +#include <linux/gpio/consumer.h>
> +#include <linux/regmap.h>
> +#include <linux/of.h>
> +#include <linux/of_gpio.h>
> +#include <sound/soc.h>
> +#include <sound/pcm.h>
> +#include <sound/pcm_params.h>
> +#include <sound/initval.h>
> +#include <sound/tlv.h>
> +
> +#include "tas2780.h"
> +
> +struct tas2780_priv {
> + struct snd_soc_component *component;
> + struct gpio_desc *reset_gpio;
> + struct gpio_desc *sdz_gpio;
> + struct regmap *regmap;
> + struct device *dev;
> + int v_sense_slot;
> + int i_sense_slot;
> +
Unnecessary empty line?
> +};
> +
> +static void tas2780_reset(struct tas2780_priv *tas2780)
> +{
> + if (tas2780->reset_gpio) {
> + gpiod_set_value_cansleep(tas2780->reset_gpio, 0);
> + usleep_range(2000, 2050);
> + gpiod_set_value_cansleep(tas2780->reset_gpio, 1);
> + usleep_range(2000, 2050);
> + }
> +
> + snd_soc_component_write(tas2780->component, TAS2780_SW_RST,
> + TAS2780_RST);
> +}
> +
...
> +
> +static const struct snd_soc_component_driver soc_component_driver_tas2780 = {
> + .probe = tas2780_codec_probe,
> +#ifdef CONFIG_PM
> + .suspend = tas2780_codec_suspend,
> + .resume = tas2780_codec_resume,
> +#endif
> + .controls = tas2780_snd_controls,
> + .num_controls = ARRAY_SIZE(tas2780_snd_controls),
> + .dapm_widgets = tas2780_dapm_widgets,
> + .num_dapm_widgets = ARRAY_SIZE(tas2780_dapm_widgets),
> + .dapm_routes = tas2780_audio_map,
> + .num_dapm_routes = ARRAY_SIZE(tas2780_audio_map),
> + .idle_bias_on = 1,
> + .endianness = 1,
> + .non_legacy_dai_naming = 1,
From what I see change removing non_legacy_dai_naming field is merged
in for-next branch, so you can skip it, as it is default now.
> +};
> +
> +static const struct reg_default tas2780_reg_defaults[] = {
> + { TAS2780_PAGE, 0x00 },
> + { TAS2780_SW_RST, 0x00 },
> + { TAS2780_PWR_CTRL, 0x1a },
> + { TAS2780_DVC, 0x00 },
> + { TAS2780_CHNL_0, 0x00 },
> + { TAS2780_TDM_CFG0, 0x09 },
> + { TAS2780_TDM_CFG1, 0x02 },
> + { TAS2780_TDM_CFG2, 0x0a },
> + { TAS2780_TDM_CFG3, 0x10 },
> + { TAS2780_TDM_CFG5, 0x42 },
> +};
> +
next prev parent reply other threads:[~2022-07-04 12:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-04 10:47 [PATCH v1] add tas2780 Raphael-Xu
2022-07-04 11:43 ` Mark Brown
2022-07-04 12:30 ` Amadeusz Sławiński [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-07-06 10:18 Raphael-Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f1ebe9c6-0809-084e-2361-4d13c09b2037@linux.intel.com \
--to=amadeuszx.slawinski@linux.intel.com \
--cc=13691752556@139.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=navada@ti.com \
--cc=raphael-xu@ti.com \
--cc=shenghao-ding@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox