openwrt/target/linux/brcm2708/patches-4.14/950-0310-Added-mute-stream-func.patch

165 lines
5.2 KiB
Diff
Raw Normal View History

brcm2708: add kernel 4.14 support Patch generation process: - rebase rpi/rpi-4.14.y on v4.14.89 from linux-stable - git format-patch v4.14.89 Patches skipped during rebase: - lan78xx: Read MAC address from DT if present - lan78xx: Enable LEDs and auto-negotiation - Revert "softirq: Let ksoftirqd do its job" - sc16is7xx: Fix for multi-channel stall - lan78xx: Ignore DT MAC address if already valid - lan78xx: Simple patch to prevent some crashes - tcp_write_queue_purge clears all the SKBs in the write queue - Revert "lan78xx: Simple patch to prevent some crashes" - lan78xx: Connect phy early - Arm: mm: ftrace: Only set text back to ro after kernel has been marked ro - Revert "Revert "softirq: Let ksoftirqd do its job"" - ASoC: cs4265: SOC_SINGLE register value error fix - Revert "ASoC: cs4265: SOC_SINGLE register value error fix" - Revert "net: pskb_trim_rcsum() and CHECKSUM_COMPLETE are friends" - Revert "Revert "net: pskb_trim_rcsum() and CHECKSUM_COMPLETE are friends"" Patches dropped after rebase: - net: Add non-mainline source for rtl8192cu wlan - net: Fix rtl8192cu build errors on other platforms - brcm: adds support for BCM43341 wifi - brcmfmac: Mute expected startup 'errors' - ARM64: Fix build break for RTL8187/RTL8192CU wifi - ARM64: Enable RTL8187/RTL8192CU wifi in build config - This is the driver for Sony CXD2880 DVB-T2/T tuner + demodulator - brcmfmac: add CLM download support - brcmfmac: request_firmware_direct is quieter - Sets the BCDC priority to constant 0 - brcmfmac: Disable ARP offloading when promiscuous - brcmfmac: Avoid possible out-of-bounds read - brcmfmac: Delete redundant length check - net: rtl8192cu: Normalize indentation - net: rtl8192cu: Fix implicit fallthrough warnings - Revert "Sets the BCDC priority to constant 0" - media: cxd2880: Bump to match 4.18.y version - media: cxd2880-spi: Bump to match 4.18.y version - Revert "mm: alloc_contig: re-allow CMA to compact FS pages" - Revert "Revert "mm: alloc_contig: re-allow CMA to compact FS pages"" - cxd2880: CXD2880_SPI_DRV should select DVB_CXD2880 with MEDIA_SUBDRV_AUTOSELECT - 950-0421-HID-hid-bigbenff-driver-for-BigBen-Interactive-PS3OF.patch - 950-0453-Add-hid-bigbenff-to-list-of-have_special_driver-for-.patch Make I2C built-in instead of modular as in upstream defconfig; also the easiest way to get MFD_ARIZONA enabled, which is required by kmod-sound-soc-rpi-cirrus. Add missing compatible strings from 4.9/960-add-rasbperrypi-compatible.patch, using upstream names for compute modules. Add extra patch to enable the LEDs on lan78xx. Compile-tested: bcm2708, bcm2709, bcm2710 (with CONFIG_ALL_KMODS=y) Runtime-tested: bcm2708, bcm2710 Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2018-11-10 11:03:18 +00:00
From f0bf1ca3f2e7fc889d0d01c292df4faa25af6d86 Mon Sep 17 00:00:00 2001
From: Jaikumar <jaikumar@cem-solutions.net>
Date: Thu, 7 Jun 2018 21:22:45 +0530
Subject: [PATCH 310/454] Added mute stream func
Signed-off-by: Jaikumar <jaikumar@cem-solutions.net>
---
sound/soc/bcm/allo-katana-codec.c | 64 ++++++++++++++++++++++---------
1 file changed, 46 insertions(+), 18 deletions(-)
--- a/sound/soc/bcm/allo-katana-codec.c
+++ b/sound/soc/bcm/allo-katana-codec.c
@@ -31,21 +31,23 @@
#define KATANA_CODEC_CHIP_ID 0x30
#define KATANA_CODEC_VIRT_BASE 0x100
-#define KATANA_CODEC_PAGE 0
+#define KATANA_CODEC_PAGE 0
#define KATANA_CODEC_CHIP_ID_REG (KATANA_CODEC_VIRT_BASE + 0)
-#define KATANA_CODEC_RESET (KATANA_CODEC_VIRT_BASE + 1)
+#define KATANA_CODEC_RESET (KATANA_CODEC_VIRT_BASE + 1)
#define KATANA_CODEC_VOLUME_1 (KATANA_CODEC_VIRT_BASE + 2)
#define KATANA_CODEC_VOLUME_2 (KATANA_CODEC_VIRT_BASE + 3)
-#define KATANA_CODEC_MUTE (KATANA_CODEC_VIRT_BASE + 4)
+#define KATANA_CODEC_MUTE (KATANA_CODEC_VIRT_BASE + 4)
#define KATANA_CODEC_DSP_PROGRAM (KATANA_CODEC_VIRT_BASE + 5)
#define KATANA_CODEC_DEEMPHASIS (KATANA_CODEC_VIRT_BASE + 6)
-#define KATANA_CODEC_DOP (KATANA_CODEC_VIRT_BASE + 7)
-#define KATANA_CODEC_FORMAT (KATANA_CODEC_VIRT_BASE + 8)
+#define KATANA_CODEC_DOP (KATANA_CODEC_VIRT_BASE + 7)
+#define KATANA_CODEC_FORMAT (KATANA_CODEC_VIRT_BASE + 8)
#define KATANA_CODEC_COMMAND (KATANA_CODEC_VIRT_BASE + 9)
-#define KATANA_CODEC_MAX_REGISTER (KATANA_CODEC_VIRT_BASE + 9)
+#define KATANA_CODEC_MUTE_STREAM (KATANA_CODEC_VIRT_BASE + 10)
-#define KATANA_CODEC_FMT 0xff
+#define KATANA_CODEC_MAX_REGISTER (KATANA_CODEC_VIRT_BASE + 10)
+
+#define KATANA_CODEC_FMT 0xff
#define KATANA_CODEC_CHAN_MONO 0x00
#define KATANA_CODEC_CHAN_STEREO 0x80
#define KATANA_CODEC_ALEN_16 0x10
@@ -76,7 +78,7 @@ static const struct reg_default katana_c
{ KATANA_CODEC_MUTE, 0x00 },
{ KATANA_CODEC_DSP_PROGRAM, 0x04 },
{ KATANA_CODEC_DEEMPHASIS, 0x00 },
- { KATANA_CODEC_DOP, 0x01 },
+ { KATANA_CODEC_DOP, 0x01 },
{ KATANA_CODEC_FORMAT, 0xb4 },
};
@@ -135,7 +137,8 @@ static const struct snd_kcontrol_new kat
SOC_SINGLE("DoP Playback Switch", KATANA_CODEC_DOP, 0, 1, 1)
};
-static bool katana_codec_readable_register(struct device *dev, unsigned int reg)
+static bool katana_codec_readable_register(struct device *dev,
+ unsigned int reg)
{
switch (reg) {
case KATANA_CODEC_CHIP_ID_REG:
@@ -150,13 +153,15 @@ static int katana_codec_hw_params(struct
struct snd_soc_dai *dai)
{
struct snd_soc_codec *codec = dai->codec;
- struct katana_codec_priv *katana_codec = snd_soc_codec_get_drvdata(codec);
+ struct katana_codec_priv *katana_codec =
+ snd_soc_codec_get_drvdata(codec);
int fmt = 0;
int ret;
- dev_dbg(codec->dev, "hw_params %u Hz, %u channels\n",
+ dev_dbg(codec->dev, "hw_params %u Hz, %u channels %u bits\n",
params_rate(params),
- params_channels(params));
+ params_channels(params),
+ params_width(params));
switch (katana_codec->fmt & SND_SOC_DAIFMT_MASTER_MASK) {
case SND_SOC_DAIFMT_CBM_CFM: // master
@@ -212,13 +217,17 @@ static int katana_codec_hw_params(struct
return -EINVAL;
}
- ret = regmap_write(katana_codec->regmap, KATANA_CODEC_FORMAT, fmt);
+ ret = regmap_write(katana_codec->regmap, KATANA_CODEC_FORMAT,
+ fmt);
if (ret != 0) {
dev_err(codec->dev, "Failed to set format: %d\n", ret);
return ret;
}
break;
+ case SND_SOC_DAIFMT_CBS_CFS:
+ break;
+
default:
return -EINVAL;
}
@@ -229,14 +238,33 @@ static int katana_codec_hw_params(struct
static int katana_codec_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
{
struct snd_soc_codec *codec = dai->codec;
- struct katana_codec_priv *katana_codec = snd_soc_codec_get_drvdata(codec);
+ struct katana_codec_priv *katana_codec =
+ snd_soc_codec_get_drvdata(codec);
katana_codec->fmt = fmt;
return 0;
}
+int katana_codec_dai_mute_stream(struct snd_soc_dai *dai, int mute,
+ int stream)
+{
+ struct snd_soc_codec *codec = dai->codec;
+ struct katana_codec_priv *katana_codec =
+ snd_soc_codec_get_drvdata(codec);
+ int ret = 0;
+
+ ret = regmap_write(katana_codec->regmap, KATANA_CODEC_MUTE_STREAM,
+ mute);
+ if (ret != 0) {
+ dev_err(codec->dev, "Failed to set mute: %d\n", ret);
+ return ret;
+ }
+ return ret;
+}
+
static const struct snd_soc_dai_ops katana_codec_dai_ops = {
+ .mute_stream = katana_codec_dai_mute_stream,
.hw_params = katana_codec_hw_params,
.set_fmt = katana_codec_set_fmt,
};
@@ -260,7 +288,7 @@ static struct snd_soc_codec_driver katan
.idle_bias_off = false,
.component_driver = {
- .controls = katana_codec_controls,
+ .controls = katana_codec_controls,
.num_controls = ARRAY_SIZE(katana_codec_controls),
},
};
@@ -302,7 +330,7 @@ static int allo_katana_codec_probe(struc
return PTR_ERR(regmap);
katana_codec = devm_kzalloc(dev, sizeof(struct katana_codec_priv),
- GFP_KERNEL);
+ GFP_KERNEL);
if (!katana_codec)
return -ENOMEM;
@@ -350,8 +378,8 @@ static struct i2c_driver allo_katana_cod
.remove = allo_katana_codec_remove,
.id_table = allo_katana_codec_id,
.driver = {
- .name = "allo-katana-codec",
- .of_match_table = allo_katana_codec_of_match,
+ .name = "allo-katana-codec",
+ .of_match_table = allo_katana_codec_of_match,
},
};