aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bcm27xx/patches-4.19/950-0399-staging-bcm2835-audio-Simplify-kctl-creation-helpers.patch
diff options
context:
space:
mode:
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>2020-02-08 21:58:55 +0100
committerAdrian Schmutzler <freifunk@adrianschmutzler.de>2020-02-14 14:10:51 +0100
commit7d7aa2fd924c27829ec25f825481554dd81bce97 (patch)
tree658b87b89331670266163e522ea5fb52535633cb /target/linux/bcm27xx/patches-4.19/950-0399-staging-bcm2835-audio-Simplify-kctl-creation-helpers.patch
parente7bfda2c243e66a75ff966ba04c28b1590b5d24c (diff)
downloadupstream-7d7aa2fd924c27829ec25f825481554dd81bce97.tar.gz
upstream-7d7aa2fd924c27829ec25f825481554dd81bce97.tar.bz2
upstream-7d7aa2fd924c27829ec25f825481554dd81bce97.zip
brcm2708: rename target to bcm27xx
This change makes the names of Broadcom targets consistent by using the common notation based on SoC/CPU ID (which is used internally anyway), bcmXXXX instead of brcmXXXX. This is even used for target TITLE in make menuconfig already, only the short target name used brcm so far. Despite, since subtargets range from bcm2708 to bcm2711, it seems appropriate to use bcm27xx instead of bcm2708 (again, as already done for BOARDNAME). This also renames the packages brcm2708-userland and brcm2708-gpu-fw. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> Acked-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'target/linux/bcm27xx/patches-4.19/950-0399-staging-bcm2835-audio-Simplify-kctl-creation-helpers.patch')
-rw-r--r--target/linux/bcm27xx/patches-4.19/950-0399-staging-bcm2835-audio-Simplify-kctl-creation-helpers.patch161
1 files changed, 161 insertions, 0 deletions
diff --git a/target/linux/bcm27xx/patches-4.19/950-0399-staging-bcm2835-audio-Simplify-kctl-creation-helpers.patch b/target/linux/bcm27xx/patches-4.19/950-0399-staging-bcm2835-audio-Simplify-kctl-creation-helpers.patch
new file mode 100644
index 0000000000..ec0530ba2a
--- /dev/null
+++ b/target/linux/bcm27xx/patches-4.19/950-0399-staging-bcm2835-audio-Simplify-kctl-creation-helpers.patch
@@ -0,0 +1,161 @@
+From c4766c1589a25608ffe6848722632be2f65d0951 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.de>
+Date: Tue, 4 Sep 2018 17:58:57 +0200
+Subject: [PATCH] staging: bcm2835-audio: Simplify kctl creation
+ helpers
+
+commit dc5c0eb1e8601206dffbfc302cbd190f89dcd040 upstream.
+
+Just a minor code refactoring and adding some const prefix.
+
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Tested-by: Stefan Wahren <stefan.wahren@i2se.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ .../vc04_services/bcm2835-audio/bcm2835-ctl.c | 69 +++++++------------
+ 1 file changed, 25 insertions(+), 44 deletions(-)
+
+--- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c
++++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c
+@@ -97,40 +97,34 @@ static int snd_bcm2835_ctl_put(struct sn
+
+ static DECLARE_TLV_DB_SCALE(snd_bcm2835_db_scale, CTRL_VOL_MIN, 1, 1);
+
+-static struct snd_kcontrol_new snd_bcm2835_ctl[] = {
++static const struct snd_kcontrol_new snd_bcm2835_ctl[] = {
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "PCM Playback Volume",
+- .index = 0,
+ .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_TLV_READ,
+ .private_value = PCM_PLAYBACK_VOLUME,
+ .info = snd_bcm2835_ctl_info,
+ .get = snd_bcm2835_ctl_get,
+ .put = snd_bcm2835_ctl_put,
+- .count = 1,
+ .tlv = {.p = snd_bcm2835_db_scale}
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "PCM Playback Switch",
+- .index = 0,
+ .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
+ .private_value = PCM_PLAYBACK_MUTE,
+ .info = snd_bcm2835_ctl_info,
+ .get = snd_bcm2835_ctl_get,
+ .put = snd_bcm2835_ctl_put,
+- .count = 1,
+ },
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "PCM Playback Route",
+- .index = 0,
+ .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
+ .private_value = PCM_PLAYBACK_DEVICE,
+ .info = snd_bcm2835_ctl_info,
+ .get = snd_bcm2835_ctl_get,
+ .put = snd_bcm2835_ctl_put,
+- .count = 1,
+ },
+ };
+
+@@ -196,7 +190,7 @@ static int snd_bcm2835_spdif_mask_get(st
+ return 0;
+ }
+
+-static struct snd_kcontrol_new snd_bcm2835_spdif[] = {
++static const struct snd_kcontrol_new snd_bcm2835_spdif[] = {
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_PCM,
+ .name = SNDRV_CTL_NAME_IEC958("", PLAYBACK, DEFAULT),
+@@ -213,28 +207,32 @@ static struct snd_kcontrol_new snd_bcm28
+ },
+ };
+
+-int snd_bcm2835_new_ctl(struct bcm2835_chip *chip)
++static int create_ctls(struct bcm2835_chip *chip, size_t size,
++ const struct snd_kcontrol_new *kctls)
+ {
+- int err;
+- unsigned int idx;
++ int i, err;
+
+- strcpy(chip->card->mixername, "Broadcom Mixer");
+- for (idx = 0; idx < ARRAY_SIZE(snd_bcm2835_ctl); idx++) {
+- err = snd_ctl_add(chip->card,
+- snd_ctl_new1(&snd_bcm2835_ctl[idx], chip));
+- if (err < 0)
+- return err;
+- }
+- for (idx = 0; idx < ARRAY_SIZE(snd_bcm2835_spdif); idx++) {
+- err = snd_ctl_add(chip->card,
+- snd_ctl_new1(&snd_bcm2835_spdif[idx], chip));
++ for (i = 0; i < size; i++) {
++ err = snd_ctl_add(chip->card, snd_ctl_new1(&kctls[i], chip));
+ if (err < 0)
+ return err;
+ }
+ return 0;
+ }
+
+-static struct snd_kcontrol_new snd_bcm2835_headphones_ctl[] = {
++int snd_bcm2835_new_ctl(struct bcm2835_chip *chip)
++{
++ int err;
++
++ strcpy(chip->card->mixername, "Broadcom Mixer");
++ err = create_ctls(chip, ARRAY_SIZE(snd_bcm2835_ctl), snd_bcm2835_ctl);
++ if (err < 0)
++ return err;
++ return create_ctls(chip, ARRAY_SIZE(snd_bcm2835_spdif),
++ snd_bcm2835_spdif);
++}
++
++static const struct snd_kcontrol_new snd_bcm2835_headphones_ctl[] = {
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "Headphone Playback Volume",
+@@ -263,21 +261,12 @@ static struct snd_kcontrol_new snd_bcm28
+
+ int snd_bcm2835_new_headphones_ctl(struct bcm2835_chip *chip)
+ {
+- int err;
+- unsigned int idx;
+-
+ strcpy(chip->card->mixername, "Broadcom Mixer");
+- for (idx = 0; idx < ARRAY_SIZE(snd_bcm2835_headphones_ctl); idx++) {
+- err = snd_ctl_add(chip->card,
+- snd_ctl_new1(&snd_bcm2835_headphones_ctl[idx],
+- chip));
+- if (err)
+- return err;
+- }
+- return 0;
++ return create_ctls(chip, ARRAY_SIZE(snd_bcm2835_headphones_ctl),
++ snd_bcm2835_headphones_ctl);
+ }
+
+-static struct snd_kcontrol_new snd_bcm2835_hdmi[] = {
++static const struct snd_kcontrol_new snd_bcm2835_hdmi[] = {
+ {
+ .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .name = "HDMI Playback Volume",
+@@ -306,16 +295,8 @@ static struct snd_kcontrol_new snd_bcm28
+
+ int snd_bcm2835_new_hdmi_ctl(struct bcm2835_chip *chip)
+ {
+- int err;
+- unsigned int idx;
+-
+ strcpy(chip->card->mixername, "Broadcom Mixer");
+- for (idx = 0; idx < ARRAY_SIZE(snd_bcm2835_hdmi); idx++) {
+- err = snd_ctl_add(chip->card,
+- snd_ctl_new1(&snd_bcm2835_hdmi[idx], chip));
+- if (err)
+- return err;
+- }
+- return 0;
++ return create_ctls(chip, ARRAY_SIZE(snd_bcm2835_hdmi),
++ snd_bcm2835_hdmi);
+ }
+