diff --git a/packages/graphics/bcm2835-driver/package.mk b/packages/graphics/bcm2835-driver/package.mk index ed798cec5c..4ec74e3ee0 100644 --- a/packages/graphics/bcm2835-driver/package.mk +++ b/packages/graphics/bcm2835-driver/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="bcm2835-driver" -PKG_VERSION="2ef9cb6" +PKG_VERSION="e5ca26f" PKG_ARCH="any" PKG_LICENSE="nonfree" PKG_SITE="http://www.broadcom.com" diff --git a/packages/linux/package.mk b/packages/linux/package.mk index 4f949385bc..07fb2cde7e 100644 --- a/packages/linux/package.mk +++ b/packages/linux/package.mk @@ -59,7 +59,7 @@ case "$LINUX" in PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET imx6-status-led imx6-soc-fan irqbalanced" ;; *) - PKG_VERSION="4.9.13" + PKG_VERSION="4.9.20" PKG_URL="http://www.kernel.org/pub/linux/kernel/v4.x/$PKG_NAME-$PKG_VERSION.tar.xz" PKG_PATCH_DIRS="default" ;; diff --git a/packages/linux/patches/default/linux-063-fix-rc-raw-decoder-loading.patch b/packages/linux/patches/default/linux-063-fix-rc-raw-decoder-loading.patch deleted file mode 100644 index 69f6eb3e9f..0000000000 --- a/packages/linux/patches/default/linux-063-fix-rc-raw-decoder-loading.patch +++ /dev/null @@ -1,46 +0,0 @@ -From d13ee07f431c94ea72320ea4136e75ebeaee98c1 Mon Sep 17 00:00:00 2001 -From: Matthias Reichl -Date: Fri, 3 Mar 2017 10:27:44 +0100 -Subject: [PATCH] backport: rc: raw decoder for keymap protocol is not loaded - on register - -see http://www.spinics.net/lists/linux-media/msg111651.html ---- - drivers/media/rc/rc-main.c | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - -diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c -index dedaf38..9a397da 100644 ---- a/drivers/media/rc/rc-main.c -+++ b/drivers/media/rc/rc-main.c -@@ -1441,6 +1441,7 @@ int rc_register_device(struct rc_dev *dev) - int attr = 0; - int minor; - int rc; -+ u64 rc_type; - - if (!dev || !dev->map_name) - return -EINVAL; -@@ -1526,14 +1527,18 @@ int rc_register_device(struct rc_dev *dev) - goto out_input; - } - -+ rc_type = BIT_ULL(rc_map->rc_type); -+ - if (dev->change_protocol) { -- u64 rc_type = (1ll << rc_map->rc_type); - rc = dev->change_protocol(dev, &rc_type); - if (rc < 0) - goto out_raw; - dev->enabled_protocols = rc_type; - } - -+ if (dev->driver_type == RC_DRIVER_IR_RAW) -+ ir_raw_load_modules(&rc_type); -+ - /* Allow the RC sysfs nodes to be accessible */ - atomic_set(&dev->initialized, 1); - --- -2.1.4 - diff --git a/packages/tools/bcm2835-bootloader/package.mk b/packages/tools/bcm2835-bootloader/package.mk index bda3d50521..3d88e3050f 100644 --- a/packages/tools/bcm2835-bootloader/package.mk +++ b/packages/tools/bcm2835-bootloader/package.mk @@ -17,7 +17,7 @@ ################################################################################ PKG_NAME="bcm2835-bootloader" -PKG_VERSION="2ef9cb6" +PKG_VERSION="e5ca26f" PKG_ARCH="arm" PKG_LICENSE="nonfree" PKG_SITE="http://www.broadcom.com" diff --git a/projects/RPi/linux/linux.arm.conf b/projects/RPi/linux/linux.arm.conf index 696dc44707..a9d1c0b9b7 100644 --- a/projects/RPi/linux/linux.arm.conf +++ b/projects/RPi/linux/linux.arm.conf @@ -1,6 +1,6 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/arm 4.9.13 Kernel Configuration +# Linux/arm 4.9.20 Kernel Configuration # CONFIG_ARM=y CONFIG_ARM_HAS_SG_CHAIN=y @@ -2775,6 +2775,7 @@ CONFIG_SND_SOC_COMPRESS=y # CONFIG_SND_SOC_AMD_ACP is not set # CONFIG_SND_ATMEL_SOC is not set CONFIG_SND_BCM2835_SOC_I2S=m +CONFIG_SND_BCM2708_SOC_GOOGLEVOICEHAT_SOUNDCARD=m CONFIG_SND_BCM2708_SOC_HIFIBERRY_DAC=m CONFIG_SND_BCM2708_SOC_HIFIBERRY_DACPLUS=m CONFIG_SND_BCM2708_SOC_HIFIBERRY_DIGI=m @@ -2789,11 +2790,14 @@ CONFIG_SND_BCM2708_SOC_IQAUDIO_DIGI=m CONFIG_SND_BCM2708_SOC_RASPIDAC3=m CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m +CONFIG_SND_AUDIOINJECTOR_OCTO_SOUNDCARD=m CONFIG_SND_DIGIDAC1_SOUNDCARD=m CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO=m CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO_V2=m CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC=m +CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS=m CONFIG_SND_BCM2708_SOC_FE_PI_AUDIO=m +CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC=m CONFIG_SND_PISOUND=m # CONFIG_SND_DESIGNWARE_I2S is not set @@ -2841,11 +2845,13 @@ CONFIG_SND_SOC_ADAU7002=m # CONFIG_SND_SOC_CS4270 is not set # CONFIG_SND_SOC_CS4271_I2C is not set # CONFIG_SND_SOC_CS4271_SPI is not set -# CONFIG_SND_SOC_CS42XX8_I2C is not set +CONFIG_SND_SOC_CS42XX8=m +CONFIG_SND_SOC_CS42XX8_I2C=m # CONFIG_SND_SOC_CS4349 is not set # CONFIG_SND_SOC_CS53L30 is not set # CONFIG_SND_SOC_ES8328 is not set # CONFIG_SND_SOC_GTM601 is not set +# CONFIG_SND_SOC_ICS43432 is not set # CONFIG_SND_SOC_INNO_RK3036 is not set # CONFIG_SND_SOC_MAX98504 is not set # CONFIG_SND_SOC_MAX9860 is not set diff --git a/projects/RPi/patches/linux/linux-01-RPi_support.patch b/projects/RPi/patches/linux/linux-01-RPi_support.patch index 1e9e991f28..3e1969a7e8 100644 --- a/projects/RPi/patches/linux/linux-01-RPi_support.patch +++ b/projects/RPi/patches/linux/linux-01-RPi_support.patch @@ -1,7 +1,7 @@ -From 824b91157e25e6eeea39df1a2c27f83a6b6838ba Mon Sep 17 00:00:00 2001 +From ace6fd3ca18068ece94afeee6eddb8d190ea8c79 Mon Sep 17 00:00:00 2001 From: Steve Glendinning Date: Thu, 19 Feb 2015 18:47:12 +0000 -Subject: [PATCH 001/195] smsx95xx: fix crimes against truesize +Subject: [PATCH 001/218] smsx95xx: fix crimes against truesize smsc95xx is adjusting truesize when it shouldn't, and following a recent patch from Eric this is now triggering warnings. @@ -48,10 +48,10 @@ index 831aa33d078ae7d2dd57fdded5de71d1eb915f99..b77935bded8c0ff7808b00f170ff10e5 usbnet_skb_return(dev, ax_skb); } -From e2de8f6dd732c5950eba7158e48caf47f1ef741f Mon Sep 17 00:00:00 2001 +From 77227dfd51d9f6cb24da1ee9fce7c29d8fdd26d8 Mon Sep 17 00:00:00 2001 From: Sam Nazarko Date: Fri, 1 Apr 2016 17:27:21 +0100 -Subject: [PATCH 002/195] smsc95xx: Experimental: Enable turbo_mode and +Subject: [PATCH 002/218] smsc95xx: Experimental: Enable turbo_mode and packetsize=2560 by default See: http://forum.kodi.tv/showthread.php?tid=285288 @@ -94,10 +94,10 @@ index b77935bded8c0ff7808b00f170ff10e594300ad0..693f163684de921404738e33244881e0 netif_dbg(dev, ifup, dev->net, "rx_urb_size=%ld\n", -From a76700f447adb955fecd8bbfc955c0dcbbb2a178 Mon Sep 17 00:00:00 2001 +From bfcc45ab8ec29eddf9068f709e19a71c0750ca35 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 17:26:38 +0000 -Subject: [PATCH 003/195] Allow mac address to be set in smsc95xx +Subject: [PATCH 003/218] Allow mac address to be set in smsc95xx Signed-off-by: popcornmix --- @@ -193,10 +193,10 @@ index 693f163684de921404738e33244881e0aab92ec9..df60c989fc229bf0aab3c27e95ccd453 eth_hw_addr_random(dev->net); netif_dbg(dev, ifup, dev->net, "MAC address set to eth_random_addr\n"); -From 4eda25522b37725205be1e303a97bf00cf7c94d7 Mon Sep 17 00:00:00 2001 +From 5c7af355f2985972bffc0c547818bc67bd9f2d47 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 13 Mar 2015 12:43:36 +0000 -Subject: [PATCH 004/195] Protect __release_resource against resources without +Subject: [PATCH 004/218] Protect __release_resource against resources without parents Without this patch, removing a device tree overlay can crash here. @@ -224,10 +224,10 @@ index 9b5f04404152c296af3a96132f27cfc80ffa9af9..f8a9af6e6b915812be2ba2c1c2b40106 for (;;) { tmp = *p; -From a3b99f8ac80b99d8274616bc7dcc763a74515dba Mon Sep 17 00:00:00 2001 +From 8b39431fedbaa4e15cc8187416649b679aa88517 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 18 Dec 2014 16:07:15 -0800 -Subject: [PATCH 005/195] mm: Remove the PFN busy warning +Subject: [PATCH 005/218] mm: Remove the PFN busy warning See commit dae803e165a11bc88ca8dbc07a11077caf97bbcb -- the warning is expected sometimes when using CMA. However, that commit still spams @@ -239,7 +239,7 @@ Signed-off-by: Eric Anholt 1 file changed, 2 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c -index f4a02e240fb68acbaa0d3a0c7ac5a498c051a272..0e1fba92702858ceaf2f92a1d5fa53d5b16b52fe 100644 +index 1460e6ad5e141788edea4b4ea3a294352d788af1..69dc54cf662fbac6b67af7bdfb7b7a41deb78d06 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -7323,8 +7323,6 @@ int alloc_contig_range(unsigned long start, unsigned long end, @@ -252,10 +252,10 @@ index f4a02e240fb68acbaa0d3a0c7ac5a498c051a272..0e1fba92702858ceaf2f92a1d5fa53d5 goto done; } -From fa1cc418ea9a009dd6c3b18f61bc5968d11fafa6 Mon Sep 17 00:00:00 2001 +From 73f0130d019611fe110d734bd94cb5384140f035 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 4 Dec 2015 17:41:50 +0000 -Subject: [PATCH 006/195] irq-bcm2836: Prevent spurious interrupts, and trap +Subject: [PATCH 006/218] irq-bcm2836: Prevent spurious interrupts, and trap them early The old arch-specific IRQ macros included a dsb to ensure the @@ -282,10 +282,10 @@ index d96b2c947e74e3edab3917551c64fbd1ced0f34c..93e3f7660c4230c9f1dd3b195958cb49 #endif } else if (stat) { -From d5eaa943c8f729701c17c557968c096c05212934 Mon Sep 17 00:00:00 2001 +From 2ccd0c4c9b5fb75670cb506403c52b1b1fe38d9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 12 Jun 2015 19:01:05 +0200 -Subject: [PATCH 007/195] irqchip: bcm2835: Add FIQ support +Subject: [PATCH 007/218] irqchip: bcm2835: Add FIQ support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -414,10 +414,10 @@ index 44d7c38dde479d771f3552e914bf8c1c1f5019f7..42ff5e6a8e0d532f5b60a1e7af7cc4d9 } -From 5315497e356586a8a2320972e389fbefda551bfb Mon Sep 17 00:00:00 2001 +From 0e091203819ee3c24cb7d9ef27fda64160b0cee5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 23 Oct 2015 16:26:55 +0200 -Subject: [PATCH 008/195] irqchip: irq-bcm2835: Add 2836 FIQ support +Subject: [PATCH 008/218] irqchip: irq-bcm2835: Add 2836 FIQ support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -516,10 +516,10 @@ index 42ff5e6a8e0d532f5b60a1e7af7cc4d941bd5008..eccf6ed025299cb480884f5bcbe77abf for (b = 0; b < NR_BANKS; b++) { for (i = 0; i < bank_irqs[b]; i++) { -From df18a91051c324c2e31c25c231f414a7ef3959fe Mon Sep 17 00:00:00 2001 +From 1f36307a91673999b54a458708660828bbb57e87 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Jul 2015 10:26:09 +0100 -Subject: [PATCH 009/195] spidev: Add "spidev" compatible string to silence +Subject: [PATCH 009/218] spidev: Add "spidev" compatible string to silence warning See: https://github.com/raspberrypi/linux/issues/1054 @@ -540,10 +540,10 @@ index 2e05046f866bd01bf87edcdeff0d5b76d4d0aea7..d780491b8013a4e97fa843958964454e }; MODULE_DEVICE_TABLE(of, spidev_dt_ids); -From 2045b89a909b65aed659fa79a89fd6d9ff9f7fd4 Mon Sep 17 00:00:00 2001 +From 098c16955ecffe714b0b9c8a1e71155a39be354c Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 30 Jun 2015 14:12:42 +0100 -Subject: [PATCH 010/195] serial: 8250: Don't crash when nr_uarts is 0 +Subject: [PATCH 010/218] serial: 8250: Don't crash when nr_uarts is 0 --- drivers/tty/serial/8250/8250_core.c | 2 ++ @@ -563,10 +563,10 @@ index e8819aa20415603c80547e382838a8fa3ce54792..cf9c7d2e3f95e1a19410247a89c2e49c for (i = 0; i < nr_uarts; i++) { struct uart_8250_port *up = &serial8250_ports[i]; -From 45b37f24824142cd8ca6ab05ca6be636dc96a558 Mon Sep 17 00:00:00 2001 +From 4f351bb67f89906f34b83cc9fa32223e8e9e9887 Mon Sep 17 00:00:00 2001 From: notro Date: Thu, 10 Jul 2014 13:59:47 +0200 -Subject: [PATCH 011/195] pinctrl-bcm2835: Set base to 0 give expected gpio +Subject: [PATCH 011/218] pinctrl-bcm2835: Set base to 0 give expected gpio numbering Signed-off-by: Noralf Tronnes @@ -588,10 +588,10 @@ index fa77165fab2c1348163979da507df17e7168c49b..d11e2e4ea189466e686d762cb6c6fef9 .can_sleep = false, }; -From ff2a58fb3e008c98952f11da3687796edf8c869e Mon Sep 17 00:00:00 2001 +From f9b822f58271c75e81a9354f1167dc719f9a233d Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 24 Feb 2015 13:40:50 +0000 -Subject: [PATCH 012/195] pinctrl-bcm2835: Fix interrupt handling for GPIOs +Subject: [PATCH 012/218] pinctrl-bcm2835: Fix interrupt handling for GPIOs 28-31 and 46-53 Contrary to the documentation, the BCM2835 GPIO controller actually has @@ -737,10 +737,10 @@ index d11e2e4ea189466e686d762cb6c6fef9111ecf8e..107ad7d58de8f8a7f55e09c9cdcf7d66 }, }; -From 93cdac4155cc22b603b7239693f28ea4376f60b7 Mon Sep 17 00:00:00 2001 +From d2dc0ee0513fbcdd90576a0765e061dc29b8067c Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 26 Feb 2015 09:58:22 +0000 -Subject: [PATCH 013/195] pinctrl-bcm2835: Only request the interrupts listed +Subject: [PATCH 013/218] pinctrl-bcm2835: Only request the interrupts listed in the DTB Although the GPIO controller can generate three interrupts (four counting @@ -767,10 +767,10 @@ index 107ad7d58de8f8a7f55e09c9cdcf7d66fa7ab66b..644bdecbcfcb79d3b84a33769265fca5 pc->irq_data[i].irqgroup = i; -From 35ef1ffba1fa601537d4971605bc47305bcc7140 Mon Sep 17 00:00:00 2001 +From e4d48693d7cf2b97fc189e4344ec3f09c333903d Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 6 May 2016 12:32:47 +0100 -Subject: [PATCH 014/195] pinctrl-bcm2835: Return pins to inputs when freed +Subject: [PATCH 014/218] pinctrl-bcm2835: Return pins to inputs when freed When dynamically unloading overlays, it is important that freed pins are restored to being inputs to prevent functions from being enabled in @@ -811,10 +811,10 @@ index 644bdecbcfcb79d3b84a33769265fca5d3d0c9e5..81a66cba2ab0f7e3ae179de7edd10122 .get_function_name = bcm2835_pmx_get_function_name, .get_function_groups = bcm2835_pmx_get_function_groups, -From 91fca4e04d43b9871bb9a05f5fd53f412f44ad7a Mon Sep 17 00:00:00 2001 +From ca1600077e78e1a5cde5e329aa2aaa8b4261453a Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 24 Jun 2015 14:10:44 +0100 -Subject: [PATCH 015/195] spi-bcm2835: Support pin groups other than 7-11 +Subject: [PATCH 015/218] spi-bcm2835: Support pin groups other than 7-11 The spi-bcm2835 driver automatically uses GPIO chip-selects due to some unreliability of the native ones. In doing so it chooses the @@ -895,10 +895,10 @@ index f35cc10772f6670397ea923ad30158270dd68578..5dfe20ffc2866fa6789825016c585175 /* and set up the "mode" and level */ dev_info(&spi->dev, "setting up native-CS%i as GPIO %i\n", -From f6ca889d38c151f406a6979435ea3365c9c309c3 Mon Sep 17 00:00:00 2001 +From aa8c3ce9cad4a9c450f305b25bf6e099fc788102 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 1 Jul 2016 22:09:24 +0100 -Subject: [PATCH 016/195] spi-bcm2835: Disable forced software CS +Subject: [PATCH 016/218] spi-bcm2835: Disable forced software CS Select software CS in bcm2708_common.dtsi, and disable the automatic conversion in the driver to allow hardware CS to be re-enabled with an @@ -932,10 +932,10 @@ index 5dfe20ffc2866fa6789825016c585175a29705b6..8493474d286f7a1ac6454a22c61c8c2c return 0; } -From 18d0cd4df7ff1d864ba5c9919ff0dcbb9ff461b9 Mon Sep 17 00:00:00 2001 +From d13a1d0c1b9ae58ff0cd262d8d79ce4c4ef342d2 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 8 Nov 2016 21:35:38 +0000 -Subject: [PATCH 017/195] spi-bcm2835: Remove unused code +Subject: [PATCH 017/218] spi-bcm2835: Remove unused code --- drivers/spi/spi-bcm2835.c | 61 ----------------------------------------------- @@ -1023,10 +1023,10 @@ index 8493474d286f7a1ac6454a22c61c8c2cef9121bf..33d75ad38a7f77d085321ace9101900a } -From cd05fecde7c8dc71f0a50ac33a31136e2c763c1c Mon Sep 17 00:00:00 2001 +From c893ea9baa610d6c6348d7628279c77679055d97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Wed, 3 Jun 2015 12:26:13 +0200 -Subject: [PATCH 018/195] ARM: bcm2835: Set Serial number and Revision +Subject: [PATCH 018/218] ARM: bcm2835: Set Serial number and Revision MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -1079,10 +1079,10 @@ index 0c1edfc98696da0e0bb7f4a18cdfbcdd27a9795d..8f152266ba9b470df2eaaed9ebcf158e static const char * const bcm2835_compat[] = { -From be74b1a8c91452b4da15cd93498d822dcd59081c Mon Sep 17 00:00:00 2001 +From e997f981519f0c1b0d922cf3b893fb799f7f4686 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Sat, 3 Oct 2015 22:22:55 +0200 -Subject: [PATCH 019/195] dmaengine: bcm2835: Load driver early and support +Subject: [PATCH 019/218] dmaengine: bcm2835: Load driver early and support legacy API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -1185,10 +1185,10 @@ index e18dc596cf2447fa9ef7e41b62d9396e29043426..80d35f760b4a4a51e60c355a84d538ba MODULE_ALIAS("platform:bcm2835-dma"); MODULE_DESCRIPTION("BCM2835 DMA engine driver"); -From 7edcdd77d6a68ea8da112c4155d195c79f892140 Mon Sep 17 00:00:00 2001 +From a0a01cf3fd1469a6b94a16d21aa7cfb61d02d7cb Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 25 Jan 2016 17:25:12 +0000 -Subject: [PATCH 020/195] firmware: Updated mailbox header +Subject: [PATCH 020/218] firmware: Updated mailbox header --- include/soc/bcm2835/raspberrypi-firmware.h | 11 +++++++++++ @@ -1251,10 +1251,10 @@ index 3fb357193f09914fe21f8555a4b8613f74f22bc3..227a107214a02deadcca3db202da265e RPI_FIRMWARE_GET_COMMAND_LINE = 0x00050001, RPI_FIRMWARE_GET_DMA_CHANNELS = 0x00060001, -From 81012e53f2fd85631e900caee73120c0a568b3a0 Mon Sep 17 00:00:00 2001 +From c7b70d7bf562b9611f342862653ad7f68fa9e0c6 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 9 May 2016 17:28:18 -0700 -Subject: [PATCH 021/195] clk: bcm2835: Mark GPIO clocks enabled at boot as +Subject: [PATCH 021/218] clk: bcm2835: Mark GPIO clocks enabled at boot as critical. These divide off of PLLD_PER and are used for the ethernet and wifi @@ -1272,7 +1272,7 @@ Signed-off-by: Eric Anholt 1 file changed, 9 insertions(+) diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c -index 3bbd2a58db470a89b870a793e59ddf9fc4f48e57..7040c6426e35c11608121893b662c601cd8d6543 100644 +index 2acaa77ad482a99f28ea64ea43c891501125304c..d13cbbf5bbe06314bfdf103ff85d5cd73cbf7f7a 100644 --- a/drivers/clk/bcm/clk-bcm2835.c +++ b/drivers/clk/bcm/clk-bcm2835.c @@ -1262,6 +1262,15 @@ static struct clk_hw *bcm2835_register_clock(struct bcm2835_cprman *cprman, @@ -1292,10 +1292,10 @@ index 3bbd2a58db470a89b870a793e59ddf9fc4f48e57..7040c6426e35c11608121893b662c601 init.ops = &bcm2835_vpu_clock_clk_ops; } else { -From 95a2b87baa9268288a2a29fdf3fb6be7b2c4b396 Mon Sep 17 00:00:00 2001 +From 70bd41a7fa143e6083f8e6fda573ccc8b11d5de0 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 15 Jun 2016 16:48:41 +0100 -Subject: [PATCH 022/195] rtc: Add SPI alias for pcf2123 driver +Subject: [PATCH 022/218] rtc: Add SPI alias for pcf2123 driver Without this alias, Device Tree won't cause the driver to be loaded. @@ -1315,10 +1315,10 @@ index 8895f77726e8da5444afcd602dceff8f25a9b3fd..1833b8853ceb0e6147cceb93a00e558c MODULE_LICENSE("GPL"); +MODULE_ALIAS("spi:rtc-pcf2123"); -From 45564555c0782c49ed3c1d004710310648eac7f9 Mon Sep 17 00:00:00 2001 +From ea7d87c6e8212f5559000d9471f9e87169797430 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 7 Oct 2016 16:50:59 +0200 -Subject: [PATCH 023/195] watchdog: bcm2835: Support setting reboot partition +Subject: [PATCH 023/218] watchdog: bcm2835: Support setting reboot partition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -1442,10 +1442,10 @@ index 4dddd8298a227d64862f2e92954a465f2e44b3f6..1f545e024422f59280932713e6a1b051 register_restart_handler(&wdt->restart_handler); if (pm_power_off == NULL) -From e97b21ffc3fb98c0dfcc10a397afb0d3fe7fb4c8 Mon Sep 17 00:00:00 2001 +From 639060b6afee11534ce54ab416abeb0ed7fd6965 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 5 Apr 2016 19:40:12 +0100 -Subject: [PATCH 024/195] reboot: Use power off rather than busy spinning when +Subject: [PATCH 024/218] reboot: Use power off rather than busy spinning when halt is requested --- @@ -1468,10 +1468,10 @@ index 3fa867a2aae672755c6ce6448f4148c989dbf964..80dca8dcd6709034b643c6a3f35729e0 /* -From 87babae12f5085ea93481ba7412701f18a032cbb Mon Sep 17 00:00:00 2001 +From c020700a444e1e3ed5db75038f9b6c299b890e64 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 9 Nov 2016 13:02:52 +0000 -Subject: [PATCH 025/195] bcm: Make RASPBERRYPI_POWER depend on PM +Subject: [PATCH 025/218] bcm: Make RASPBERRYPI_POWER depend on PM --- drivers/soc/bcm/Kconfig | 1 + @@ -1490,10 +1490,10 @@ index a39b0d58ddd0fdf0ac1cc7295f8aafb12546e226..e037a6dd79d1881a09e3ca9115782709 help This enables support for the RPi power domains which can be enabled -From 0334dbeaae76c66d8f7d19fbdd7fd7a99bf74039 Mon Sep 17 00:00:00 2001 +From a2bda2acba829767aeead5be052c7b6eee905d97 Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Fri, 2 Sep 2016 16:45:27 +0100 -Subject: [PATCH 026/195] Register the clocks early during the boot process, so +Subject: [PATCH 026/218] Register the clocks early during the boot process, so that special/critical clocks can get enabled early on in the boot process avoiding the risk of disabling a clock, pll_divider or pll when a claiming driver fails to install propperly - maybe it needs to defer. @@ -1504,7 +1504,7 @@ Signed-off-by: Martin Sperl 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c -index 7040c6426e35c11608121893b662c601cd8d6543..21e2a538ff0d0ab4e63adff9b93705f3d45fa15d 100644 +index d13cbbf5bbe06314bfdf103ff85d5cd73cbf7f7a..a99ccf9f056d3a3e7c482339e08483f3701ebc04 100644 --- a/drivers/clk/bcm/clk-bcm2835.c +++ b/drivers/clk/bcm/clk-bcm2835.c @@ -1903,8 +1903,15 @@ static int bcm2835_clk_probe(struct platform_device *pdev) @@ -1538,10 +1538,10 @@ index 7040c6426e35c11608121893b662c601cd8d6543..21e2a538ff0d0ab4e63adff9b93705f3 MODULE_AUTHOR("Eric Anholt "); MODULE_DESCRIPTION("BCM2835 clock driver"); -From 887b64752dac7a46001d47bb940aad4e77cfc895 Mon Sep 17 00:00:00 2001 +From f8fdbafbd1b8a67f07ae454be34e61e9e420998a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 6 Dec 2016 17:05:39 +0000 -Subject: [PATCH 027/195] bcm2835-rng: Avoid initialising if already enabled +Subject: [PATCH 027/218] bcm2835-rng: Avoid initialising if already enabled Avoids the 0x40000 cycles of warmup again if firmware has already used it --- @@ -1567,10 +1567,10 @@ index 574211a495491d9d6021dcaefe4274a63ed02055..e66c0fca8c6090e32f72796c0877a1cf err = hwrng_register(&bcm2835_rng_ops); if (err) { -From f642b0f244cd0393c458ca458de826f5b3820850 Mon Sep 17 00:00:00 2001 +From d917a5b2280fe48ef807f0c67b23fa8f55fb7687 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 24 Aug 2016 16:28:44 +0100 -Subject: [PATCH 028/195] kbuild: Ignore dtco targets when filtering symbols +Subject: [PATCH 028/218] kbuild: Ignore dtco targets when filtering symbols --- scripts/Kbuild.include | 2 +- @@ -1590,10 +1590,10 @@ index 179219845dfcdfbeb586d12c5ec1296095d9fbf4..e0743e44f84188667a0c322e8c3d36f1 esac | tr ";" "\n" | sed -rn 's/^.*=== __KSYM_(.*) ===.*$$/KSYM_\1/p' -From 33f4d99cb9cdac2ecf8cba4dd86c2402b2cf5e01 Mon Sep 17 00:00:00 2001 +From e668d477605548f3bda8ccaaa3d8cfde214ef748 Mon Sep 17 00:00:00 2001 From: Robert Tiemann Date: Mon, 20 Jul 2015 11:01:25 +0200 -Subject: [PATCH 029/195] BCM2835_DT: Fix I2S register map +Subject: [PATCH 029/218] BCM2835_DT: Fix I2S register map --- Documentation/devicetree/bindings/dma/brcm,bcm2835-dma.txt | 4 ++-- @@ -1631,10 +1631,10 @@ index 65783de0aedf3da79adc36fd077b7a89954ddb6b..a89fe4220fdc3f26f75ee66daf187554 dmas = <&dma 2>, <&dma 3>; -From 67b5bb9e5f63a8622f93227f385c6e414d65e39e Mon Sep 17 00:00:00 2001 +From 79b139ddbe668e2f2b05d54b3caa01ac837cc01f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 12 May 2013 12:24:19 +0100 -Subject: [PATCH 030/195] Main bcm2708/bcm2709 linux port +Subject: [PATCH 030/218] Main bcm2708/bcm2709 linux port MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -1841,10 +1841,10 @@ index cfb4b4496dd9f61362dea012176c146120fada07..d9c6c217c4d6a2408abe2665bf7f2700 MODULE_AUTHOR("Lubomir Rintel "); MODULE_DESCRIPTION("BCM2835 mailbox IPC driver"); -From 639d6dc9f3858e4dc64c23ca71027c2b8c3bdb25 Mon Sep 17 00:00:00 2001 +From 255056f5891a55df23e6bd9b6239022cb30c9806 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 19:46:17 +0100 -Subject: [PATCH 031/195] Add dwc_otg driver +Subject: [PATCH 031/218] Add dwc_otg driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -2546,7 +2546,7 @@ index 358ca8dd784fe43700ae070764fa783500a792fe..abaac7c7142d8887c1516957fc52162c return i; } diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c -index aef81a16e2c8534701b8583392400faf77971d23..4197a5b5fb7abae67bd4aa32c29cb84c1f2fe22e 100644 +index c28ccf1b5a1fe285044024fff3f70bf9ae7cc91f..0e65cb92d12eb9645ddc21b902cd8b141cafef47 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -5009,7 +5009,7 @@ static void port_event(struct usb_hub *hub, int port1) @@ -62901,10 +62901,10 @@ index 0000000000000000000000000000000000000000..cdc9963176e5a4a0d5250613b61e26c5 +test_main(); +0; -From 8136fe3b12d68099e1cd005dcdca8ef973f35f50 Mon Sep 17 00:00:00 2001 +From e4ae0eb3bfe63196bb9577dda90d44b377fff72b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 17:06:34 +0100 -Subject: [PATCH 032/195] bcm2708 framebuffer driver +Subject: [PATCH 032/218] bcm2708 framebuffer driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -66363,10 +66363,10 @@ index 3c14e43b82fefe1d32f591d1b2f61d2cd28d0fa8..7626beb6a5bb8df601ddf0f6e6909d1f +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 -From 8c7995c7f6303b0d9ed6953dd1803819eb64a459 Mon Sep 17 00:00:00 2001 +From 1c2a6d9e3cfab206f4a7f9498a30bb38d39eb3d1 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:22:53 +0100 -Subject: [PATCH 033/195] dmaengine: Add support for BCM2708 +Subject: [PATCH 033/218] dmaengine: Add support for BCM2708 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -66997,10 +66997,10 @@ index 0000000000000000000000000000000000000000..c5bfff2765be4606077e6c8af73040ec + +#endif /* _PLAT_BCM2708_DMA_H */ -From ba68e25029468180b5e87827607259d7218d08ab Mon Sep 17 00:00:00 2001 +From fdc5c1e17bb8cdaa612dde04bbd1b6b3f5636686 Mon Sep 17 00:00:00 2001 From: gellert Date: Fri, 15 Aug 2014 16:35:06 +0100 -Subject: [PATCH 034/195] MMC: added alternative MMC driver +Subject: [PATCH 034/218] MMC: added alternative MMC driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -68750,10 +68750,10 @@ index 0000000000000000000000000000000000000000..4fe8d1fe44578fbefcd48f8c327ba3d0 +MODULE_LICENSE("GPL v2"); +MODULE_AUTHOR("Gellert Weisz"); -From 406c03bca56cf29ce046ae5e164bfdc97082c985 Mon Sep 17 00:00:00 2001 +From e47f0fe40ec129cab52f07ad0c315d37a2d57fe2 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 25 Mar 2015 17:49:47 +0000 -Subject: [PATCH 035/195] Adding bcm2835-sdhost driver, and an overlay to +Subject: [PATCH 035/218] Adding bcm2835-sdhost driver, and an overlay to enable it BCM2835 has two SD card interfaces. This driver uses the other one. @@ -71158,10 +71158,10 @@ index 0000000000000000000000000000000000000000..a9bc79bfdbb71807819dfe2d8f165144 +MODULE_LICENSE("GPL v2"); +MODULE_AUTHOR("Phil Elwell"); -From 86a841552d7c68bfad1836ba634330da73abe62d Mon Sep 17 00:00:00 2001 +From 5fcecb8e60f05180c91e2a18b779d5c8461ab620 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 11 May 2016 12:50:33 +0100 -Subject: [PATCH 036/195] mmc: Add MMC_QUIRK_ERASE_BROKEN for some cards +Subject: [PATCH 036/218] mmc: Add MMC_QUIRK_ERASE_BROKEN for some cards Some SD cards have been found that corrupt data when small blocks are erased. Add a quirk to indicate that ERASE should not be used, @@ -71297,10 +71297,10 @@ index 73fad83acbcb6a157587180516f9ffe7c61eb7d7..e7c9d3098ac06e3c6554fa3373a311f9 unsigned int erase_shift; /* if erase unit is power 2 */ unsigned int pref_erase; /* in sectors */ -From df77e4ac03fa7eb5e0d67cde27d7b926a64ba9a4 Mon Sep 17 00:00:00 2001 +From f7c278edaa5dc994fb610ccf72ba33c340925972 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:31:47 +0100 -Subject: [PATCH 037/195] cma: Add vc_cma driver to enable use of CMA +Subject: [PATCH 037/218] cma: Add vc_cma driver to enable use of CMA MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -72636,10 +72636,10 @@ index 0000000000000000000000000000000000000000..be2819d5d41f9d5ed65daf8eedb94c9e + +#endif /* VC_CMA_H */ -From 682dc5f59a056c6b166f69bd38e2feb6c5228f37 Mon Sep 17 00:00:00 2001 +From a38618ea5e2cc3f84de75fa11b46725b178f1810 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 26 Mar 2012 22:15:50 +0100 -Subject: [PATCH 038/195] bcm2708: alsa sound driver +Subject: [PATCH 038/218] bcm2708: alsa sound driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -75374,10 +75374,10 @@ index 0000000000000000000000000000000000000000..af3e6eb690113fc32ce9e06bd2f0f294 + +#endif // _VC_AUDIO_DEFS_H_ -From ce01ad481ce41d539c7d5e0a110da8fe448f2295 Mon Sep 17 00:00:00 2001 +From cd2ed566ba3b675d81f8ba3cfd8bd4c116e391b7 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 28 Oct 2016 15:36:43 +0100 -Subject: [PATCH 039/195] vc_mem: Add vc_mem driver for querying firmware +Subject: [PATCH 039/218] vc_mem: Add vc_mem driver for querying firmware memory addresses MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -75901,10 +75901,10 @@ index 0000000000000000000000000000000000000000..20a475377eb3078ea1ecaef2b24efc35 + +#endif /* _VC_MEM_H */ -From 4ffc0167afeaab524c22ec970f5b63f9ae0d64b4 Mon Sep 17 00:00:00 2001 +From 3bca045578853ff455fa5aa9ce3cb6625a72da10 Mon Sep 17 00:00:00 2001 From: Tim Gover Date: Tue, 22 Jul 2014 15:41:04 +0100 -Subject: [PATCH 040/195] vcsm: VideoCore shared memory service for BCM2835 +Subject: [PATCH 040/218] vcsm: VideoCore shared memory service for BCM2835 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -80311,10 +80311,10 @@ index 0000000000000000000000000000000000000000..334f36d0d697b047df2922b5f2db67f3 + +#endif /* __VMCS_SM_IOCTL_H__INCLUDED__ */ -From 5f7747149f7804fed56ff23337fa58747e0083a4 Mon Sep 17 00:00:00 2001 +From 7e2f2a04538763e7af2b66b2ef6e301c9f402590 Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Fri, 21 Aug 2015 23:14:48 +0100 -Subject: [PATCH 041/195] Add /dev/gpiomem device for rootless user GPIO access +Subject: [PATCH 041/218] Add /dev/gpiomem device for rootless user GPIO access Signed-off-by: Luke Wren @@ -80625,10 +80625,10 @@ index 0000000000000000000000000000000000000000..911f5b7393ed48ceed8751f06967ae64 +MODULE_DESCRIPTION("gpiomem driver for accessing GPIO from userspace"); +MODULE_AUTHOR("Luke Wren "); -From a4cb9fa177e22de6e158d430ade3e04910052148 Mon Sep 17 00:00:00 2001 +From 372c91d3d0d0a137618fa4df8ad8d076bc7229f4 Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Sat, 5 Sep 2015 01:14:45 +0100 -Subject: [PATCH 042/195] Add SMI driver +Subject: [PATCH 042/218] Add SMI driver Signed-off-by: Luke Wren --- @@ -82579,10 +82579,10 @@ index 0000000000000000000000000000000000000000..ee3a75edfc033eeb0d90a687ffb68b10 + +#endif /* BCM2835_SMI_H */ -From 3a935cc738add5e6099185ac8b2ad4644476b072 Mon Sep 17 00:00:00 2001 +From f3f809a8023342dd2dd4bfb36c4a6b99e34aeb20 Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Tue, 26 Apr 2016 14:59:21 +0000 -Subject: [PATCH 043/195] MISC: bcm2835: smi: use clock manager and fix reload +Subject: [PATCH 043/218] MISC: bcm2835: smi: use clock manager and fix reload issues Use clock manager instead of self-made clockmanager. @@ -82752,10 +82752,10 @@ index 63a4ea08b9930a3a31a985f0a1d969b488ed49ec..1261540703127d1d63b9f3c87042c6e5 return 0; } -From 56f9fab0a1700699e77b81066864175519c5e782 Mon Sep 17 00:00:00 2001 +From f2bfd53319709e8d543eb7ae3dc4d59ae3908093 Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Sat, 5 Sep 2015 01:16:10 +0100 -Subject: [PATCH 044/195] Add SMI NAND driver +Subject: [PATCH 044/218] Add SMI NAND driver Signed-off-by: Luke Wren --- @@ -83120,10 +83120,10 @@ index 0000000000000000000000000000000000000000..02adda6da18bd0ba9ab19a104975b79d + ("Driver for NAND chips using Broadcom Secondary Memory Interface"); +MODULE_AUTHOR("Luke Wren "); -From 30ab3c9b68b20a445d65c3ae91ee1b645c9af208 Mon Sep 17 00:00:00 2001 +From 30a6c2c5267914444f95d7c70b56318deca21efb Mon Sep 17 00:00:00 2001 From: Aron Szabo Date: Sat, 16 Jun 2012 12:15:55 +0200 -Subject: [PATCH 045/195] lirc: added support for RaspberryPi GPIO +Subject: [PATCH 045/218] lirc: added support for RaspberryPi GPIO lirc_rpi: Use read_current_timer to determine transmitter delay. Thanks to jjmz and others See: https://github.com/raspberrypi/linux/issues/525 @@ -83986,10 +83986,10 @@ index 0000000000000000000000000000000000000000..fb69624ccef00ddbdccf8256d6baf1b1 + +#endif -From 0fec68ae4d97857def8e65ceb40e4b3025eebf3b Mon Sep 17 00:00:00 2001 +From b74ad641f8868ca5d3c3aef7baea0ae1f03ec341 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:49:20 +0100 -Subject: [PATCH 046/195] Add cpufreq driver +Subject: [PATCH 046/218] Add cpufreq driver Signed-off-by: popcornmix --- @@ -84256,10 +84256,10 @@ index 0000000000000000000000000000000000000000..414fbdc10dfbfc6e4bb47870a7af3fd5 +module_init(bcm2835_cpufreq_module_init); +module_exit(bcm2835_cpufreq_module_exit); -From bc5015b05f818e1b5dd6cae3fab09464cdea5cbf Mon Sep 17 00:00:00 2001 +From 20e4a967e3f3b88d63e3d7c46c8198afd6581bd2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 19:24:24 +0000 -Subject: [PATCH 047/195] Added hwmon/thermal driver for reporting core +Subject: [PATCH 047/218] Added hwmon/thermal driver for reporting core temperature. Thanks Dorian MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -84425,10 +84425,10 @@ index 0000000000000000000000000000000000000000..c63fb9f9d143e19612a18fe530c7b2b3 +MODULE_DESCRIPTION("Thermal driver for bcm2835 chip"); +MODULE_LICENSE("GPL"); -From bcf204224a61b8d5b66bee617c10670e9ebe1100 Mon Sep 17 00:00:00 2001 +From e485d7218d11ef86bf03a948c3df1dd6e2264683 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 15:44:08 +0100 -Subject: [PATCH 048/195] Add Chris Boot's i2c driver +Subject: [PATCH 048/218] Add Chris Boot's i2c driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -85093,10 +85093,10 @@ index 0000000000000000000000000000000000000000..962f2e5c7455d91bf32925d785f5f16b +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRV_NAME); -From e1dfd04ab149dbcbdbcfe3ebd4c9790d92ea9b32 Mon Sep 17 00:00:00 2001 +From a867b62a2fc6e866a52d3742894727045a15cc67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 26 Jun 2015 14:27:06 +0200 -Subject: [PATCH 049/195] char: broadcom: Add vcio module +Subject: [PATCH 049/218] char: broadcom: Add vcio module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -85322,10 +85322,10 @@ index 0000000000000000000000000000000000000000..c19bc2075c77879563ef5e59038b5a14 +MODULE_DESCRIPTION("Mailbox userspace access"); +MODULE_LICENSE("GPL"); -From 7b469a8a64b5727e2d562db73da676de75213e82 Mon Sep 17 00:00:00 2001 +From c3895f611eafd3c731d2964df1581f07fb2f9522 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 26 Jun 2015 14:25:01 +0200 -Subject: [PATCH 050/195] firmware: bcm2835: Support ARCH_BCM270x +Subject: [PATCH 050/218] firmware: bcm2835: Support ARCH_BCM270x MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -85408,10 +85408,10 @@ index dd506cd3a5b874f9e1acd07efb8cd151bb6145d1..3f070bd38a91511c986e3fb114b15bd4 MODULE_AUTHOR("Eric Anholt "); MODULE_DESCRIPTION("Raspberry Pi firmware driver"); -From 34995fae7d9bbcad176f1257bf5a57b873e3cca8 Mon Sep 17 00:00:00 2001 +From 0bd5079a80dd6bc9c593e13e52b8e64ef9b79da5 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 30 Jan 2013 12:45:18 +0000 -Subject: [PATCH 051/195] bcm2835: add v4l2 camera device +Subject: [PATCH 051/218] bcm2835: add v4l2 camera device - Supports raw YUV capture, preview, JPEG and H264. - Uses videobuf2 for data transfer, using dma_buf. @@ -93153,10 +93153,10 @@ index 0000000000000000000000000000000000000000..9d1d11e4a53e510c04a416d92d195a7d + +#endif /* MMAL_VCHIQ_H */ -From 67fe83cbd3e42c51f3d2e561272c1171b3743fc4 Mon Sep 17 00:00:00 2001 +From 201640f5760f1d84cf0b8a8a49d695809f78e365 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 11 May 2015 09:00:42 +0100 -Subject: [PATCH 052/195] scripts: Add mkknlimg and knlinfo scripts from tools +Subject: [PATCH 052/218] scripts: Add mkknlimg and knlinfo scripts from tools repo The Raspberry Pi firmware looks for a trailer on the kernel image to @@ -93676,10 +93676,10 @@ index 0000000000000000000000000000000000000000..60206de7fa9a49bd027c635306674a29 + return $trailer; +} -From 8e22e9449b95845c3fd4f0e36a5e4aeb8d828f66 Mon Sep 17 00:00:00 2001 +From 75eaa71803c4d693ae6a2c8e0b4e5510f036c1f2 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 10 Aug 2015 09:49:15 +0100 -Subject: [PATCH 053/195] scripts/dtc: Update to upstream version 1.4.1 +Subject: [PATCH 053/218] scripts/dtc: Update to upstream version 1.4.1 Includes the new localfixups format. @@ -96530,10 +96530,10 @@ index ad9b05ae698b0495ecbda42ffcf4743555313a27..2595dfda020fd9e03f0beff5006f229d -#define DTC_VERSION "DTC 1.4.1-g53bf130b" +#define DTC_VERSION "DTC 1.4.1-g25efc119" -From cbfcef0fdd2924747e975c45473502028eaed667 Mon Sep 17 00:00:00 2001 +From 7cea97bde2fb5a4958335b884aee20a5d5f03262 Mon Sep 17 00:00:00 2001 From: notro Date: Wed, 9 Jul 2014 14:46:08 +0200 -Subject: [PATCH 054/195] BCM2708: Add core Device Tree support +Subject: [PATCH 054/218] BCM2708: Add core Device Tree support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -106661,10 +106661,10 @@ index 0a07f9014944ed92a8e2e42983ae43be60b3e471..1967878a843461c3ff1f473b9a030eb0 # Bzip2 -From e44f5e5a40dd96280c8448757e0051a3a58c9b76 Mon Sep 17 00:00:00 2001 +From 2294dcf5e531118e721e9a4ff946aa7eaa1de06d Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 6 Feb 2015 13:50:57 +0000 -Subject: [PATCH 055/195] BCM270x_DT: Add pwr_led, and the required "input" +Subject: [PATCH 055/218] BCM270x_DT: Add pwr_led, and the required "input" trigger The "input" trigger makes the associated GPIO an input. This is to support @@ -106840,10 +106840,10 @@ index ddfcb2df3656cf0ab6aebd1fa3d624a6ec2e94e9..271563eb835f9018712e2076a88f341d /* Set LED brightness level * Must not sleep. Use brightness_set_blocking for drivers -From 45308705734decf5fecf256a237e39a59a87b1f9 Mon Sep 17 00:00:00 2001 +From 2ba877036465a3cd0848a8bf576650e01575571f Mon Sep 17 00:00:00 2001 From: Siarhei Siamashka Date: Mon, 17 Jun 2013 13:32:11 +0300 -Subject: [PATCH 056/195] fbdev: add FBIOCOPYAREA ioctl +Subject: [PATCH 056/218] fbdev: add FBIOCOPYAREA ioctl Based on the patch authored by Ali Gholami Rudi at https://lkml.org/lkml/2009/7/13/153 @@ -107095,10 +107095,10 @@ index fb795c3b3c178ad3cd7c9e9e4547ffd492bac181..703fa8a70574323abe2fb32599254582 __u32 dx; /* screen-relative */ __u32 dy; -From 7f13d10b4fd5d8c9263ecbad98b2b38afda539dd Mon Sep 17 00:00:00 2001 +From 051268acb9fcf7b4bbd5fa81a46af4989c419b27 Mon Sep 17 00:00:00 2001 From: Harm Hanemaaijer Date: Thu, 20 Jun 2013 20:21:39 +0200 -Subject: [PATCH 057/195] Speed up console framebuffer imageblit function +Subject: [PATCH 057/218] Speed up console framebuffer imageblit function Especially on platforms with a slower CPU but a relatively high framebuffer fill bandwidth, like current ARM devices, the existing @@ -107307,10 +107307,10 @@ index a2bb276a8b2463eee98eb237c4647bc00cd93601..436494fba15abecb400ef28688466faf start_index, pitch_index); } else -From 9aca0b5d406f18972ee006fb604c47214fefa073 Mon Sep 17 00:00:00 2001 +From aa6d09ed8941a36181549e9a273d5c2be4a3210e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 8 May 2013 11:46:50 +0100 -Subject: [PATCH 058/195] enabling the realtime clock 1-wire chip DS1307 and +Subject: [PATCH 058/218] enabling the realtime clock 1-wire chip DS1307 and 1-wire on GPIO4 (as a module) 1-wire: Add support for configuring pin for w1-gpio kernel module @@ -107560,10 +107560,10 @@ index d58594a3232492e33f1dd4babd3798b03e0f0203..feae94256256316fd9d850c3d83325af unsigned int ext_pullup_enable_pin; unsigned int pullup_duration; -From 60ec191c16e1911aae33101bd9a5cf19e5b52ab3 Mon Sep 17 00:00:00 2001 +From 4c53c26f2debff33c31c14abc1402edee7612551 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 18 Dec 2013 22:16:19 +0000 -Subject: [PATCH 059/195] config: Enable CONFIG_MEMCG, but leave it disabled +Subject: [PATCH 059/218] config: Enable CONFIG_MEMCG, but leave it disabled (due to memory cost). Enable with cgroup_enable=memory. --- @@ -107613,10 +107613,10 @@ index 4e2f3de0e40bff4caef5ee9c587ea19140d07f85..4b687fba53c58e744e04608a9510f9b8 * css_tryget_online_from_dir - get corresponding css from a cgroup dentry * @dentry: directory dentry of interest -From d04fbf878de58ed516a020fb112c9040829d4f77 Mon Sep 17 00:00:00 2001 +From a635f80a870e67a90449c8020caf161823570055 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 14 Jul 2014 22:02:09 +0100 -Subject: [PATCH 060/195] hid: Reduce default mouse polling interval to 60Hz +Subject: [PATCH 060/218] hid: Reduce default mouse polling interval to 60Hz Reduces overhead when using X --- @@ -107652,10 +107652,10 @@ index ae83af649a607f67239f1a64bf45dd4b5770cc7d..4a7af9d0b910f59d17421ce14138400d ret = -ENOMEM; if (usb_endpoint_dir_in(endpoint)) { -From 2c9be1a0b8e1f198ba662d2c3ccc34e28793c8d9 Mon Sep 17 00:00:00 2001 +From dda6011049f45177d51d4cffa8798751a1e88ea6 Mon Sep 17 00:00:00 2001 From: Gordon Hollingworth Date: Tue, 12 May 2015 14:47:56 +0100 -Subject: [PATCH 061/195] rpi-ft5406: Add touchscreen driver for pi LCD display +Subject: [PATCH 061/218] rpi-ft5406: Add touchscreen driver for pi LCD display Fix driver detection failure Check that the buffer response is non-zero meaning the touchscreen was detected @@ -108013,10 +108013,10 @@ index 227a107214a02deadcca3db202da265eba1fdd21..b0f6e33bd30c35664ceee057f4c3ad32 RPI_FIRMWARE_FRAMEBUFFER_SET_BACKLIGHT = 0x0004800f, -From d9edb140e6f70b4047bc230fba9410eb31bea047 Mon Sep 17 00:00:00 2001 +From e1be46efa290abbd5ceec146da1f4326028a4e83 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 28 Nov 2016 16:50:04 +0000 -Subject: [PATCH 062/195] Improve __copy_to_user and __copy_from_user +Subject: [PATCH 062/218] Improve __copy_to_user and __copy_from_user performance Provide a __copy_from_user that uses memcpy. On BCM2708, use @@ -109591,10 +109591,10 @@ index 333dc3c2e5ffbb2c5ab8fcfb6115b6162643cf20..46b787a6474ffa857da9b663948863ec bool "Broadcom BCM63xx DSL SoC" depends on ARCH_MULTI_V7 -From 08166a0d3381008dbacf6d7c6712e3e38249bce2 Mon Sep 17 00:00:00 2001 +From 3ad7c22da72db63a6167c33abf8240a17b218ab1 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 25 Jun 2015 12:16:11 +0100 -Subject: [PATCH 063/195] gpio-poweroff: Allow it to work on Raspberry Pi +Subject: [PATCH 063/218] gpio-poweroff: Allow it to work on Raspberry Pi The Raspberry Pi firmware manages the power-down and reboot process. To do this it installs a pm_power_off handler, causing @@ -109629,10 +109629,10 @@ index be3d81ff51cc3f510d85e4eed7a52960e51e7bc1..a030ae9fb1fca325061c093696e82186 "%s: pm_power_off function already registered", __func__); -From e305933993b90dcd79a369ad82eb784ba13976b7 Mon Sep 17 00:00:00 2001 +From dfe7f2d62dae24fe15574ac7e2f8366246f59659 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Jul 2015 14:32:47 +0100 -Subject: [PATCH 064/195] mfd: Add Raspberry Pi Sense HAT core driver +Subject: [PATCH 064/218] mfd: Add Raspberry Pi Sense HAT core driver --- drivers/input/joystick/Kconfig | 8 + @@ -110497,10 +110497,10 @@ index 0000000000000000000000000000000000000000..56196dc2af10e464a1e3f98b028dca1c + +#endif -From 39c16fd8cdfb643b6b1d25d325b69528dec1e557 Mon Sep 17 00:00:00 2001 +From 540cdcb47bdf4f5149c53e434bd78c221f55b1aa Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 19:19:08 +0100 -Subject: [PATCH 065/195] ASoC: Add support for HifiBerry DAC +Subject: [PATCH 065/218] ASoC: Add support for HifiBerry DAC This adds a machine driver for the HifiBerry DAC. It is a sound card that can @@ -110675,10 +110675,10 @@ index 0000000000000000000000000000000000000000..45f2b770ad9e67728ca599a7445d6ae9 +MODULE_DESCRIPTION("ASoC Driver for HifiBerry DAC"); +MODULE_LICENSE("GPL v2"); -From c6e16b91138a8839f351f817d7ec1d26f07bee88 Mon Sep 17 00:00:00 2001 +From 3e565e7da017d4f5e0d1bfaa276c897f4d8e21eb Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Mon, 25 Jan 2016 15:48:59 +0000 -Subject: [PATCH 066/195] ASoC: Add support for Rpi-DAC +Subject: [PATCH 066/218] ASoC: Add support for Rpi-DAC --- sound/soc/bcm/Kconfig | 7 +++ @@ -110962,10 +110962,10 @@ index 0000000000000000000000000000000000000000..afe1b419582aa40c4b2729d242bb13cd +MODULE_AUTHOR("Florian Meier "); +MODULE_LICENSE("GPL v2"); -From 769e1919a3117536b396e69abcbef6fd87f9898d Mon Sep 17 00:00:00 2001 +From 54ba948de55649b4311062b960ac598fd1e343de Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Wed, 15 Jan 2014 21:41:23 +0100 -Subject: [PATCH 067/195] ASoC: wm8804: Implement MCLK configuration options, +Subject: [PATCH 067/218] ASoC: wm8804: Implement MCLK configuration options, add 32bit support WM8804 can run with PLL frequencies of 256xfs and 128xfs for most sample rates. At 192kHz only 128xfs is supported. The existing driver selects 128xfs automatically for some lower samples rates. By using an @@ -111014,10 +111014,10 @@ index af95d648265b3e92e345101542b332aee35191d4..513f56ba132929662802d15cdc653af3 .component_driver = { .dapm_widgets = wm8804_dapm_widgets, -From 74f476bd0f05316509027c101c773d82a1069db8 Mon Sep 17 00:00:00 2001 +From 7701371e18ce44bb83097970736a7dd3da70223f Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Wed, 15 Jan 2014 21:42:08 +0100 -Subject: [PATCH 068/195] ASoC: BCM:Add support for HiFiBerry Digi. Driver is +Subject: [PATCH 068/218] ASoC: BCM:Add support for HiFiBerry Digi. Driver is based on the patched WM8804 driver. Signed-off-by: Daniel Matuschek @@ -111361,10 +111361,10 @@ index 0000000000000000000000000000000000000000..19dc953b7227ba86123fc7a2ba654499 +MODULE_DESCRIPTION("ASoC Driver for HifiBerry Digi"); +MODULE_LICENSE("GPL v2"); -From 7c151396e392d3e9bca76bb247f84401f8327867 Mon Sep 17 00:00:00 2001 +From aaa66213b6e0f98430d8d6371f8377d8ee56528f Mon Sep 17 00:00:00 2001 From: Gordon Garrity Date: Sat, 8 Mar 2014 16:56:57 +0000 -Subject: [PATCH 069/195] Add IQaudIO Sound Card support for Raspberry Pi +Subject: [PATCH 069/218] Add IQaudIO Sound Card support for Raspberry Pi Set a limit of 0dB on Digital Volume Control @@ -111694,10 +111694,10 @@ index 0000000000000000000000000000000000000000..4e8e6dec14bcf4a1ff286c43742d4097 +MODULE_DESCRIPTION("ASoC Driver for IQAudio DAC"); +MODULE_LICENSE("GPL v2"); -From 1e5cc1a1e1bb6a4203223b998524ad1a513eb20d Mon Sep 17 00:00:00 2001 +From 4d86db61c9eb9c5037d46078522416dde915999f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 25 Jul 2016 17:06:50 +0100 -Subject: [PATCH 070/195] iqaudio-dac: Compile fix - untested +Subject: [PATCH 070/218] iqaudio-dac: Compile fix - untested --- sound/soc/bcm/iqaudio-dac.c | 6 +++++- @@ -111721,10 +111721,10 @@ index 4e8e6dec14bcf4a1ff286c43742d4097249d6777..aa15bc4b49ca95edec905fddd8fd0a6d if (dapm->dev != codec_dai->dev) return 0; -From 0a636d84b00214c0da8e45362d6244bab46db3c8 Mon Sep 17 00:00:00 2001 +From df7a06f24a6a53798abb2a44a08ece3d390878b1 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Mon, 4 Aug 2014 10:06:56 +0200 -Subject: [PATCH 071/195] Added support for HiFiBerry DAC+ +Subject: [PATCH 071/218] Added support for HiFiBerry DAC+ The driver is based on the HiFiBerry DAC driver. However HiFiBerry DAC+ uses a different codec chip (PCM5122), therefore a new driver is necessary. @@ -112354,10 +112354,10 @@ index 72b19e62f6267698aea45d2410d616d91c1825cb..c6839ef6e16754ed9de2698507b8986a dev_err(dev, "No LRCLK?\n"); return -EINVAL; -From ab6aef1455d7af93189b0b251b1064e4b16b3545 Mon Sep 17 00:00:00 2001 +From 29decd4832a192d1e26d42ecbe6f2c6982f5c76c Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Mon, 4 Aug 2014 11:09:58 +0200 -Subject: [PATCH 072/195] Added driver for HiFiBerry Amp amplifier add-on board +Subject: [PATCH 072/218] Added driver for HiFiBerry Amp amplifier add-on board The driver contains a low-level hardware driver for the TAS5713 and the drivers for the Raspberry Pi I2S subsystem. @@ -113197,10 +113197,10 @@ index 0000000000000000000000000000000000000000..8f019e04898754d2f87e9630137be9e8 + +#endif /* _TAS5713_H */ -From baa874a48eb5a5ce3781d82d87c27195df5b3d38 Mon Sep 17 00:00:00 2001 +From ba33415ed5a3c32bc9559eecb7f8fa13d1b1c337 Mon Sep 17 00:00:00 2001 From: Ryan Coe Date: Sat, 31 Jan 2015 18:25:49 -0700 -Subject: [PATCH 073/195] Update ds1307 driver for device-tree support +Subject: [PATCH 073/218] Update ds1307 driver for device-tree support Signed-off-by: Ryan Coe --- @@ -113227,10 +113227,10 @@ index 4e31036ee2596dec93accd26f627c5b95591ae9f..b92044cf03e750afa521a93519500e9d .driver = { .name = "rtc-ds1307", -From de9149fddd927a93bfb8773a62d342fd4f67ae77 Mon Sep 17 00:00:00 2001 +From 7b813c571adfa61cbfa3fe3abb9a6a65d70c6ad6 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 25 Mar 2015 09:26:17 +0100 -Subject: [PATCH 074/195] Add driver for rpi-proto +Subject: [PATCH 074/218] Add driver for rpi-proto Forward port of 3.10.x driver from https://github.com/koalo We are using a custom board and would like to use rpi 3.18.x @@ -113446,10 +113446,10 @@ index 0000000000000000000000000000000000000000..9db678e885efd63d84d60a098a84ed67 +MODULE_DESCRIPTION("ASoC Driver for Raspberry Pi connected to PROTO board (WM8731)"); +MODULE_LICENSE("GPL"); -From ea17db7f586c076b7cbe74ce08b9073529d84a61 Mon Sep 17 00:00:00 2001 +From a0a0460bd27f5fc1103198760614f2e85b8d476c Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Mon, 24 Aug 2015 16:03:47 +0100 -Subject: [PATCH 075/195] RaspiDAC3 support +Subject: [PATCH 075/218] RaspiDAC3 support Signed-off-by: Jan Grulich @@ -113692,10 +113692,10 @@ index 0000000000000000000000000000000000000000..dd9eeea2af0382307f437e6db09d1546 +MODULE_DESCRIPTION("ASoC Driver for RaspiDAC Rev.3x"); +MODULE_LICENSE("GPL v2"); -From 1a9ea34f03d648405cfa78248d9c7fa06a2a778c Mon Sep 17 00:00:00 2001 +From c39d8e02d67e4e99078ac26f0137cfe92c4ecfb0 Mon Sep 17 00:00:00 2001 From: Aaron Shaw Date: Thu, 7 Apr 2016 21:26:21 +0100 -Subject: [PATCH 076/195] Add Support for JustBoom Audio boards +Subject: [PATCH 076/218] Add Support for JustBoom Audio boards justboom-dac: Adjust for ALSA API change @@ -114149,10 +114149,10 @@ index 0000000000000000000000000000000000000000..91acb666380faa3c0deb2230f8a0f8bb +MODULE_DESCRIPTION("ASoC Driver for JustBoom PI Digi HAT Sound Card"); +MODULE_LICENSE("GPL v2"); -From c9f42c05645277bc80d2d3f7f1545fd79fad240c Mon Sep 17 00:00:00 2001 +From 5f3f2da4ee3ea9c624e95e1e2252473417a5ac16 Mon Sep 17 00:00:00 2001 From: Andrey Grodzovsky Date: Tue, 3 May 2016 22:10:59 -0400 -Subject: [PATCH 077/195] ARM: adau1977-adc: Add basic machine driver for +Subject: [PATCH 077/218] ARM: adau1977-adc: Add basic machine driver for adau1977 codec driver. This commit adds basic support for the codec usage including: Device tree overlay, @@ -114334,10 +114334,10 @@ index 0000000000000000000000000000000000000000..6e2ee027926ee63c89222f75ceb89e3d +MODULE_DESCRIPTION("ASoC Driver for ADAU1977 ADC"); +MODULE_LICENSE("GPL v2"); -From 61a4cb778e449eb643be5f8e1d5399b5256cfa68 Mon Sep 17 00:00:00 2001 +From 74de3f54c5afb269c2fd54c4634eb3a4ba5f5970 Mon Sep 17 00:00:00 2001 From: Matt Flax Date: Mon, 16 May 2016 21:36:31 +1000 -Subject: [PATCH 078/195] New AudioInjector.net Pi soundcard with low jitter +Subject: [PATCH 078/218] New AudioInjector.net Pi soundcard with low jitter audio in and out. Contains the sound/soc/bcm ALSA machine driver and necessary alterations to the Kconfig and Makefile. @@ -114588,10 +114588,10 @@ index 0000000000000000000000000000000000000000..ef54e0f07ea03f59e9957b5d98f3e7fd +MODULE_ALIAS("platform:audioinjector-pi-soundcard"); + -From d30e5affce1120c75a2541ae3ba0419960e747d3 Mon Sep 17 00:00:00 2001 +From aafa67930ffb8b5894caa32b2b560a94a1cd755c Mon Sep 17 00:00:00 2001 From: DigitalDreamtime Date: Thu, 30 Jun 2016 18:38:42 +0100 -Subject: [PATCH 079/195] Add IQAudIO Digi WM8804 board support +Subject: [PATCH 079/218] Add IQAudIO Digi WM8804 board support Support IQAudIO Digi board with iqaudio_digi machine driver and iqaudio-digi-wm8804-audio overlay. @@ -114891,10 +114891,10 @@ index 0000000000000000000000000000000000000000..9b6e829bcb5b1762a853775e78163196 +MODULE_DESCRIPTION("ASoC Driver for IQAudIO WM8804 Digi"); +MODULE_LICENSE("GPL v2"); -From f8ee16577547400d84d47e0c8b55978dd6c33fac Mon Sep 17 00:00:00 2001 +From 4cff7d46d832bacdaa31fd7e1f94d4020bd7bf1d Mon Sep 17 00:00:00 2001 From: escalator2015 Date: Tue, 24 May 2016 16:20:09 +0100 -Subject: [PATCH 080/195] New driver for RRA DigiDAC1 soundcard using WM8741 + +Subject: [PATCH 080/218] New driver for RRA DigiDAC1 soundcard using WM8741 + WM8804 --- @@ -115367,10 +115367,10 @@ index 0000000000000000000000000000000000000000..446796e7e4c14a7d95b2f2a01211d9a0 +MODULE_DESCRIPTION("ASoC Driver for RRA DigiDAC1"); +MODULE_LICENSE("GPL v2"); -From ebb9e9e05bec1d8f38f77aeed5179e1a1f368d3a Mon Sep 17 00:00:00 2001 +From 709f7d5a16bfe63063b19bc21d3ca2f66aef0e87 Mon Sep 17 00:00:00 2001 From: DigitalDreamtime Date: Sat, 2 Jul 2016 16:26:19 +0100 -Subject: [PATCH 081/195] Add support for Dion Audio LOCO DAC-AMP HAT +Subject: [PATCH 081/218] Add support for Dion Audio LOCO DAC-AMP HAT Using dedicated machine driver and pcm5102a codec driver. @@ -115543,10 +115543,10 @@ index 0000000000000000000000000000000000000000..89e65317512bc774453ac8d0d5b0ff98 +MODULE_DESCRIPTION("ASoC Driver for DionAudio LOCO"); +MODULE_LICENSE("GPL v2"); -From 1248d649c9d73f61351422fddbca75d2f736ba2b Mon Sep 17 00:00:00 2001 +From fd3ceaaa95177a0cdd58552c6beded58cbfb3204 Mon Sep 17 00:00:00 2001 From: Clive Messer Date: Mon, 19 Sep 2016 14:01:04 +0100 -Subject: [PATCH 082/195] Allo Piano DAC boards: Initial 2 channel (stereo) +Subject: [PATCH 082/218] Allo Piano DAC boards: Initial 2 channel (stereo) support (#1645) Add initial 2 channel (stereo) support for Allo Piano DAC (2.0/2.1) boards, @@ -115753,10 +115753,10 @@ index 0000000000000000000000000000000000000000..8e8e62e5a36a279b425ed4655cfbac99 +MODULE_DESCRIPTION("ALSA ASoC Machine Driver for Allo Piano DAC"); +MODULE_LICENSE("GPL v2"); -From 40704006ff2a3ccfeefbe480fbcb884b4b225618 Mon Sep 17 00:00:00 2001 +From 9c37e3828cd45d0f2e7dc58446b1e0847426388f Mon Sep 17 00:00:00 2001 From: gtrainavicius Date: Sun, 23 Oct 2016 12:06:53 +0300 -Subject: [PATCH 083/195] Support for Blokas Labs pisound board +Subject: [PATCH 083/218] Support for Blokas Labs pisound board Pisound dynamic overlay (#1760) @@ -116933,10 +116933,10 @@ index 0000000000000000000000000000000000000000..4b8545487d06e4ea70073a5d063fb231 +MODULE_DESCRIPTION("ASoC Driver for pisound, http://blokas.io/pisound"); +MODULE_LICENSE("GPL v2"); -From c6cfce340c9e66d904de0c1a4ac4264c74dcd6c7 Mon Sep 17 00:00:00 2001 +From 2974944eb79031316bfc92affe59d5df954a33ed Mon Sep 17 00:00:00 2001 From: P33M Date: Wed, 21 Oct 2015 14:55:21 +0100 -Subject: [PATCH 084/195] rpi_display: add backlight driver and overlay +Subject: [PATCH 084/218] rpi_display: add backlight driver and overlay Add a mailbox-driven backlight controller for the Raspberry Pi DSI touchscreen display. Requires updated GPU firmware to recognise the @@ -117105,10 +117105,10 @@ index 0000000000000000000000000000000000000000..14a0d9b037395497c1fdae2961feccd5 +MODULE_DESCRIPTION("Raspberry Pi mailbox based Backlight Driver"); +MODULE_LICENSE("GPL"); -From ccdfe767d04450d7309f13a573a8aaf74adf8059 Mon Sep 17 00:00:00 2001 +From ce679e61bff1017cb514723e77e074bf4bc4b7df Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 23 Feb 2016 19:56:04 +0000 -Subject: [PATCH 085/195] bcm2835-virtgpio: Virtual GPIO driver +Subject: [PATCH 085/218] bcm2835-virtgpio: Virtual GPIO driver Add a virtual GPIO driver that uses the firmware mailbox interface to request that the VPU toggles LEDs. @@ -117382,10 +117382,10 @@ index b0f6e33bd30c35664ceee057f4c3ad32b914291d..e92278968b2b979db2a1f855f70e7aaf RPI_FIRMWARE_FRAMEBUFFER_SET_BACKLIGHT = 0x0004800f, -From 4264026d5a660c3a083ce7f69bcb1ced3b86c7c1 Mon Sep 17 00:00:00 2001 +From fa865f8ae8697b140fb9ed78e7e3ca7dfaa64a07 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 23 Feb 2016 17:26:48 +0000 -Subject: [PATCH 086/195] amba_pl011: Don't use DT aliases for numbering +Subject: [PATCH 086/218] amba_pl011: Don't use DT aliases for numbering The pl011 driver looks for DT aliases of the form "serial", and if found uses as the device ID. This can cause @@ -117414,10 +117414,10 @@ index e2c33b9528d82ed7a2c27d083d7b1d222da68178..5a11ff833e1fd112ba04df3a427cd94b uap->old_cr = 0; uap->port.dev = dev; -From 7a7f9524e467f9553bbd6b21c21de36b08a1ff8e Mon Sep 17 00:00:00 2001 +From 2b5ac1985a3751b464d3155a8bc8ac3b167a5ba3 Mon Sep 17 00:00:00 2001 From: Pantelis Antoniou Date: Wed, 3 Dec 2014 13:23:28 +0200 -Subject: [PATCH 087/195] OF: DT-Overlay configfs interface +Subject: [PATCH 087/218] OF: DT-Overlay configfs interface This is a port of Pantelis Antoniou's v3 port that makes use of the new upstreamed configfs support for binary attributes. @@ -117849,10 +117849,10 @@ index 0000000000000000000000000000000000000000..0037e6868a6cda8706c88194c6a4454b +} +late_initcall(of_cfs_init); -From a8ebf7daf7ec6ed7b0c69bf094afa072fa8d021f Mon Sep 17 00:00:00 2001 +From 50468f3194787eab674581c490b66cf5693cb060 Mon Sep 17 00:00:00 2001 From: Cheong2K Date: Fri, 26 Feb 2016 18:20:10 +0800 -Subject: [PATCH 088/195] brcm: adds support for BCM43341 wifi +Subject: [PATCH 088/218] brcm: adds support for BCM43341 wifi brcmfmac: Disable power management @@ -117983,7 +117983,7 @@ index 3e15d64c64813513bc22202dd9e468588699abb0..4051780f64f44a5ce522babe6c371a1b MODULE_PARM_DESC(roamoff, "Do not use internal roaming engine"); diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c -index b892dac70f4b02f76e01a7ccb580c6d8aed4bfe4..db5f8b70b407879f1c006ca4b7ab78d12974609d 100644 +index 2458e6e05276c3ff7cb067bdfa1edf34a1eec09b..d13826095c09f5b4037625371fe648900c9d670a 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c @@ -604,6 +604,7 @@ BRCMF_FW_NVRAM_DEF(4329, "brcmfmac4329-sdio.bin", "brcmfmac4329-sdio.txt"); @@ -118015,10 +118015,10 @@ index d0407d9ad7827cd756b6311410ffe2d9a7cacc78..f1fb8a3c7a3211e8429585861f2f42e0 #define BRCM_CC_4335_CHIP_ID 0x4335 #define BRCM_CC_4339_CHIP_ID 0x4339 -From 187a4873783f427e90afdc0712a8552581196465 Mon Sep 17 00:00:00 2001 +From 4a73ed11dfe1b97dc5e41a852fa89bac2f6985a0 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 17 Dec 2015 13:37:07 +0000 -Subject: [PATCH 089/195] hci_h5: Don't send conf_req when ACTIVE +Subject: [PATCH 089/218] hci_h5: Don't send conf_req when ACTIVE Without this patch, a modem and kernel can continuously bombard each other with conf_req and conf_rsp messages, in a demented game of tag. @@ -118041,10 +118041,10 @@ index 0879d64b1caf58afb6e5d494c07d9ab7e7cdf983..5161ab30fd533d50f516bb93d5b9f402 if (H5_HDR_LEN(hdr) > 2) h5->tx_win = (data[2] & 0x07); -From b934aa13b89512d92b7b16739c7aa1c8583320d2 Mon Sep 17 00:00:00 2001 +From 11b51311723815f63d7b9d8461721f8a972a78dc Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 13 Apr 2015 17:16:29 +0100 -Subject: [PATCH 090/195] config: Add default configs +Subject: [PATCH 090/218] config: Add default configs --- arch/arm/configs/bcm2709_defconfig | 1297 +++++++++++++++++++++++++++++++++++ @@ -120671,10 +120671,10 @@ index 0000000000000000000000000000000000000000..8acee9f31202ec14f2933d92dd70831c +CONFIG_CRC_ITU_T=y +CONFIG_LIBCRC32C=y -From 0f5daea12d673823d4db5c76fdd6ba565820730b Mon Sep 17 00:00:00 2001 +From 424977b72a54d3908735fd1ba26fc884b41c7472 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Wed, 24 Aug 2016 03:35:56 -0700 -Subject: [PATCH 091/195] Add arm64 configuration and device tree differences. +Subject: [PATCH 091/218] Add arm64 configuration and device tree differences. Disable MMC_BCM2835_SDHOST and MMC_BCM2835 since these drivers are crashing at the moment. @@ -122089,10 +122089,10 @@ index 0000000000000000000000000000000000000000..d7406f5a4620151044b8f716b4d10bb8 +CONFIG_LIBCRC32C=y +CONFIG_BCM2708_VCHIQ=n -From 7fa960ca92313064fbff20339d0d78780aa56e71 Mon Sep 17 00:00:00 2001 +From 04a4a31a812a46493fa4a47731ade757bbc1167f Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 7 Mar 2016 15:05:11 +0000 -Subject: [PATCH 092/195] vchiq_arm: Tweak the logging output +Subject: [PATCH 092/218] vchiq_arm: Tweak the logging output Signed-off-by: Phil Elwell --- @@ -122167,10 +122167,10 @@ index 2c98da4307dff994a00dc246574ef0aaee05d5da..160db24aeea33a8296923501009c1f02 switch (type) { -From d66e132c23099fcfdd723516415ecefea4942a02 Mon Sep 17 00:00:00 2001 +From dc49d8e344521a27ef12aeeda2a91d5e3b2d5ec9 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 23 Mar 2016 14:16:25 +0000 -Subject: [PATCH 093/195] vchiq_arm: Access the dequeue_pending flag locked +Subject: [PATCH 093/218] vchiq_arm: Access the dequeue_pending flag locked Reading through this code looking for another problem (now found in userland) the use of dequeue_pending outside a lock didn't seem safe. @@ -122228,10 +122228,10 @@ index 7b6cd4d80621e38ff6d47fcd87b45fbe9cd4259b..d8669fa7f39b077877eca1829ba9538b return add_completion(instance, reason, header, user_service, -From 5ae56ab06076aa6754197e167fb0e9a40d667332 Mon Sep 17 00:00:00 2001 +From 05274c0b04073c8eaba6fed99ebb4b2d3c9bc441 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 23 Mar 2016 20:53:47 +0000 -Subject: [PATCH 094/195] vchiq_arm: Service callbacks must not fail +Subject: [PATCH 094/218] vchiq_arm: Service callbacks must not fail Service callbacks are not allowed to return an error. The internal callback that delivers events and messages to user tasks does not enqueue them if @@ -122257,10 +122257,10 @@ index d8669fa7f39b077877eca1829ba9538bf2e21a82..54552c6ce54f413c9781ba279b936f98 DEBUG_TRACE(SERVICE_CALLBACK_LINE); } -From bd4af8e5bcdc6f1151627932fa34008676e40314 Mon Sep 17 00:00:00 2001 +From ef469b76c3f6a3310e5f86cf4aef487ad812fcb1 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 21 Apr 2016 13:49:32 +0100 -Subject: [PATCH 095/195] vchiq_arm: Add completion records under the mutex +Subject: [PATCH 095/218] vchiq_arm: Add completion records under the mutex An issue was observed when flushing openmax components which generate a large number of messages returning @@ -122323,10 +122323,10 @@ index 54552c6ce54f413c9781ba279b936f98be4f47b0..bde8955b7d8505d73579b77b5b392154 return VCHIQ_SUCCESS; -From 3d1b86af5ee432a855f431eb9e64ba5822cb4f35 Mon Sep 17 00:00:00 2001 +From 9652d5940973327a07df78f03b8702cca86c448c Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 20 Jun 2016 13:51:44 +0100 -Subject: [PATCH 096/195] vchiq_arm: Avoid use of mutex in add_completion +Subject: [PATCH 096/218] vchiq_arm: Avoid use of mutex in add_completion Claiming the completion_mutex within add_completion did prevent some messages appearing twice, but provokes a deadlock caused by vcsm using @@ -122520,10 +122520,10 @@ index 160db24aeea33a8296923501009c1f02bc41e599..71a3bedc55314f3b22dbff40c05dedf0 up(&state->slot_available_event); } -From 3be21930df531cedf33eab0cbc18190da728cc5b Mon Sep 17 00:00:00 2001 +From f87b3c8d50da44368da15bad05fe27e8288a37fd Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 3 Oct 2016 10:14:10 -0700 -Subject: [PATCH 097/195] staging/vchi: Convert to current get_user_pages() +Subject: [PATCH 097/218] staging/vchi: Convert to current get_user_pages() arguments. Signed-off-by: Eric Anholt @@ -122560,10 +122560,10 @@ index e5cdda12c7e5c35c69eb96991cfdb8326def167f..085d37588c59198b4e5f00b9249bb842 num_pages, /* len */ 0, /* gup_flags */ -From 5a19fb1bf33a7eda64ea20072904b7ac2154111a Mon Sep 17 00:00:00 2001 +From 413d0c8e605ebe7764382cdfa68621e4404ef129 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 3 Oct 2016 10:16:03 -0700 -Subject: [PATCH 098/195] staging/vchi: Update for rename of +Subject: [PATCH 098/218] staging/vchi: Update for rename of page_cache_release() to put_page(). Signed-off-by: Eric Anholt @@ -122608,10 +122608,10 @@ index 085d37588c59198b4e5f00b9249bb8421695854f..5a2b8fb459ebe086ec229f37b6381bdb kfree(pages); } -From 11ddfb1cdc823b389a88d10c157b0b0978558be4 Mon Sep 17 00:00:00 2001 +From d8437d9b2ebfb647dce38a2c6123a3efab47982b Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 3 Oct 2016 10:21:17 -0700 -Subject: [PATCH 099/195] drivers/vchi: Remove dependency on CONFIG_BROKEN. +Subject: [PATCH 099/218] drivers/vchi: Remove dependency on CONFIG_BROKEN. The driver builds now. @@ -122633,10 +122633,10 @@ index 9676fb29075a457109e4d4235f086987aec74868..db8e1beb89f9f8c48ea5964016c8285e help Kernel to VideoCore communication interface for the -From 4634b593be96a6a8334e1e8ce454b43faf3f9ada Mon Sep 17 00:00:00 2001 +From 5f8a862d2f906dc4c2cca5ae6f1e4ba6a0c9a3b5 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 14 Sep 2016 09:16:19 +0100 -Subject: [PATCH 100/195] raspberrypi-firmware: Export the general transaction +Subject: [PATCH 100/218] raspberrypi-firmware: Export the general transaction function. The vc4-firmware-kms module is going to be doing the MBOX FB call. @@ -122680,10 +122680,10 @@ index e92278968b2b979db2a1f855f70e7aafb224fa98..09e3d871d110eb0762ebdb5ea3293537 #endif /* __SOC_RASPBERRY_FIRMWARE_H__ */ -From 0287716933dc2e9c903098b9d92b83a9df4cd1e8 Mon Sep 17 00:00:00 2001 +From 0bcc5c96d2d2968c08b415cd4cae06436c0bffa2 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 14 Sep 2016 09:18:09 +0100 -Subject: [PATCH 101/195] raspberrypi-firmware: Define the MBOX channel in the +Subject: [PATCH 101/218] raspberrypi-firmware: Define the MBOX channel in the header. Signed-off-by: Eric Anholt @@ -122705,10 +122705,10 @@ index 09e3d871d110eb0762ebdb5ea329353738d58661..2859db09e25bb945251e85edb39bc434 enum rpi_firmware_property_status { -From 503c31b4182d2829f5f15fd212efc826a716d120 Mon Sep 17 00:00:00 2001 +From 642a5b8183dad8854807a49143df68b2a1f2e777 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 14 Sep 2016 08:39:33 +0100 -Subject: [PATCH 102/195] drm/vc4: Add a mode for using the closed firmware for +Subject: [PATCH 102/218] drm/vc4: Add a mode for using the closed firmware for display. Signed-off-by: Eric Anholt @@ -122734,10 +122734,10 @@ index fb77db755e0a29d8589860da82186c7a1f394c72..c6dd06cca9830018c39b3b16afe4045e vc4_gem.o \ vc4_hdmi.o \ diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c -index d544ff9b0d4609aae945960bf82e8aeee6bc94a8..13212788eef0e4b77c1e92e6bf3a56c817c50322 100644 +index 7aadce1f7e7a0e56b302bded53ad8c0d5977cc22..bdf32c572fc2c46932daca934dfb002d05493883 100644 --- a/drivers/gpu/drm/vc4/vc4_crtc.c +++ b/drivers/gpu/drm/vc4/vc4_crtc.c -@@ -163,6 +163,9 @@ int vc4_crtc_get_scanoutpos(struct drm_device *dev, unsigned int crtc_id, +@@ -162,6 +162,9 @@ int vc4_crtc_get_scanoutpos(struct drm_device *dev, unsigned int crtc_id, int vblank_lines; int ret = 0; @@ -122747,7 +122747,7 @@ index d544ff9b0d4609aae945960bf82e8aeee6bc94a8..13212788eef0e4b77c1e92e6bf3a56c8 /* preempt_disable_rt() should go right here in PREEMPT_RT patchset. */ /* Get optional system timestamp before query. */ -@@ -656,6 +659,11 @@ int vc4_enable_vblank(struct drm_device *dev, unsigned int crtc_id) +@@ -655,6 +658,11 @@ int vc4_enable_vblank(struct drm_device *dev, unsigned int crtc_id) struct vc4_dev *vc4 = to_vc4_dev(dev); struct vc4_crtc *vc4_crtc = vc4->crtc[crtc_id]; @@ -122759,7 +122759,7 @@ index d544ff9b0d4609aae945960bf82e8aeee6bc94a8..13212788eef0e4b77c1e92e6bf3a56c8 CRTC_WRITE(PV_INTEN, PV_INT_VFP_START); return 0; -@@ -666,6 +674,11 @@ void vc4_disable_vblank(struct drm_device *dev, unsigned int crtc_id) +@@ -665,6 +673,11 @@ void vc4_disable_vblank(struct drm_device *dev, unsigned int crtc_id) struct vc4_dev *vc4 = to_vc4_dev(dev); struct vc4_crtc *vc4_crtc = vc4->crtc[crtc_id]; @@ -122772,10 +122772,10 @@ index d544ff9b0d4609aae945960bf82e8aeee6bc94a8..13212788eef0e4b77c1e92e6bf3a56c8 } diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c -index 8703f56b794774ac4130a7b487472e293ebe7cdf..6c4a4fbc86d0a30a6977b2081bca4372e693b817 100644 +index 246d1aea87bc91eb09378dda54dd23e22c47ca8f..e0b4c4d475ad72682e2119fc2983afb91ac6fb02 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c -@@ -292,6 +292,7 @@ static struct platform_driver *const component_drivers[] = { +@@ -295,6 +295,7 @@ static struct platform_driver *const component_drivers[] = { &vc4_dpi_driver, &vc4_hvs_driver, &vc4_crtc_driver, @@ -122784,7 +122784,7 @@ index 8703f56b794774ac4130a7b487472e293ebe7cdf..6c4a4fbc86d0a30a6977b2081bca4372 }; diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h -index 7c1e4d97486fb57d9ce7002c30a23138519761ae..e1f6ab747f36dd412e00a1e7ea772f13c2fc32d5 100644 +index 50a55ef999d6f669542306aa71e56ce47cb12951..b9169550bf15504f1ff3d8b31a3710e9b4c42e88 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.h +++ b/drivers/gpu/drm/vc4/vc4_drv.h @@ -12,6 +12,9 @@ @@ -122797,7 +122797,7 @@ index 7c1e4d97486fb57d9ce7002c30a23138519761ae..e1f6ab747f36dd412e00a1e7ea772f13 struct vc4_hdmi *hdmi; struct vc4_hvs *hvs; struct vc4_crtc *crtc[3]; -@@ -460,6 +463,10 @@ void __iomem *vc4_ioremap_regs(struct platform_device *dev, int index); +@@ -462,6 +465,10 @@ void __iomem *vc4_ioremap_regs(struct platform_device *dev, int index); extern struct platform_driver vc4_dpi_driver; int vc4_dpi_debugfs_regs(struct seq_file *m, void *unused); @@ -123475,10 +123475,10 @@ index 0000000000000000000000000000000000000000..d18a1dae51a2275846c9826b5bf1ba57 + }, +}; -From 3d453cda638ea3a152f1de6138e9513f0f94daeb Mon Sep 17 00:00:00 2001 +From b675ada7f1a84f52793a390c51b305fb13ede51f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Sat, 17 Sep 2016 15:07:10 +0200 -Subject: [PATCH 103/195] i2c: bcm2835: Fix hang for writing messages larger +Subject: [PATCH 103/218] i2c: bcm2835: Fix hang for writing messages larger than 16 bytes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -123568,10 +123568,10 @@ index d4f3239b56865919e1b781b20a7c5ebcd76b4eb9..f283b714aa79e2e4685ed95b04b6b289 i2c_dev->msg_buf_remaining = msg->len; reinit_completion(&i2c_dev->completion); -From 0330bcd32b9a41ef4a8db70c8c9d2190ddcd55fe Mon Sep 17 00:00:00 2001 +From fd4534326a4b6a706b81b76e18410fe91615da11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 23 Sep 2016 18:24:38 +0200 -Subject: [PATCH 104/195] i2c: bcm2835: Protect against unexpected TXW/RXR +Subject: [PATCH 104/218] i2c: bcm2835: Protect against unexpected TXW/RXR interrupts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -123696,10 +123696,10 @@ index f283b714aa79e2e4685ed95b04b6b289f7e9eee7..d2ba1a4de36af512e8e3c97251bd3537 return -ETIMEDOUT; } -From 7af5f0b0c52cc280acab000e67068e57ba3dd161 Mon Sep 17 00:00:00 2001 +From dfce104be6d350929d1c93da8ce194d5e4b8bbd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Mon, 19 Sep 2016 17:19:41 +0200 -Subject: [PATCH 105/195] i2c: bcm2835: Use dev_dbg logging on transfer errors +Subject: [PATCH 105/218] i2c: bcm2835: Use dev_dbg logging on transfer errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -123731,10 +123731,10 @@ index d2ba1a4de36af512e8e3c97251bd3537ae61591a..54d510abd46a117c9238fc6d7edec840 if (i2c_dev->msg_err & BCM2835_I2C_S_ERR) return -EREMOTEIO; -From 6e2adc26f61ad18adedd24d0e4f8e3fab02619e3 Mon Sep 17 00:00:00 2001 +From f41a248b33e2432839f40f52a09e1d4d8cbc81ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Thu, 22 Sep 2016 22:05:50 +0200 -Subject: [PATCH 106/195] i2c: bcm2835: Can't support I2C_M_IGNORE_NAK +Subject: [PATCH 106/218] i2c: bcm2835: Can't support I2C_M_IGNORE_NAK MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -123778,10 +123778,10 @@ index 54d510abd46a117c9238fc6d7edec84019d1f60d..565ef69ce61423544dc0558c85ef318b if (i2c_dev->msg_err & BCM2835_I2C_S_ERR) -From 62fe714dbc4d4f24dc6c99e1c2c3204ff6521532 Mon Sep 17 00:00:00 2001 +From d6d13ab633948cee059f172e72b0e85f745ca97c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 23 Sep 2016 04:54:27 +0200 -Subject: [PATCH 107/195] i2c: bcm2835: Add support for Repeated Start +Subject: [PATCH 107/218] i2c: bcm2835: Add support for Repeated Start Condition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -123963,10 +123963,10 @@ index 565ef69ce61423544dc0558c85ef318b0ae9c324..241e08ae7c27cec23fad3c1bf3ebad3a static u32 bcm2835_i2c_func(struct i2c_adapter *adap) -From 0605626412fb91762d08c82e2f9974fa4dc2db40 Mon Sep 17 00:00:00 2001 +From 5739991f3a5b79a86800059e33046b8cb0dda64b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 23 Sep 2016 04:57:17 +0200 -Subject: [PATCH 108/195] i2c: bcm2835: Support i2c-dev ioctl I2C_TIMEOUT +Subject: [PATCH 108/218] i2c: bcm2835: Support i2c-dev ioctl I2C_TIMEOUT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -124003,10 +124003,10 @@ index 241e08ae7c27cec23fad3c1bf3ebad3a4d2a8e6f..d2085dd3742eabebc537621968088261 bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_C, BCM2835_I2C_C_CLEAR); -From c50169d545289bc8b801fd4f71a19b501e010f1b Mon Sep 17 00:00:00 2001 +From 078f32a8780445ba5e09f0ba1313d971f8188410 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Tue, 27 Sep 2016 01:00:08 +0200 -Subject: [PATCH 109/195] i2c: bcm2835: Add support for dynamic clock +Subject: [PATCH 109/218] i2c: bcm2835: Add support for dynamic clock MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -124122,10 +124122,10 @@ index d2085dd3742eabebc537621968088261f8dc7ea8..c3436f627028477f7e21b47e079fd5ab irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); if (!irq) { -From a38a28c20aab9fabad173747b16af305fdc26c6b Mon Sep 17 00:00:00 2001 +From 88d0ab8911f2fadda12dabb76b1d093de592a483 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Tue, 1 Nov 2016 15:15:41 +0100 -Subject: [PATCH 110/195] i2c: bcm2835: Add debug support +Subject: [PATCH 110/218] i2c: bcm2835: Add debug support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -124314,10 +124314,10 @@ index c3436f627028477f7e21b47e079fd5ab06ec188a..8642f580ce41803bd22c76a0fa80d083 if (i2c_dev->msg_err & BCM2835_I2C_S_ERR) return -EREMOTEIO; -From 18ba3147166a0262f9ac8079b799c2b0e9be0be7 Mon Sep 17 00:00:00 2001 +From d4bb48eaa6e4e3ec73de8bd558c7cb8359569ae3 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 31 Dec 2016 14:15:50 +0000 -Subject: [PATCH 111/195] arm64: Add CONFIG_ARCH_BCM2835 +Subject: [PATCH 111/218] arm64: Add CONFIG_ARCH_BCM2835 --- arch/arm64/configs/bcmrpi3_defconfig | 1 + @@ -124333,10 +124333,10 @@ index d7406f5a4620151044b8f716b4d10bb818648e06..53da5c7a33e5898a66e549fb0c39fe3d CONFIG_BCM2708_VCHIQ=n +CONFIG_ARCH_BCM2835=y -From 399bbbda9c86b465662ab8947d6e5cae85fbefb3 Mon Sep 17 00:00:00 2001 +From 1386cfc60c00bc2b60c1f74843bfe028b605f92c Mon Sep 17 00:00:00 2001 From: Alex Tucker Date: Tue, 13 Dec 2016 19:50:18 +0000 -Subject: [PATCH 112/195] Add support for Silicon Labs Si7013/20/21 +Subject: [PATCH 112/218] Add support for Silicon Labs Si7013/20/21 humidity/temperature sensor. --- @@ -124411,10 +124411,10 @@ index f6d134c095af2398fc55ae7d2b0e86456c30627c..31bda8da4cb6a56bfe493a81b9189009 }; }; -From a161376aa66655e0f84ed571c245ee28618dff74 Mon Sep 17 00:00:00 2001 +From d124669153b18e6282437fa4d1a2730c55c6c46a Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 3 Jan 2017 21:27:46 +0000 -Subject: [PATCH 113/195] Document the si7020 option +Subject: [PATCH 113/218] Document the si7020 option --- arch/arm/boot/dts/overlays/README | 3 +++ @@ -124435,10 +124435,10 @@ index 81d991803be335e5a1bc3bb0a8c7a2c9f5c392bd..e8fa4ccb44c34a20485c4e6155467af9 Name: i2c0-bcm2708 Info: Enable the i2c_bcm2708 driver for the i2c0 bus. Not all pin combinations -From ba601d323d66f07d5633b6e2ac172f955c73a9d3 Mon Sep 17 00:00:00 2001 +From 248e068023e8046d04d3108a20d96244abd555c2 Mon Sep 17 00:00:00 2001 From: Giedrius Trainavicius Date: Thu, 5 Jan 2017 02:38:16 +0200 -Subject: [PATCH 114/195] pisound improvements: +Subject: [PATCH 114/218] pisound improvements: * Added a writable sysfs object to enable scripts / user space software to blink MIDI activity LEDs for variable duration. @@ -124732,10 +124732,10 @@ index 4b8545487d06e4ea70073a5d063fb2310b3b94d0..ba70734b89e61a11201657406223f0b3 }; -From a7c9cb11108b471f0e8b8968c25a98d2648f8481 Mon Sep 17 00:00:00 2001 +From ec0a70fef448bca0c206850ec27ed5b5c938d94c Mon Sep 17 00:00:00 2001 From: Aaron Shaw Date: Tue, 10 Jan 2017 16:05:41 +0000 -Subject: [PATCH 115/195] Add driver_name property +Subject: [PATCH 115/218] Add driver_name property Add driver name property for use with 5.1 passthrough audio in LibreElec and other Kodi based OSs --- @@ -124755,10 +124755,10 @@ index 8fd50dbe681508a2cfe8fdde1c9fedbe9a507fa7..05a224ec712d06b8b7587ab6b8bb562d .dai_link = snd_rpi_justboom_dac_dai, .num_links = ARRAY_SIZE(snd_rpi_justboom_dac_dai), -From f279ff78af42028bfa11c3cf54db5b5b2e6b643e Mon Sep 17 00:00:00 2001 +From 0f65d151948e178a58561c6af317d6696896cbe1 Mon Sep 17 00:00:00 2001 From: Aaron Shaw Date: Tue, 10 Jan 2017 16:11:04 +0000 -Subject: [PATCH 116/195] Add driver_name paramater +Subject: [PATCH 116/218] Add driver_name paramater Add driver_name parameter for use with 5.1 passthrough audio in LibreElec and other Kodi OSs --- @@ -124778,10 +124778,10 @@ index 91acb666380faa3c0deb2230f8a0f8bbec59417b..abfdc5c4dd5811e6847bddda4921abe3 .dai_link = snd_rpi_justboom_digi_dai, .num_links = ARRAY_SIZE(snd_rpi_justboom_digi_dai), -From 702cad8fa0743fcddf9f24679595f2dbb0836db2 Mon Sep 17 00:00:00 2001 +From 1dedf795357bed02eed703c14a34bd830d66bc34 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 11 Jan 2017 13:01:21 +0000 -Subject: [PATCH 117/195] BCM270X_DT: Add pi3-disable-wifi overlay +Subject: [PATCH 117/218] BCM270X_DT: Add pi3-disable-wifi overlay pi3-disable-wifi is a minimal overlay to disable the onboard WiFi. @@ -124842,10 +124842,10 @@ index 0000000000000000000000000000000000000000..017199554bf2f4e381efcc7bb71e750c + }; +}; -From 71b3bd8f27a2d216056c42fb3a2e4bae83214913 Mon Sep 17 00:00:00 2001 +From 31a305729808ac1107b0118320c2a114cd749782 Mon Sep 17 00:00:00 2001 From: Electron752 Date: Thu, 12 Jan 2017 07:07:08 -0800 -Subject: [PATCH 118/195] ARM64: Make it work again on 4.9 (#1790) +Subject: [PATCH 118/218] ARM64: Make it work again on 4.9 (#1790) * Invoke the dtc compiler with the same options used in arm mode. * ARM64 now uses the bcm2835 platform just like ARM32. @@ -125250,10 +125250,10 @@ index 53da5c7a33e5898a66e549fb0c39fe3da555ca87..c7e891d72969a388d9b135a36dbfc9c9 -CONFIG_BCM2708_VCHIQ=n -CONFIG_ARCH_BCM2835=y -From 22a9a07af1c1645942a73264572c1d78790a3ca1 Mon Sep 17 00:00:00 2001 +From 88dff1f7b3fec7d118fd1f36f0ffa3514b8a20db Mon Sep 17 00:00:00 2001 From: Electron752 Date: Sat, 14 Jan 2017 02:54:26 -0800 -Subject: [PATCH 119/195] ARM64: Enable Kernel Address Space Randomization +Subject: [PATCH 119/218] ARM64: Enable Kernel Address Space Randomization (#1792) Randomization allows the mapping between virtual addresses and physical @@ -125285,10 +125285,10 @@ index c7e891d72969a388d9b135a36dbfc9c9cb609bf8..974d8889c0cf695eb88b57bbef11bc5a CONFIG_BINFMT_MISC=y CONFIG_COMPAT=y -From 0bfc172d0141c9ee1b52e26b804d038c307abf48 Mon Sep 17 00:00:00 2001 +From b88294adf9f3dfbf4faecbdbd20aaf87aa755bfb Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Sun, 15 Jan 2017 07:31:59 -0800 -Subject: [PATCH 120/195] ARM64: Enable RTL8187/RTL8192CU wifi in build config +Subject: [PATCH 120/218] ARM64: Enable RTL8187/RTL8192CU wifi in build config These drivers build now, so they can be enabled back in the build configuration just like they are for @@ -125313,10 +125313,10 @@ index 974d8889c0cf695eb88b57bbef11bc5aa556b635..4670a490dfb1e582ec24a3b39a3cb9b2 CONFIG_ZD1211RW=m CONFIG_MAC80211_HWSIM=m -From e4a98369f273ef0d908a3c401c58250516743fe4 Mon Sep 17 00:00:00 2001 +From eda69e6370e8a1311cfdcc9a3523a2e3709e7739 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 16 Jan 2017 14:53:12 +0000 -Subject: [PATCH 121/195] BCM270X_DT: Add spi0-cs overlay +Subject: [PATCH 121/218] BCM270X_DT: Add spi0-cs overlay The spi0-cs overlay allows the software chip selectts to be modified using the cs0_pin and cs1_pin parameters. @@ -125404,10 +125404,10 @@ index 0000000000000000000000000000000000000000..7f79029d043c04d7496c7c3480450c69 + }; +}; -From 032f49b76a74e8a3e008500b57b4110b76074367 Mon Sep 17 00:00:00 2001 +From 6aaafe29b7b5a592b8a8f0254fe57987ce880b27 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 1 Jul 2016 22:09:24 +0100 -Subject: [PATCH 122/195] spi-bcm2835: Disable forced software CS +Subject: [PATCH 122/218] spi-bcm2835: Disable forced software CS Select software CS in bcm2708_common.dtsi, and disable the automatic conversion in the driver to allow hardware CS to be re-enabled with an @@ -125433,10 +125433,10 @@ index 74dd21b7373c7564ede01d84a4f63b93a6d52fa7..51cdefbf5eb265f49bd05e0aa91dfbee i2c0: i2c@7e205000 { -From 2c6ee3579798e711652f11090564c85b8dd0a61f Mon Sep 17 00:00:00 2001 +From b67d9f2ea6c8d6bf9a8ad87a57e12a4e161bf3e2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 16 Jan 2017 16:33:54 +0000 -Subject: [PATCH 123/195] config: Add CONFIG_TCP_CONG_BBR See: +Subject: [PATCH 123/218] config: Add CONFIG_TCP_CONG_BBR See: https://github.com/raspberrypi/linux/issues/1784 --- @@ -125471,10 +125471,10 @@ index 8acee9f31202ec14f2933d92dd70831cda8d7b51..219f67051a2542329449b0099165ae28 CONFIG_IPV6_ROUTER_PREF=y CONFIG_INET6_AH=m -From f1e2e9949f9c263d2b71f5a22a68dc82f4f75e0c Mon Sep 17 00:00:00 2001 +From 1a44615824d1aaba38e052ffea812cf7930d90fa Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 17 Jan 2017 11:34:58 +0000 -Subject: [PATCH 124/195] BCM270X_DT: Enable UART0 on CM3 +Subject: [PATCH 124/218] BCM270X_DT: Enable UART0 on CM3 Signed-off-by: Phil Elwell --- @@ -125497,10 +125497,10 @@ index 41874c25a84226c0e4af92ec4059e0a571fe6123..3ba6e621856c288ae4694f758604619f sdhost_pins: sdhost_pins { brcm,pins = <48 49 50 51 52 53>; -From 2bed88ae6fc96caf74d309f8eb2fd0cb898a0508 Mon Sep 17 00:00:00 2001 +From 18d58c55cf842151c11e5ca7cb255b4e971e6666 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 17 Jan 2017 14:39:39 +0000 -Subject: [PATCH 125/195] config: Add CONFIG_MD_M25P80 and CONFIG_MD_SPI_NOR +Subject: [PATCH 125/218] config: Add CONFIG_MD_M25P80 and CONFIG_MD_SPI_NOR See: https://github.com/raspberrypi/linux/issues/1781 @@ -125539,10 +125539,10 @@ index 219f67051a2542329449b0099165ae2885022bec..c4898d63d74718097ec3a1d1fe60b230 CONFIG_OF_CONFIGFS=y CONFIG_ZRAM=m -From 888b72560efaae991babc6bcb8247d99a8843e9f Mon Sep 17 00:00:00 2001 +From 5cb56ddf89dd8d731900dee3433084578f253699 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Sat, 14 Jan 2017 21:33:51 -0800 -Subject: [PATCH 126/195] ARM64/DWC_OTG: Port dwc_otg driver to ARM64 +Subject: [PATCH 126/218] ARM64/DWC_OTG: Port dwc_otg driver to ARM64 In ARM64, the FIQ mechanism used by this driver is not current implemented. As a workaround, reqular IRQ is used instead @@ -125885,10 +125885,10 @@ index 6b2c7d0c93f36a63863ff4b0ecc1f3eab77e058b..d7b700ff17821ad1944e36721fe6b2db /** The OS page size */ #define DWC_OS_PAGE_SIZE PAGE_SIZE -From 075caeb57400b65595ca25348c032c46abba0935 Mon Sep 17 00:00:00 2001 +From fe4e88fb41f8582463cc014387434ff7b97e1174 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Sat, 14 Jan 2017 21:43:57 -0800 -Subject: [PATCH 127/195] ARM64: Round-Robin dispatch IRQs between CPUs. +Subject: [PATCH 127/218] ARM64: Round-Robin dispatch IRQs between CPUs. IRQ-CPU mapping is round robined on ARM64 to increase concurrency and allow multiple interrupts to be serviced @@ -125962,10 +125962,10 @@ index 93e3f7660c4230c9f1dd3b195958cb498949b0ca..486bcbfb32305ee417f6b3be7e91a3ff .name = "bcm2836-gpu", .irq_mask = bcm2836_arm_irqchip_mask_gpu_irq, -From 898c8c584d1d9041e6b5b55f0d8c39a2e8732586 Mon Sep 17 00:00:00 2001 +From 025f93db9d7e9651c81bd30415a5d6658a1fd094 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Sat, 14 Jan 2017 21:45:03 -0800 -Subject: [PATCH 128/195] ARM64: Enable DWC_OTG Driver In ARM64 Build +Subject: [PATCH 128/218] ARM64: Enable DWC_OTG Driver In ARM64 Build Config(bcmrpi3_defconfig) Signed-off-by: Michael Zoran @@ -125986,10 +125986,10 @@ index 4670a490dfb1e582ec24a3b39a3cb9b2488b1864..8c4392344eb4495689c220d5d176ee8c CONFIG_USB_STORAGE=y CONFIG_USB_STORAGE_REALTEK=m -From b59f70d582069ddda3d06663492f323a778afc54 Mon Sep 17 00:00:00 2001 +From c4f0a0230b8c4a6c8334803a4f4a647fa12e13c5 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Sat, 14 Jan 2017 21:46:04 -0800 -Subject: [PATCH 129/195] ARM64: Use dwc_otg driver by default for USB. +Subject: [PATCH 129/218] ARM64: Use dwc_otg driver by default for USB. If it breaks on anybody, they can use the standard device tree overlays to switch back to the dwc2 driver. @@ -126015,10 +126015,10 @@ index f6def5d7e5d622cf09e8f87332c7374fe28da08b..3e134a1208610b90e2d0fc22f03c6e9f -}; -#endif -From 0e13f224e97732c81a0db37befa57fd32a2de356 Mon Sep 17 00:00:00 2001 +From a51fb6ad83f1b928156479c1a137374c3a7abad8 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 23 Jan 2017 17:36:50 +0000 -Subject: [PATCH 130/195] BCM270X_DT: Add reference to audio_pins to CM dtb +Subject: [PATCH 130/218] BCM270X_DT: Add reference to audio_pins to CM dtb The CM1 dtb contains an empty audio_pins node, but no reference to it. Adding the usual pinctrl reference from the audio node enables the @@ -126046,10 +126046,10 @@ index eb8662f0d222b4c0a9a2bcb8bccb13e86a0006b3..10be69972bd1440f574e35d515f3d6a0 hpd-gpios = <&gpio 46 GPIO_ACTIVE_HIGH>; }; -From add004c65e337c5f2eb1ab1b427bcf7b5a0ca5ee Mon Sep 17 00:00:00 2001 +From dafff07055e0ecb9ddd1c774861f81ac6ad2d5f3 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 25 Jan 2017 11:30:38 +0000 -Subject: [PATCH 131/195] config: Add additional network scheduling modules +Subject: [PATCH 131/218] config: Add additional network scheduling modules --- arch/arm/configs/bcm2709_defconfig | 4 ++++ @@ -126101,10 +126101,10 @@ index c4898d63d74718097ec3a1d1fe60b2307a6a3140..b448eaa866c200f48351819072c7fefc CONFIG_NET_SCH_PLUG=m CONFIG_NET_CLS_BASIC=m -From 14ed05f6ff4efff01f8beaf104b335e8d6196e01 Mon Sep 17 00:00:00 2001 +From eb0d950c048777a39a3918ec15a2136277711032 Mon Sep 17 00:00:00 2001 From: chris johnson Date: Sun, 22 Jan 2017 03:27:31 +0000 -Subject: [PATCH 132/195] ASoC: A simple-card overlay for ADAU7002 +Subject: [PATCH 132/218] ASoC: A simple-card overlay for ADAU7002 Usage: `dtoverlay=adau7002-simple` --- @@ -126202,10 +126202,10 @@ index 0000000000000000000000000000000000000000..e67e6625d7967abc92cf00cb604d4c12 + }; +}; -From b3c252f18abe76a6c2baf3d96ae4f564ee9e63fd Mon Sep 17 00:00:00 2001 +From e820b06e082ddbda6202a2cb5ec443282a9ebed3 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 25 Jan 2017 21:17:23 +0000 -Subject: [PATCH 133/195] config: Add SND_SOC_ADAU7002 codec module +Subject: [PATCH 133/218] config: Add SND_SOC_ADAU7002 codec module As there is now an overlay requiring it, build the codec module. @@ -126240,10 +126240,10 @@ index b448eaa866c200f48351819072c7fefcd8ad8132..5105a592c9bcfee1cc6a8b50fd1c6c32 CONFIG_SND_SOC_WM8804_I2C=m CONFIG_SND_SIMPLE_CARD=m -From cc1e75399cd79c8b5f04553d7c8b82b096e2cb6d Mon Sep 17 00:00:00 2001 +From f42ef958d534020a993b31dfe9225a8b2163b989 Mon Sep 17 00:00:00 2001 From: Scott Ellis Date: Fri, 27 Jan 2017 06:42:42 -0500 -Subject: [PATCH 134/195] Add overlay for mcp3008 adc (#1818) +Subject: [PATCH 134/218] Add overlay for mcp3008 adc (#1818) Some example usage: @@ -126529,10 +126529,10 @@ index 0000000000000000000000000000000000000000..06bf4264959c380d8a9f90f74e780397 + }; +}; -From 4f1552628778bb536c31f9995cfd850b4a50b755 Mon Sep 17 00:00:00 2001 +From e2e5b2ef3ce3b81858ed6fc081b3ed223100ad93 Mon Sep 17 00:00:00 2001 From: ED6E0F17 Date: Fri, 3 Feb 2017 14:52:42 +0000 -Subject: [PATCH 135/195] usb: dwc2: Avoid suspending if we're in gadget mode +Subject: [PATCH 135/218] usb: dwc2: Avoid suspending if we're in gadget mode (#1825) I've found when booting HiKey with the usb gadget cable attached @@ -126584,10 +126584,10 @@ index df5a065780054f21841ca9f08b8ab118922c530b..619ccfe1eafc4643b16970f8a1129ff9 goto skip_power_saving; -From fd8dbe634fba3e38ea71b092d17c566de422861a Mon Sep 17 00:00:00 2001 +From 908307c07112826b9ece740aa55a2d766212f7c0 Mon Sep 17 00:00:00 2001 From: JamesH65 Date: Mon, 6 Feb 2017 15:24:47 +0000 -Subject: [PATCH 136/195] gpio_mem: Remove unnecessary dev_info output (#1830) +Subject: [PATCH 136/218] gpio_mem: Remove unnecessary dev_info output (#1830) The open function was spamming syslog every time called, so have removed call completely. @@ -126609,10 +126609,10 @@ index 911f5b7393ed48ceed8751f06967ae6463453f9c..f5e7f1ba8fb6f18dee77fad06a17480c dev_err(inst->dev, "Unknown minor device: %d", dev); ret = -ENXIO; -From 3d27ab746b042751f2cbe5f20d1769c8b7670bf2 Mon Sep 17 00:00:00 2001 +From 96dd997613adaefb3cf1846fc741aeeb742e930e Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 22 Jan 2017 12:49:36 +0100 -Subject: [PATCH 137/195] config: Enable regulator support +Subject: [PATCH 137/218] config: Enable regulator support Signed-off-by: Matthias Reichl --- @@ -126647,10 +126647,10 @@ index 5105a592c9bcfee1cc6a8b50fd1c6c32f1381158..74bc0d81bcb4d7f6676368926cdcc10e CONFIG_MEDIA_CAMERA_SUPPORT=y CONFIG_MEDIA_ANALOG_TV_SUPPORT=y -From 8ce37c230a68d716ce8ef52b3a8046b3581db2ea Mon Sep 17 00:00:00 2001 +From 0d6de3a0127a8b76e055808eff2dbb709a0b4c65 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 22 Jan 2017 12:49:36 +0100 -Subject: [PATCH 138/195] BCM270x DT: expose 3.3V and 5V system rails +Subject: [PATCH 138/218] BCM270x DT: expose 3.3V and 5V system rails Signed-off-by: Matthias Reichl --- @@ -126683,10 +126683,10 @@ index a46cb4a8b1419edd95e0e07c18b0f373222dc2bf..36d853715f2379e1952ce3d3be58dd67 + }; }; -From 88b83646f91255d69f5b28dca315e203fd166d01 Mon Sep 17 00:00:00 2001 +From 745cdc4867eab7075d4b1cc819aaee9bae59f9cf Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 22 Jan 2017 12:49:36 +0100 -Subject: [PATCH 139/195] BCM270x DT: Consolidate audio card overlays +Subject: [PATCH 139/218] BCM270x DT: Consolidate audio card overlays Reference 3.3V / 5V system rails instead of instantiating local regulators. @@ -126981,10 +126981,10 @@ index 16b1247bfa618ff85936ddf78c3aea58075eaa67..f8d48233e28c7c18509b4a95692f6aff __overlay__ { compatible = "rra,digidac1-soundcard"; -From 7a921dc6dec1cb87b9d80f82bf0257dc1f832db2 Mon Sep 17 00:00:00 2001 +From cb155e93545951acbcaed6eec03e602dbbeb833e Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 22 Jan 2017 12:49:37 +0100 -Subject: [PATCH 140/195] ASoC: Add driver for Cirrus Logic Audio Card +Subject: [PATCH 140/218] ASoC: Add driver for Cirrus Logic Audio Card Note: due to problems with deferred probing of regulators the following softdep should be added to a modprobe.d file @@ -128234,10 +128234,10 @@ index 0000000000000000000000000000000000000000..ac8651ddff7bd3701dffe22c7fb88352 +MODULE_DESCRIPTION("ASoC driver for Cirrus Logic Audio Card"); +MODULE_LICENSE("GPL"); -From b138db8e20b22b49eae437f5e09f9dbdd426d361 Mon Sep 17 00:00:00 2001 +From d5feddd3f0d334a54f6c644d3a31040b6aa23952 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 22 Jan 2017 12:49:37 +0100 -Subject: [PATCH 141/195] config: enable Cirrus Logic Audio Card +Subject: [PATCH 141/218] config: enable Cirrus Logic Audio Card Signed-off-by: Matthias Reichl --- @@ -128286,10 +128286,10 @@ index 74bc0d81bcb4d7f6676368926cdcc10e581fbcae..f0b87d15e959d88eb26e5a11244365da CONFIG_SND_BCM2708_SOC_RPI_PROTO=m CONFIG_SND_BCM2708_SOC_JUSTBOOM_DAC=m -From 8b4fcafdcd5751d4de17efc73613753e81a2356b Mon Sep 17 00:00:00 2001 +From 049a844e099f1f4521b20123289ffe7ab6e4a08a Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 9 Feb 2017 14:33:30 +0000 -Subject: [PATCH 142/195] irq-bcm2836: Avoid "Invalid trigger warning" +Subject: [PATCH 142/218] irq-bcm2836: Avoid "Invalid trigger warning" Initialise the level for each IRQ to avoid a warning from the arm arch timer code. @@ -128313,10 +128313,10 @@ index 486bcbfb32305ee417f6b3be7e91a3ff069a586c..e10597c1a1e51e5e27aa574b6a26d871 static void -From ac97c5241d99a5959c0006f8a93ec56475314fd6 Mon Sep 17 00:00:00 2001 +From 2ed2f273135dc7e29b6d08f6c5f45feacacaeaa7 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 9 Feb 2017 14:36:44 +0000 -Subject: [PATCH 143/195] sound: Demote deferral errors to INFO level +Subject: [PATCH 143/218] sound: Demote deferral errors to INFO level At present there is no mechanism to specify driver load order, which can lead to deferrals and repeated retries until successful. @@ -128351,10 +128351,10 @@ index c0bbcd9032613a78aef551ce697cabc792880bad..a2504d8c83d74d7227e65be142a26cc9 goto _err_defer; } -From 857babba12f76cc0bd003b97e205ca20dc757b3c Mon Sep 17 00:00:00 2001 +From 81a8b36c123ec7d16218e53151fb74902a09ad81 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 9 Feb 2017 14:40:33 +0000 -Subject: [PATCH 144/195] sound: Suppress error message about deferrals +Subject: [PATCH 144/218] sound: Suppress error message about deferrals Since driver load deferrals are expected and will already have resulted in a kernel message, suppress an essentially @@ -128601,10 +128601,10 @@ index 9db678e885efd63d84d60a098a84ed6772b19a2d..fadbfade100228aaafabb0d3bdf35c01 return ret; } -From d64e4501e476bed45f42a626fb77065e0e617275 Mon Sep 17 00:00:00 2001 +From dbdf3251a32c1d9a40b4633d6eb11ab1fd3e83b0 Mon Sep 17 00:00:00 2001 From: Claggy3 Date: Sat, 11 Feb 2017 14:00:30 +0000 -Subject: [PATCH 145/195] Update vfpmodule.c +Subject: [PATCH 145/218] Update vfpmodule.c Christopher Alexander Tobias Schulze - May 2, 2015, 11:57 a.m. This patch fixes a problem with VFP state save and restore related @@ -128741,10 +128741,10 @@ index da0b33deba6d3c2906eef271f253ab7a30a92680..c6f1d6da808cda78a58f184e19e83522 /* * Save the userland NEON/VFP state. Under UP, -From 68f6f36131885058c316ba8d903024243f6b3f4c Mon Sep 17 00:00:00 2001 +From d10a95c9287f613e1bf8e37acd5a1d32a2dcfc07 Mon Sep 17 00:00:00 2001 From: Martin Cerveny Date: Mon, 13 Feb 2017 17:23:47 +0100 -Subject: [PATCH 146/195] dwc_otg: fix summarize urb->actual_length for +Subject: [PATCH 146/218] dwc_otg: fix summarize urb->actual_length for isochronous transfers Kernel does not copy input data of ISO transfers to userspace @@ -128772,40 +128772,10 @@ index 162a656501988e56c9d780b7793d365fde09f801..992269d61ecf48126379a38e528f7190 dwc_otg_hcd_urb_get_iso_desc_status(dwc_otg_urb, i); } -From 5c11c2cd056fdd8cb62112a83f105d9eab2df488 Mon Sep 17 00:00:00 2001 -From: Boris Brezillon -Date: Tue, 22 Nov 2016 12:45:28 -0800 -Subject: [PATCH 147/195] clk: bcm2835: Fix ->fixed_divider of pllh_aux - -There is no fixed divider on pllh_aux. - -Signed-off-by: Boris Brezillon -Signed-off-by: Eric Anholt -Reviewed-by: Eric Anholt -Signed-off-by: Stephen Boyd -(cherry picked from commit f2a46926aba1f0c33944901d2420a6a887455ddc) ---- - drivers/clk/bcm/clk-bcm2835.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c -index 21e2a538ff0d0ab4e63adff9b93705f3d45fa15d..a99ccf9f056d3a3e7c482339e08483f3701ebc04 100644 ---- a/drivers/clk/bcm/clk-bcm2835.c -+++ b/drivers/clk/bcm/clk-bcm2835.c -@@ -1607,7 +1607,7 @@ static const struct bcm2835_clk_desc clk_desc_array[] = { - .a2w_reg = A2W_PLLH_AUX, - .load_mask = CM_PLLH_LOADAUX, - .hold_mask = 0, -- .fixed_divider = 10), -+ .fixed_divider = 1), - [BCM2835_PLLH_PIX] = REGISTER_PLL_DIV( - .name = "pllh_pix", - .source_pll = "pllh", - -From a0e60768d469d045ae5a32bc3001c6aa30633048 Mon Sep 17 00:00:00 2001 +From 8aac032b8b5fe007500cb0d578d1f7d46fe916a1 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Thu, 1 Dec 2016 22:00:19 +0100 -Subject: [PATCH 148/195] clk: bcm: Support rate change propagation on bcm2835 +Subject: [PATCH 147/218] clk: bcm: Support rate change propagation on bcm2835 clocks Some peripheral clocks, like the VEC (Video EnCoder) clock need to be set @@ -128930,10 +128900,10 @@ index a99ccf9f056d3a3e7c482339e08483f3701ebc04..dafaa6b22724ab41dac1327cfa81de09 init.ops = &bcm2835_vpu_clock_clk_ops; } else { -From 148fe8b1be92f88936e222b90274d7b8244f20c5 Mon Sep 17 00:00:00 2001 +From 138df49cf6713d64c46ca979a33a96d822658f04 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Thu, 1 Dec 2016 22:00:20 +0100 -Subject: [PATCH 149/195] clk: bcm: Allow rate change propagation to PLLH_AUX +Subject: [PATCH 148/218] clk: bcm: Allow rate change propagation to PLLH_AUX on VEC clock The VEC clock requires needs to be set at exactly 108MHz. Allow rate @@ -128968,10 +128938,10 @@ index dafaa6b22724ab41dac1327cfa81de09908a4dfd..0453d7c6a63923370e4191db2c4d083b /* dsi clocks */ [BCM2835_CLOCK_DSI0E] = REGISTER_PER_CLK( -From a84418aae025fc009e72bc20add783d6a5ba7ead Mon Sep 17 00:00:00 2001 +From cc1c5da4b0a00421bf287b06054eedf882258441 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Mon, 12 Dec 2016 09:00:53 +0100 -Subject: [PATCH 150/195] clk: bcm: Fix 'maybe-uninitialized' warning in +Subject: [PATCH 149/218] clk: bcm: Fix 'maybe-uninitialized' warning in bcm2835_clock_choose_div_and_prate() best_rate is reported as potentially uninitialized by gcc. @@ -129000,10 +128970,10 @@ index 0453d7c6a63923370e4191db2c4d083b893b3b47..9d895726ebb24bc78a2014870dbdd7c7 struct clk_hw *parent; -From 9f1f17f2e9b2c6c6b568dc663eff127b6a8d1718 Mon Sep 17 00:00:00 2001 +From 4f0cdf8310486a36db36bffe964122c2875790ff Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 18 Jan 2017 07:31:55 +1100 -Subject: [PATCH 151/195] clk: bcm2835: Don't rate change PLLs on behalf of DSI +Subject: [PATCH 150/218] clk: bcm2835: Don't rate change PLLs on behalf of DSI PLL dividers. Our core PLLs are intended to be configured once and left alone. With @@ -129175,10 +129145,10 @@ index 9d895726ebb24bc78a2014870dbdd7c779cd1cdf..b58cff2756581ba7e0be8a818cdbdf72 /* the clocks */ -From b68b2350e3e14e8963f44866a85f6e2d9ce0d422 Mon Sep 17 00:00:00 2001 +From d50780c95869187d0f04ef1b65cb2696daaad878 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 18 Jan 2017 07:31:56 +1100 -Subject: [PATCH 152/195] clk: bcm2835: Register the DSI0/DSI1 pixel clocks. +Subject: [PATCH 151/218] clk: bcm2835: Register the DSI0/DSI1 pixel clocks. The DSI pixel clocks are muxed from clocks generated in the analog phy by the DSI driver. In order to set them as parents, we need to do the @@ -129420,10 +129390,10 @@ index 360e00cefd35679b49890234b5c369fb52b89e20..a0c812b0fa391d149b4f546db39bdc4b +#define BCM2835_CLOCK_DSI0P 49 +#define BCM2835_CLOCK_DSI1P 50 -From 2b912be3c58959d40624f3bee571126e6b268f46 Mon Sep 17 00:00:00 2001 +From 4dbb3ef89cc4595f1c4a9f3939bb70b81bdb0571 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 18 Jan 2017 07:31:57 +1100 -Subject: [PATCH 153/195] clk: bcm2835: Add leaf clock measurement support, +Subject: [PATCH 152/218] clk: bcm2835: Add leaf clock measurement support, disabled by default This proved incredibly useful during debugging of the DSI driver, to @@ -129769,10 +129739,10 @@ index b2c277b378ee799a4f8e05ad076d1253e85cb392..136e5d28f9eaeaa10d45382a0f31da9f /* the gates */ -From 9b5c73bc0b05620d7a1c8536a1350ecdc020b23b Mon Sep 17 00:00:00 2001 +From 0a450af8446c6d0ae16a1c0f1669afbd780c6080 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 26 Apr 2016 13:46:13 -0700 -Subject: [PATCH 154/195] drm/panel: Add support for the Raspberry Pi 7" +Subject: [PATCH 153/218] drm/panel: Add support for the Raspberry Pi 7" Touchscreen. This driver communicates with the Atmel microcontroller for sequencing @@ -130353,10 +130323,10 @@ index 0000000000000000000000000000000000000000..1a536fe4d040f5fafe324baee110a622 +MODULE_DESCRIPTION("Raspberry Pi 7-inch touchscreen driver"); +MODULE_LICENSE("GPL v2"); -From 86221ad5d2b62257d847f3b1be58612f0e56612d Mon Sep 17 00:00:00 2001 +From 68ad470a6a0fa45c2fe9813c6ccf7d1ff8c54621 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 2 Jun 2016 12:29:45 -0700 -Subject: [PATCH 155/195] BCM270X: Add the DSI panel to the defconfig. +Subject: [PATCH 154/218] BCM270X: Add the DSI panel to the defconfig. Signed-off-by: Eric Anholt --- @@ -130405,10 +130375,10 @@ index 8c4392344eb4495689c220d5d176ee8c189079fd..301611d2283f5f8800339271cea59aed CONFIG_DRM_VC4=m CONFIG_FB=y -From 9814e81fe220bb35761c6b48600e17bad7273eb9 Mon Sep 17 00:00:00 2001 +From 8c49f029d59d7425bc4c39ad217ef77210942119 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 13 Dec 2016 15:15:10 -0800 -Subject: [PATCH 156/195] ARM: bcm2835: dt: Add the DSI module nodes and +Subject: [PATCH 155/218] ARM: bcm2835: dt: Add the DSI module nodes and clocks. The modules stay disabled by default, and if you want to enable DSI @@ -130512,10 +130482,10 @@ index 51cdefbf5eb265f49bd05e0aa91dfbeee3fbfdcc..41776b97b4b6b1c053d07fd357fac4ba compatible = "brcm,bcm2835-i2c"; reg = <0x7e804000 0x1000>; -From 3c42b1205a9242f8eb95a9c5516952bcb4e37282 Mon Sep 17 00:00:00 2001 +From 5fef33687c275637fcfb98547ce79aa9af7271f2 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 2 Jun 2016 15:09:35 -0700 -Subject: [PATCH 157/195] BCM270X: Enable the DSI panel node in the VC4 +Subject: [PATCH 156/218] BCM270X: Enable the DSI panel node in the VC4 overlay. Signed-off-by: Eric Anholt @@ -130666,81 +130636,10 @@ index 4f1cc20f90dc6780f74e08ebee00e5a1a6062c85..f25cd9a3936861920b0d518ff2d773ee cma-256 = <0>,"+0-1-2-3-4"; cma-192 = <0>,"-0+1-2-3-4"; -From ce35752cbd46113a1eb785ed3b48020b141d90ff Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Thu, 20 Oct 2016 16:48:12 -0700 -Subject: [PATCH 158/195] drm/vc4: Fix termination of the initial scan for - branch targets. - -The loop is scanning until the original max_ip (size of the BO), but -we want to not examine any code after the PROG_END's delay slots. -There was a block trying to do that, except that we had some early -continue statements if the signal wasn't a PROG_END or a BRANCH. - -The failure mode would be that a valid shader is rejected because some -undefined memory after the PROG_END slots is parsed as a branch and -the rest of its setup is illegal. I haven't seen this in the wild, -but valgrind was complaining when about this up in the userland -simulator mode. - -Signed-off-by: Eric Anholt -(cherry picked from commit 457e67a728696c4f8e6423c64e93def50530db9a) ---- - drivers/gpu/drm/vc4/vc4_validate_shaders.c | 19 ++++++++----------- - 1 file changed, 8 insertions(+), 11 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_validate_shaders.c b/drivers/gpu/drm/vc4/vc4_validate_shaders.c -index 2543cf5b8b51869d51b72a5db5017dded38761be..917321ce832ffda9d3e8ca20d987437eea9a1765 100644 ---- a/drivers/gpu/drm/vc4/vc4_validate_shaders.c -+++ b/drivers/gpu/drm/vc4/vc4_validate_shaders.c -@@ -608,9 +608,7 @@ static bool - vc4_validate_branches(struct vc4_shader_validation_state *validation_state) - { - uint32_t max_branch_target = 0; -- bool found_shader_end = false; - int ip; -- int shader_end_ip = 0; - int last_branch = -2; - - for (ip = 0; ip < validation_state->max_ip; ip++) { -@@ -621,8 +619,13 @@ vc4_validate_branches(struct vc4_shader_validation_state *validation_state) - uint32_t branch_target_ip; - - if (sig == QPU_SIG_PROG_END) { -- shader_end_ip = ip; -- found_shader_end = true; -+ /* There are two delay slots after program end is -+ * signaled that are still executed, then we're -+ * finished. validation_state->max_ip is the -+ * instruction after the last valid instruction in the -+ * program. -+ */ -+ validation_state->max_ip = ip + 3; - continue; - } - -@@ -676,15 +679,9 @@ vc4_validate_branches(struct vc4_shader_validation_state *validation_state) - } - set_bit(after_delay_ip, validation_state->branch_targets); - max_branch_target = max(max_branch_target, after_delay_ip); -- -- /* There are two delay slots after program end is signaled -- * that are still executed, then we're finished. -- */ -- if (found_shader_end && ip == shader_end_ip + 2) -- break; - } - -- if (max_branch_target > shader_end_ip) { -+ if (max_branch_target > validation_state->max_ip - 3) { - DRM_ERROR("Branch landed after QPU_SIG_PROG_END"); - return false; - } - -From c8e9761cf8c76c3a502a9757396b8df3faf62fa0 Mon Sep 17 00:00:00 2001 +From 71d626cb9216d9f47efe9c4750489cd49747c76f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 3 Nov 2016 18:53:10 -0700 -Subject: [PATCH 159/195] drm/vc4: Add support for rendering with ETC1 +Subject: [PATCH 157/218] drm/vc4: Add support for rendering with ETC1 textures. The validation for it ends up being quite simple, but I hadn't got @@ -130758,11 +130657,11 @@ Signed-off-by: Eric Anholt 3 files changed, 9 insertions(+) diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c -index 6c4a4fbc86d0a30a6977b2081bca4372e693b817..157e08ab27771854ffbad101f61ce81e27001e1a 100644 +index e0b4c4d475ad72682e2119fc2983afb91ac6fb02..8302bd788be470fd61a7382b8c3ef16e26f6861d 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c -@@ -78,6 +78,7 @@ static int vc4_get_param_ioctl(struct drm_device *dev, void *data, - pm_runtime_put(&vc4->v3d->pdev->dev); +@@ -81,6 +81,7 @@ static int vc4_get_param_ioctl(struct drm_device *dev, void *data, + pm_runtime_put_autosuspend(&vc4->v3d->pdev->dev); break; case DRM_VC4_PARAM_SUPPORTS_BRANCHES: + case DRM_VC4_PARAM_SUPPORTS_ETC1: @@ -130800,95 +130699,10 @@ index ad7edc3edf7ca1d653a0bc025a5eda6692b74370..69caa21f0cb23c9439238f6239c0041b struct drm_vc4_get_param { __u32 param; -From b721f42b657eede423dacac026fdfe43fac28bf6 Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Fri, 4 Nov 2016 15:58:38 -0700 -Subject: [PATCH 160/195] drm/vc4: Use runtime autosuspend to avoid thrashing - V3D power state. - -The pm_runtime_put() we were using immediately released power on the -device, which meant that we were generally turning the device off and -on once per frame. In many profiles I've looked at, that added up to -about 1% of CPU time, but this could get worse in the case of frequent -rendering and readback (as may happen in X rendering). By keeping the -device on until we've been idle for a couple of frames, we drop the -overhead of runtime PM down to sub-.1%. - -Signed-off-by: Eric Anholt -(cherry picked from commit 3a62234680d86efa0239665ed8a0e908f1aef147) ---- - drivers/gpu/drm/vc4/vc4_drv.c | 9 ++++++--- - drivers/gpu/drm/vc4/vc4_gem.c | 6 ++++-- - drivers/gpu/drm/vc4/vc4_v3d.c | 2 ++ - 3 files changed, 12 insertions(+), 5 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c -index 157e08ab27771854ffbad101f61ce81e27001e1a..8302bd788be470fd61a7382b8c3ef16e26f6861d 100644 ---- a/drivers/gpu/drm/vc4/vc4_drv.c -+++ b/drivers/gpu/drm/vc4/vc4_drv.c -@@ -61,21 +61,24 @@ static int vc4_get_param_ioctl(struct drm_device *dev, void *data, - if (ret < 0) - return ret; - args->value = V3D_READ(V3D_IDENT0); -- pm_runtime_put(&vc4->v3d->pdev->dev); -+ pm_runtime_mark_last_busy(&vc4->v3d->pdev->dev); -+ pm_runtime_put_autosuspend(&vc4->v3d->pdev->dev); - break; - case DRM_VC4_PARAM_V3D_IDENT1: - ret = pm_runtime_get_sync(&vc4->v3d->pdev->dev); - if (ret < 0) - return ret; - args->value = V3D_READ(V3D_IDENT1); -- pm_runtime_put(&vc4->v3d->pdev->dev); -+ pm_runtime_mark_last_busy(&vc4->v3d->pdev->dev); -+ pm_runtime_put_autosuspend(&vc4->v3d->pdev->dev); - break; - case DRM_VC4_PARAM_V3D_IDENT2: - ret = pm_runtime_get_sync(&vc4->v3d->pdev->dev); - if (ret < 0) - return ret; - args->value = V3D_READ(V3D_IDENT2); -- pm_runtime_put(&vc4->v3d->pdev->dev); -+ pm_runtime_mark_last_busy(&vc4->v3d->pdev->dev); -+ pm_runtime_put_autosuspend(&vc4->v3d->pdev->dev); - break; - case DRM_VC4_PARAM_SUPPORTS_BRANCHES: - case DRM_VC4_PARAM_SUPPORTS_ETC1: -diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c -index 18e37171e9c8e2f0729ca1c582af98ccb4647e06..ab3016982466c3ca35ba479050ee107d26eb50ac 100644 ---- a/drivers/gpu/drm/vc4/vc4_gem.c -+++ b/drivers/gpu/drm/vc4/vc4_gem.c -@@ -711,8 +711,10 @@ vc4_complete_exec(struct drm_device *dev, struct vc4_exec_info *exec) - } - - mutex_lock(&vc4->power_lock); -- if (--vc4->power_refcount == 0) -- pm_runtime_put(&vc4->v3d->pdev->dev); -+ if (--vc4->power_refcount == 0) { -+ pm_runtime_mark_last_busy(&vc4->v3d->pdev->dev); -+ pm_runtime_put_autosuspend(&vc4->v3d->pdev->dev); -+ } - mutex_unlock(&vc4->power_lock); - - kfree(exec); -diff --git a/drivers/gpu/drm/vc4/vc4_v3d.c b/drivers/gpu/drm/vc4/vc4_v3d.c -index e6d3c6028341e447df293cab525713ac10d8ee5e..7cc346ad9b0baed63701d1fae8f0306aa7713129 100644 ---- a/drivers/gpu/drm/vc4/vc4_v3d.c -+++ b/drivers/gpu/drm/vc4/vc4_v3d.c -@@ -222,6 +222,8 @@ static int vc4_v3d_bind(struct device *dev, struct device *master, void *data) - return ret; - } - -+ pm_runtime_use_autosuspend(dev); -+ pm_runtime_set_autosuspend_delay(dev, 40); /* a little over 2 frames. */ - pm_runtime_enable(dev); - - return 0; - -From 3783d21d38812216cb53aecfd309e84a5ab57ec5 Mon Sep 17 00:00:00 2001 +From f4cc4a7f8d6c05d8f98c3ce5a9cde9919e2a2d6f Mon Sep 17 00:00:00 2001 From: Jonas Pfeil Date: Tue, 8 Nov 2016 00:18:39 +0100 -Subject: [PATCH 161/195] drm/vc4: Add fragment shader threading support +Subject: [PATCH 158/218] drm/vc4: Add fragment shader threading support FS threading brings performance improvements of 0-20% in glmark2. @@ -130927,10 +130741,10 @@ index 8302bd788be470fd61a7382b8c3ef16e26f6861d..3abaa0f85da194016c65f46509d4c64f break; default: diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h -index e1f6ab747f36dd412e00a1e7ea772f13c2fc32d5..e15eb37ca6191e0eae3d4947751437d2646c996d 100644 +index b9169550bf15504f1ff3d8b31a3710e9b4c42e88..6d0688056aa2c75cc6b5bf9a6c50cc62e1b398e2 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.h +++ b/drivers/gpu/drm/vc4/vc4_drv.h -@@ -384,6 +384,8 @@ struct vc4_validated_shader_info { +@@ -385,6 +385,8 @@ struct vc4_validated_shader_info { uint32_t num_uniform_addr_offsets; uint32_t *uniform_addr_offsets; @@ -131124,232 +130938,10 @@ index 69caa21f0cb23c9439238f6239c0041b178d5669..f07a090167261131076438960c1dec17 struct drm_vc4_get_param { __u32 param; -From d69d5d660a5fce80bfac187b24952247355bc46e Mon Sep 17 00:00:00 2001 -From: Derek Foreman -Date: Thu, 24 Nov 2016 12:11:55 -0600 -Subject: [PATCH 162/195] drm/vc4: Fix race between page flip completion event - and clean-up - -There was a small window where a userspace program could submit -a pageflip after receiving a pageflip completion event yet still -receive EBUSY. - -Signed-off-by: Derek Foreman -Signed-off-by: Eric Anholt -Reviewed-by: Eric Anholt -Reviewed-by: Daniel Stone -(cherry picked from commit 26fc78f6fef39b9d7a15def5e7e9826ff68303f4) ---- - drivers/gpu/drm/vc4/vc4_crtc.c | 8 ++++++++ - drivers/gpu/drm/vc4/vc4_drv.h | 1 + - drivers/gpu/drm/vc4/vc4_kms.c | 33 +++++++++++++++++++++++++-------- - 3 files changed, 34 insertions(+), 8 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c -index 13212788eef0e4b77c1e92e6bf3a56c817c50322..61d64c9c4b0cd1aafc6451b0838cb203c1374a5a 100644 ---- a/drivers/gpu/drm/vc4/vc4_crtc.c -+++ b/drivers/gpu/drm/vc4/vc4_crtc.c -@@ -682,6 +682,14 @@ void vc4_disable_vblank(struct drm_device *dev, unsigned int crtc_id) - CRTC_WRITE(PV_INTEN, 0); - } - -+/* Must be called with the event lock held */ -+bool vc4_event_pending(struct drm_crtc *crtc) -+{ -+ struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); -+ -+ return !!vc4_crtc->event; -+} -+ - static void vc4_crtc_handle_page_flip(struct vc4_crtc *vc4_crtc) - { - struct drm_crtc *crtc = &vc4_crtc->base; -diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h -index e15eb37ca6191e0eae3d4947751437d2646c996d..47fa2987909642b244615ff6c642adb278bcd784 100644 ---- a/drivers/gpu/drm/vc4/vc4_drv.h -+++ b/drivers/gpu/drm/vc4/vc4_drv.h -@@ -445,6 +445,7 @@ int vc4_bo_stats_debugfs(struct seq_file *m, void *arg); - extern struct platform_driver vc4_crtc_driver; - int vc4_enable_vblank(struct drm_device *dev, unsigned int crtc_id); - void vc4_disable_vblank(struct drm_device *dev, unsigned int crtc_id); -+bool vc4_event_pending(struct drm_crtc *crtc); - int vc4_crtc_debugfs_regs(struct seq_file *m, void *arg); - int vc4_crtc_get_scanoutpos(struct drm_device *dev, unsigned int crtc_id, - unsigned int flags, int *vpos, int *hpos, -diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c -index c1f65c6c8e601e9331768ca040a5609cad686b2e..67af2af70af091bf4b13ac03eb1078f867bc6cea 100644 ---- a/drivers/gpu/drm/vc4/vc4_kms.c -+++ b/drivers/gpu/drm/vc4/vc4_kms.c -@@ -119,17 +119,34 @@ static int vc4_atomic_commit(struct drm_device *dev, - - /* Make sure that any outstanding modesets have finished. */ - if (nonblock) { -- ret = down_trylock(&vc4->async_modeset); -- if (ret) { -+ struct drm_crtc *crtc; -+ struct drm_crtc_state *crtc_state; -+ unsigned long flags; -+ bool busy = false; -+ -+ /* -+ * If there's an undispatched event to send then we're -+ * obviously still busy. If there isn't, then we can -+ * unconditionally wait for the semaphore because it -+ * shouldn't be contended (for long). -+ * -+ * This is to prevent a race where queuing a new flip -+ * from userspace immediately on receipt of an event -+ * beats our clean-up and returns EBUSY. -+ */ -+ spin_lock_irqsave(&dev->event_lock, flags); -+ for_each_crtc_in_state(state, crtc, crtc_state, i) -+ busy |= vc4_event_pending(crtc); -+ spin_unlock_irqrestore(&dev->event_lock, flags); -+ if (busy) { - kfree(c); - return -EBUSY; - } -- } else { -- ret = down_interruptible(&vc4->async_modeset); -- if (ret) { -- kfree(c); -- return ret; -- } -+ } -+ ret = down_interruptible(&vc4->async_modeset); -+ if (ret) { -+ kfree(c); -+ return ret; - } - - ret = drm_atomic_helper_prepare_planes(dev, state); - -From 6da3042305d4f2def52ea196c3fe93da6700acce Mon Sep 17 00:00:00 2001 -From: Boris Brezillon -Date: Fri, 2 Dec 2016 14:48:07 +0100 -Subject: [PATCH 163/195] drm/vc4: Fix ->clock_select setting for the VEC - encoder - -PV_CONTROL_CLK_SELECT_VEC is actually 2 and not 0. Fix the definition and -rework the vc4_set_crtc_possible_masks() to cover the full range of the -PV_CONTROL_CLK_SELECT field. - -Signed-off-by: Boris Brezillon -Signed-off-by: Eric Anholt -(cherry picked from commit ab8df60e3a3b68420d0d4477c5f07c00fbfb078b) ---- - drivers/gpu/drm/vc4/vc4_crtc.c | 38 +++++++++++++++++++++++--------------- - drivers/gpu/drm/vc4/vc4_drv.h | 1 + - drivers/gpu/drm/vc4/vc4_regs.h | 3 ++- - 3 files changed, 26 insertions(+), 16 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c -index 61d64c9c4b0cd1aafc6451b0838cb203c1374a5a..bdf32c572fc2c46932daca934dfb002d05493883 100644 ---- a/drivers/gpu/drm/vc4/vc4_crtc.c -+++ b/drivers/gpu/drm/vc4/vc4_crtc.c -@@ -83,8 +83,7 @@ struct vc4_crtc_data { - /* Which channel of the HVS this pixelvalve sources from. */ - int hvs_channel; - -- enum vc4_encoder_type encoder0_type; -- enum vc4_encoder_type encoder1_type; -+ enum vc4_encoder_type encoder_types[4]; - }; - - #define CRTC_WRITE(offset, val) writel(val, vc4_crtc->regs + (offset)) -@@ -880,20 +879,26 @@ static const struct drm_crtc_helper_funcs vc4_crtc_helper_funcs = { - - static const struct vc4_crtc_data pv0_data = { - .hvs_channel = 0, -- .encoder0_type = VC4_ENCODER_TYPE_DSI0, -- .encoder1_type = VC4_ENCODER_TYPE_DPI, -+ .encoder_types = { -+ [PV_CONTROL_CLK_SELECT_DSI] = VC4_ENCODER_TYPE_DSI0, -+ [PV_CONTROL_CLK_SELECT_DPI_SMI_HDMI] = VC4_ENCODER_TYPE_DPI, -+ }, - }; - - static const struct vc4_crtc_data pv1_data = { - .hvs_channel = 2, -- .encoder0_type = VC4_ENCODER_TYPE_DSI1, -- .encoder1_type = VC4_ENCODER_TYPE_SMI, -+ .encoder_types = { -+ [PV_CONTROL_CLK_SELECT_DSI] = VC4_ENCODER_TYPE_DSI1, -+ [PV_CONTROL_CLK_SELECT_DPI_SMI_HDMI] = VC4_ENCODER_TYPE_SMI, -+ }, - }; - - static const struct vc4_crtc_data pv2_data = { - .hvs_channel = 1, -- .encoder0_type = VC4_ENCODER_TYPE_VEC, -- .encoder1_type = VC4_ENCODER_TYPE_HDMI, -+ .encoder_types = { -+ [PV_CONTROL_CLK_SELECT_DPI_SMI_HDMI] = VC4_ENCODER_TYPE_HDMI, -+ [PV_CONTROL_CLK_SELECT_VEC] = VC4_ENCODER_TYPE_VEC, -+ }, - }; - - static const struct of_device_id vc4_crtc_dt_match[] = { -@@ -907,17 +912,20 @@ static void vc4_set_crtc_possible_masks(struct drm_device *drm, - struct drm_crtc *crtc) - { - struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); -+ const struct vc4_crtc_data *crtc_data = vc4_crtc->data; -+ const enum vc4_encoder_type *encoder_types = crtc_data->encoder_types; - struct drm_encoder *encoder; - - drm_for_each_encoder(encoder, drm) { - struct vc4_encoder *vc4_encoder = to_vc4_encoder(encoder); -- -- if (vc4_encoder->type == vc4_crtc->data->encoder0_type) { -- vc4_encoder->clock_select = 0; -- encoder->possible_crtcs |= drm_crtc_mask(crtc); -- } else if (vc4_encoder->type == vc4_crtc->data->encoder1_type) { -- vc4_encoder->clock_select = 1; -- encoder->possible_crtcs |= drm_crtc_mask(crtc); -+ int i; -+ -+ for (i = 0; i < ARRAY_SIZE(crtc_data->encoder_types); i++) { -+ if (vc4_encoder->type == encoder_types[i]) { -+ vc4_encoder->clock_select = i; -+ encoder->possible_crtcs |= drm_crtc_mask(crtc); -+ break; -+ } - } - } - } -diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h -index 47fa2987909642b244615ff6c642adb278bcd784..6d0688056aa2c75cc6b5bf9a6c50cc62e1b398e2 100644 ---- a/drivers/gpu/drm/vc4/vc4_drv.h -+++ b/drivers/gpu/drm/vc4/vc4_drv.h -@@ -197,6 +197,7 @@ to_vc4_plane(struct drm_plane *plane) - } - - enum vc4_encoder_type { -+ VC4_ENCODER_TYPE_NONE, - VC4_ENCODER_TYPE_HDMI, - VC4_ENCODER_TYPE_VEC, - VC4_ENCODER_TYPE_DSI0, -diff --git a/drivers/gpu/drm/vc4/vc4_regs.h b/drivers/gpu/drm/vc4/vc4_regs.h -index 1aa44c2db5565ba126d2ceb65495a6c98c555860..39f6886b24100c43b590e47e0c7bc44846721d65 100644 ---- a/drivers/gpu/drm/vc4/vc4_regs.h -+++ b/drivers/gpu/drm/vc4/vc4_regs.h -@@ -177,8 +177,9 @@ - # define PV_CONTROL_WAIT_HSTART BIT(12) - # define PV_CONTROL_PIXEL_REP_MASK VC4_MASK(5, 4) - # define PV_CONTROL_PIXEL_REP_SHIFT 4 --# define PV_CONTROL_CLK_SELECT_DSI_VEC 0 -+# define PV_CONTROL_CLK_SELECT_DSI 0 - # define PV_CONTROL_CLK_SELECT_DPI_SMI_HDMI 1 -+# define PV_CONTROL_CLK_SELECT_VEC 2 - # define PV_CONTROL_CLK_SELECT_MASK VC4_MASK(3, 2) - # define PV_CONTROL_CLK_SELECT_SHIFT 2 - # define PV_CONTROL_FIFO_CLR BIT(1) - -From 98102d34c119b933dee35696e22cfbf3cb33936f Mon Sep 17 00:00:00 2001 +From 94beea77934da0bfa6601c18370b8018adc30cb2 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Fri, 2 Dec 2016 14:48:09 +0100 -Subject: [PATCH 164/195] drm: Add TV connector states to drm_connector_state +Subject: [PATCH 159/218] drm: Add TV connector states to drm_connector_state Some generic TV connector properties are exposed in drm_mode_config, but they are currently handled independently in each DRM encoder driver. @@ -131499,10 +131091,10 @@ index ac9d7d8e0e43a807e9fc9a0b66de5f26b49d3348..2645e803857253ff98eb94aa1bacc825 /** -From 2b3bdd6f81c507b021b3ed7585ba222f6faeb767 Mon Sep 17 00:00:00 2001 +From 6ec14651c0f7ba3b19e8a25a8c7f8c9b2352967e Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Fri, 2 Dec 2016 14:48:08 +0100 -Subject: [PATCH 165/195] drm: Turn DRM_MODE_SUBCONNECTOR_xx definitions into +Subject: [PATCH 160/218] drm: Turn DRM_MODE_SUBCONNECTOR_xx definitions into an enum List of values like the DRM_MODE_SUBCONNECTOR_xx ones are better @@ -131549,10 +131141,10 @@ index df0e3504c349a950bf41540fbcd6cd944cf11d2f..970bfc0d7107451e5bc4e29c524a764c #define DRM_MODE_CONNECTOR_Unknown 0 #define DRM_MODE_CONNECTOR_VGA 1 -From 03bc5629b29ba16d297f296ab44e6b77d4571d8c Mon Sep 17 00:00:00 2001 +From 362d9990d12718179a0efa23e6fe71f88200de17 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Fri, 2 Dec 2016 14:48:10 +0100 -Subject: [PATCH 166/195] drm/vc4: Add support for the VEC (Video Encoder) IP +Subject: [PATCH 161/218] drm/vc4: Add support for the VEC (Video Encoder) IP The VEC IP is a TV DAC, providing support for PAL and NTSC standards. @@ -132291,10 +131883,10 @@ index 0000000000000000000000000000000000000000..32bb8ef985fbc6f39f9e5f459846bb77 + }, +}; -From 435f3dcae47307842558d06e26d8295122e21b20 Mon Sep 17 00:00:00 2001 +From ffa23fa3e1787d148bb891a660f2fb8187483c99 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 15 Sep 2016 15:25:23 +0100 -Subject: [PATCH 167/195] drm/vc4: Set up SCALER_DISPCTRL at boot. +Subject: [PATCH 162/218] drm/vc4: Set up SCALER_DISPCTRL at boot. We want the HVS on, obviously, and we also want DSP3 (PV1's source) to be muxed from HVS channel 2 like we expect in vc4_crtc.c. The @@ -132354,10 +131946,10 @@ index 39f6886b24100c43b590e47e0c7bc44846721d65..b3b297fba7097bc495fa8916292c5479 * SCALER_DISPSTAT_IRQDISP0. Note that short frame contributions are * always enabled. -From 4915837b5ce9737be412e1071862006cb66b996c Mon Sep 17 00:00:00 2001 +From da0e334fe3c7e1ae350b1507669f247544f98beb Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 10 Feb 2016 16:17:29 -0800 -Subject: [PATCH 168/195] drm/vc4: Add support for feeding DSI encoders from +Subject: [PATCH 163/218] drm/vc4: Add support for feeding DSI encoders from the pixel valve. We have to set a different pixel format, which tells the hardware to @@ -132472,10 +132064,10 @@ index b3b297fba7097bc495fa8916292c547925720199..385405a2df05eb3dd86d4f687aa82053 # define PV_VCONTROL_VIDEN BIT(0) -From 05d2a7c2ea96d89ec7515b245d34887b63bcee3f Mon Sep 17 00:00:00 2001 +From 5093a9fdd8ee3ff152c9eaa1845cb03c2b5668c5 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 10 Feb 2016 11:42:32 -0800 -Subject: [PATCH 169/195] drm/vc4: Add DSI driver +Subject: [PATCH 164/218] drm/vc4: Add DSI driver The DSI0 and DSI1 blocks on the 2835 are related hardware blocks. Some registers move around, and the featureset is slightly different, @@ -134303,10 +133895,10 @@ index 0000000000000000000000000000000000000000..17fcac381dbb37cd9a5ff210ad8578f4 + }, +}; -From a86e36c3c6dc4ad21645482070fcebed639b960b Mon Sep 17 00:00:00 2001 +From 23eadb6954ad34997665d5a5ab1a93eb6fecc855 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Fri, 2 Dec 2016 14:48:12 +0100 -Subject: [PATCH 170/195] ARM: dts: bcm283x: Add VEC node in bcm283x.dtsi +Subject: [PATCH 165/218] ARM: dts: bcm283x: Add VEC node in bcm283x.dtsi Add the VEC (Video EnCoder) node definition in bcm283x.dtsi. @@ -134337,10 +133929,10 @@ index 41776b97b4b6b1c053d07fd357fac4ba4787ac53..d3cc586661f903e67a840189c0446aa8 compatible = "brcm,bcm2835-pixelvalve2"; reg = <0x7e807000 0x100>; -From aec2720328f43c781f4dbf539049e8461d53dca6 Mon Sep 17 00:00:00 2001 +From 0db6696cdaf3a83d0a6f586b5935afe671279ead Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Fri, 2 Dec 2016 14:48:13 +0100 -Subject: [PATCH 171/195] ARM: dts: bcm283x: Enable the VEC IP on all +Subject: [PATCH 166/218] ARM: dts: bcm283x: Enable the VEC IP on all RaspberryPi boards Enable the VEC IP on all RaspberryPi boards. @@ -134366,10 +133958,10 @@ index 365648898f3acc4f82dc6cb58e4bbebbe249be94..d4577a51e678cb600b475d3d3395ca4e + status = "okay"; +}; -From 05189a9cd8f5e929e9467936fe90d6616c5cb9ee Mon Sep 17 00:00:00 2001 +From 646b6754fd1f61dc821a917208acd3cc01daa4e6 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 23 Jan 2017 11:41:54 -0800 -Subject: [PATCH 172/195] BCM270X: Disable VEC unless vc4-kms-v3d is present. +Subject: [PATCH 167/218] BCM270X: Disable VEC unless vc4-kms-v3d is present. Signed-off-by: Eric Anholt --- @@ -134408,10 +134000,10 @@ index f25cd9a3936861920b0d518ff2d773ee467e2f49..a8ef8c9051668a7477dea30aa262568c cma-256 = <0>,"+0-1-2-3-4"; cma-192 = <0>,"-0+1-2-3-4"; -From 28fc24072721e7ed48889ff06f436074d9305c2e Mon Sep 17 00:00:00 2001 +From 26a18c73446816f7ded718368f97f7174ff25a9d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 1 Feb 2017 17:09:18 -0800 -Subject: [PATCH 173/195] drm/vc4: Name the primary and cursor planes in fkms. +Subject: [PATCH 168/218] drm/vc4: Name the primary and cursor planes in fkms. This makes debugging nicer, compared to trying to remember what the IDs are. @@ -134435,10 +134027,10 @@ index d18a1dae51a2275846c9826b5bf1ba57ae97b55c..e49ce68b607a7ffc2329e3235362f3bc if (type == DRM_PLANE_TYPE_PRIMARY) { vc4_plane->fbinfo = -From aabe0c5eb75ec20103dcd7d6df513c892f0b05f6 Mon Sep 17 00:00:00 2001 +From bf9baeecc9af7013b87a0137d3e7dc010f562412 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 1 Feb 2017 17:10:09 -0800 -Subject: [PATCH 174/195] drm/vc4: Add DRM_DEBUG_ATOMIC for the insides of +Subject: [PATCH 169/218] drm/vc4: Add DRM_DEBUG_ATOMIC for the insides of fkms. Trying to debug weston on fkms involved figuring out what calls I was @@ -134508,10 +134100,10 @@ index e49ce68b607a7ffc2329e3235362f3bc21ed5cbb..dbf065677202fbebf8e3a0cffbe880aa RPI_FIRMWARE_SET_CURSOR_STATE, &packet_state, -From 5481ee135033439ce05568844ab35d48f819d294 Mon Sep 17 00:00:00 2001 +From 4294b2aabc48eab45858da32e694cc556a2fea1f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 2 Feb 2017 09:42:18 -0800 -Subject: [PATCH 175/195] drm/vc4: Fix sending of page flip completion events +Subject: [PATCH 170/218] drm/vc4: Fix sending of page flip completion events in FKMS mode. In the rewrite of vc4_crtc.c for fkms, I dropped the part of the @@ -134553,10 +134145,10 @@ index dbf065677202fbebf8e3a0cffbe880aa42daef3f..da818a207bfa639b8cea48d94bcf4566 static void vc4_crtc_handle_page_flip(struct vc4_crtc *vc4_crtc) -From d81d5972aa6a81c3f5a6b7023b52a1d95faaea30 Mon Sep 17 00:00:00 2001 +From d1796f515b6a16a89eebc8268fc83fcab1bbf357 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 8 Feb 2017 15:00:54 -0800 -Subject: [PATCH 176/195] drm/vc4: Fulfill user BO creation requests from the +Subject: [PATCH 171/218] drm/vc4: Fulfill user BO creation requests from the kernel BO cache. The from_cache flag was actually "the BO is invisible to userspace", @@ -134609,10 +134201,10 @@ index 3f6704cf6608d7be47637c6aa585de087b7f74ee..5ec14f25625dde6fd61e10415092fa25 cma_obj = drm_gem_cma_create(dev, size); -From 47986e99a73f3ecd19b1513787c8ca3e412d4dfa Mon Sep 17 00:00:00 2001 +From ada9aaf19d32c109ec9189b5d2a6a399b828bdde Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 9 Feb 2017 09:23:34 -0800 -Subject: [PATCH 177/195] drm/vc4: Fix OOPSes from trying to cache a partially +Subject: [PATCH 172/218] drm/vc4: Fix OOPSes from trying to cache a partially constructed BO. If a CMA allocation failed, the partially constructed BO would be @@ -134646,10 +134238,10 @@ index 5ec14f25625dde6fd61e10415092fa25527cc151..fd83a28076564b9ea5cf0f2ba29b884e if (!cache_list) { vc4_bo_destroy(bo); -From 2314ac77fd01030c3e7f2b6a4239ce4abf9ab67f Mon Sep 17 00:00:00 2001 +From 81f86f488ee8641576f235bca9db229d15ad3643 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 12 Oct 2015 08:58:08 -0700 -Subject: [PATCH 178/195] drm/vc4: Verify at boot that CMA doesn't cross a +Subject: [PATCH 173/218] drm/vc4: Verify at boot that CMA doesn't cross a 256MB boundary. I've seen lots of users cranking CMA up higher, so throw an error if @@ -134732,10 +134324,10 @@ index c960459eda7e640ea55be1d4ed80c6a9125a8877..b50245282a18bc790da0f901944c2e67 static unsigned long cma_bitmap_aligned_mask(const struct cma *cma, int align_order) -From 0c1283c0888883799af200fa010764c5c8b8727d Mon Sep 17 00:00:00 2001 +From fed165663396b4062279ea05dcf9337332148bb7 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 17 Feb 2017 09:47:11 +0000 -Subject: [PATCH 179/195] BCM270X_DT: Add SMSC ethernet controller to DT +Subject: [PATCH 174/218] BCM270X_DT: Add SMSC ethernet controller to DT With an ethernet node in the DT, a suitable firmware can populate the local-mac-address property, removing the need for a downstream patch @@ -134798,10 +134390,10 @@ index d29ba72de727fe26b5a586e0bd0a41181c68ae04..78101849441679baf3624cf67a0ff7a2 / { model = "Raspberry Pi 3 Model B"; -From 6ee690b766306baaded14f6423e8312bafd00b95 Mon Sep 17 00:00:00 2001 +From 437862ae39c750054a658137eae12602862bfa58 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 17 Feb 2017 15:26:13 +0000 -Subject: [PATCH 180/195] brcmfmac: Mute expected startup 'errors' +Subject: [PATCH 175/218] brcmfmac: Mute expected startup 'errors' The brcmfmac WiFi driver always complains about the '00' country code and the firmware version is reported as an error. Modify the driver to @@ -134840,10 +134432,10 @@ index 4051780f64f44a5ce522babe6c371a1beb79a824..b081673abcb4aa72d70d8e0834b608f6 /* locate firmware version number for ethtool */ ptr = strrchr(buf, ' ') + 1; -From 07a3382430eed7494c4a1ade05461f4c03edf484 Mon Sep 17 00:00:00 2001 +From d71c77cec184e2af2e76b1695eb65bd2e4eacac3 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Feb 2017 17:20:08 +0000 -Subject: [PATCH 181/195] clk-bcm2835: Mark used PLLs and dividers CRITICAL +Subject: [PATCH 176/218] clk-bcm2835: Mark used PLLs and dividers CRITICAL The VPU configures and relies on several PLLs and dividers. Mark all enabled dividers and their PLLs as CRITICAL to prevent the kernel from @@ -134871,10 +134463,10 @@ index 136e5d28f9eaeaa10d45382a0f31da9f4adb91ef..4192863778c8009aacfc9a49ee38ad1c divider->data = data; -From 0316a7b83aa51325f6ce0a344df1c7ed4fe11174 Mon Sep 17 00:00:00 2001 +From 31fcaf0d440fa76fde996e425d4dc828685467a2 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Feb 2017 17:20:08 +0000 -Subject: [PATCH 182/195] clk-bcm2835: Add claim-clocks property +Subject: [PATCH 177/218] clk-bcm2835: Add claim-clocks property The claim-clocks property can be used to prevent PLLs and dividers from being marked as critical. It contains a vector of clock IDs, @@ -135009,10 +134601,10 @@ index 4192863778c8009aacfc9a49ee38ad1ca62a01e4..6b245357e4e93c19a839eee92a82f95a sizeof(cprman_parent_names)); of_clk_parent_fill(dev->of_node, cprman->real_parent_names, -From 60a6aec97b9c6117313e14d34bc5b3bd8e4a090b Mon Sep 17 00:00:00 2001 +From 256ed4e5d4b393a81392b3c02b3949a1558b2f54 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Mon, 20 Feb 2017 20:01:16 +0100 -Subject: [PATCH 183/195] dmaengine: bcm2835: Fix cyclic DMA period splitting +Subject: [PATCH 178/218] dmaengine: bcm2835: Fix cyclic DMA period splitting The code responsible for splitting periods into chunks that can be handled by the DMA controller missed to update total_len, @@ -135051,10 +134643,10 @@ index 80d35f760b4a4a51e60c355a84d538bac3892a4d..599c218dc8a73172dd4bd4a058fc8f95 /* calculate the length that remains to reach period_length */ control_block->length = period_len - *total_len; -From e4dbb0d219dd203607df119752cd962ffc3295b3 Mon Sep 17 00:00:00 2001 +From c22ba62ab46ea8c480ba1a289434a06c244a74a5 Mon Sep 17 00:00:00 2001 From: Scott Ellis Date: Thu, 23 Feb 2017 11:56:20 -0500 -Subject: [PATCH 184/195] Add ads1015 driver to config +Subject: [PATCH 179/218] Add ads1015 driver to config --- arch/arm/configs/bcm2709_defconfig | 3 ++- @@ -135108,10 +134700,10 @@ index 9a9cd1cdcb2f76d4408568681ec80885293bae48..554fed3a4fbfd1940422b808046c6d2b CONFIG_FB=y CONFIG_FB_BCM2708=y -From ea1570c63ba1cecaee28ccb906218ac35cf07a51 Mon Sep 17 00:00:00 2001 +From 701f346e4b72bfb0a14993e285156cbc694f6d2b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 27 Jan 2017 18:49:30 +0000 -Subject: [PATCH 185/195] config: add slcan kernel module +Subject: [PATCH 180/218] config: add slcan kernel module See: https://github.com/raspberrypi/linux/issues/1819 --- @@ -135144,10 +134736,10 @@ index 554fed3a4fbfd1940422b808046c6d2b1f508394..99888182259b280790a7506b248a8130 CONFIG_IRDA=m CONFIG_IRLAN=m -From d57767416218047cebc0d14ca7c106d9eb11c467 Mon Sep 17 00:00:00 2001 +From 9d46aee2a376c09c66527e7d9893ee6a91e40f6b Mon Sep 17 00:00:00 2001 From: Miquel Date: Fri, 24 Feb 2017 20:51:06 +0100 -Subject: [PATCH 186/195] sound: Support for Dion Audio LOCO-V2 DAC-AMP HAT +Subject: [PATCH 181/218] sound: Support for Dion Audio LOCO-V2 DAC-AMP HAT Signed-off-by: Miquel Blauw --- @@ -135411,10 +135003,10 @@ index 0000000000000000000000000000000000000000..a009c49477972a9832175d86f201b035 +MODULE_DESCRIPTION("ASoC Driver for DionAudio LOCO-V2"); +MODULE_LICENSE("GPL v2"); -From 220cffc498b4935cedd712667c61d566753ca2b5 Mon Sep 17 00:00:00 2001 +From 35ce1097bb1bbde15f3b66a4c5c2ba4c5279d909 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Sun, 26 Feb 2017 01:13:02 +0000 -Subject: [PATCH 187/195] SQUASH: Add LOCO-V2 overlay from last commit +Subject: [PATCH 182/218] SQUASH: Add LOCO-V2 overlay from last commit --- .../dts/overlays/dionaudio-loco-v2-overlay.dts | 49 ++++++++++++++++++++++ @@ -135477,10 +135069,10 @@ index 0000000000000000000000000000000000000000..a1af93de30119734e8d14cbd454589d3 + }; +}; -From 5521afdc20ba69bf5b9089e37125b5d41555f1e0 Mon Sep 17 00:00:00 2001 +From 75a2eae30f3a8de1ae9338f82bfdf60658f6f5ce Mon Sep 17 00:00:00 2001 From: Fe-Pi Date: Wed, 1 Mar 2017 04:42:43 -0700 -Subject: [PATCH 188/195] Add support for Fe-Pi audio sound card. (#1867) +Subject: [PATCH 183/218] Add support for Fe-Pi audio sound card. (#1867) Fe-Pi Audio Sound Card is based on NXP SGTL5000 codec. Mechanical specification of the board is the same the Raspberry Pi Zero. @@ -135829,10 +135421,10 @@ index 0000000000000000000000000000000000000000..015b56fd73cc36be5b5eecd17548fd03 +MODULE_DESCRIPTION("ASoC Driver for Fe-Pi Audio"); +MODULE_LICENSE("GPL v2"); -From 42f098f58abf9231da313bbdeb65f1f73a9c6393 Mon Sep 17 00:00:00 2001 +From 4dae1738ce8223ba7ec26816acc9ca9b75d8dd6b Mon Sep 17 00:00:00 2001 From: Scott Ellis Date: Wed, 1 Mar 2017 07:22:24 -0500 -Subject: [PATCH 189/195] Add overlay for ads1115 ADCs (#1864) +Subject: [PATCH 184/218] Add overlay for ads1115 ADCs (#1864) --- arch/arm/boot/dts/overlays/Makefile | 1 + @@ -135996,10 +135588,10 @@ index 0000000000000000000000000000000000000000..7c16a1af3172d14e1a976b1776b9f167 + }; +}; -From a9c6f2f8142e6667eb6b0187d014d8992f48d9b7 Mon Sep 17 00:00:00 2001 +From a9c3d0bc656e1f8125faef0f11415066d1ee3254 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 1 Mar 2017 16:06:53 +0000 -Subject: [PATCH 190/195] clk-bcm2835: Correct the prediv logic +Subject: [PATCH 185/218] clk-bcm2835: Correct the prediv logic If a clock has the prediv flag set, both the integer and fractional parts must be scaled when calculating the resulting frequency. @@ -136026,10 +135618,10 @@ index 6b245357e4e93c19a839eee92a82f95aec996e4e..8ea29fbc8dc451b9cff502bc1a918ae6 return bcm2835_pll_rate_from_divisors(parent_rate, ndiv, fdiv, pdiv); } -From 5a558d984d72ae8e37189ccd252e7c22fce36352 Mon Sep 17 00:00:00 2001 +From 51b3d8a66950691617045bba56fbea1be972f69a Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 1 Mar 2017 16:07:39 +0000 -Subject: [PATCH 191/195] amba_pl011: Round input clock up +Subject: [PATCH 186/218] amba_pl011: Round input clock up The UART clock is initialised to be as close to the requested frequency as possible without exceeding it. Now that there is a @@ -136115,10 +135707,10 @@ index 5a11ff833e1fd112ba04df3a427cd94bf6793ec5..003a5b0c30295dbbcb94a28d0c64d124 /* unregisters the driver also if no more ports are left */ static void pl011_unregister_port(struct uart_amba_port *uap) -From 859658183b0da8397fbed8b1aca10e1e1c545598 Mon Sep 17 00:00:00 2001 +From 8a45acd82cdc740f9e8251c9f1ce9b018ae5276e Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 13 Feb 2017 11:10:50 +0000 -Subject: [PATCH 192/195] BCM2835-V4L2: Ensure H264 header bytes get a sensible +Subject: [PATCH 187/218] BCM2835-V4L2: Ensure H264 header bytes get a sensible timestamp H264 header come off VC with 0 timestamps, which means they get a @@ -136207,10 +135799,10 @@ index e6aeb7e7e381de65d6c6586205069a4c5cd33274..7f8a68916a67001bc9241bce2928519a struct vchiq_mmal_port *port; /* port being used for capture */ /* camera port being used for capture */ -From 21b2f76504187e2a5fe2043de2db00a642163df1 Mon Sep 17 00:00:00 2001 +From 524fea578957cbe473b9614946db30e80ecc5730 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 13 Feb 2017 13:11:41 +0000 -Subject: [PATCH 193/195] BCM2835-V4L2: Correctly denote key frames in encoded +Subject: [PATCH 188/218] BCM2835-V4L2: Correctly denote key frames in encoded data Forward MMAL key frame flags to the V4L2 buffers. @@ -136235,10 +135827,10 @@ index e69731320f4e59249933bc21843913deab4a1209..6bdec0806126044cf7146d53326e4da5 "Buffer has ts %llu", dev->capture.last_timestamp); -From 42d2dabcd8aa8e74ccea82e9e3203b5ea7545aa8 Mon Sep 17 00:00:00 2001 +From ea252e584634a2717ea90318e2cd29684819f790 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 20 Feb 2017 17:01:21 +0000 -Subject: [PATCH 194/195] bcm2835-gpio-exp: Driver for GPIO expander via +Subject: [PATCH 189/218] bcm2835-gpio-exp: Driver for GPIO expander via mailbox service Pi3 and Compute Module 3 have a GPIO expander that the @@ -136656,10 +136248,10 @@ index 2859db09e25bb945251e85edb39bc43430857168..56b3f0fe1ea3d22fcf207e6df90b640e /* Dispmanx TAGS */ RPI_FIRMWARE_FRAMEBUFFER_ALLOCATE = 0x00040001, -From 7cea35f5b206a17ae0ee91d809f59d37678f27b0 Mon Sep 17 00:00:00 2001 +From b22ef9fc6c2ea6c6d7f3bb79d5c8cad10da1df71 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 24 May 2016 16:30:05 +0100 -Subject: [PATCH 195/195] BCM270X_DT: Add bcm2708-rpi-0-w.dts +Subject: [PATCH 190/218] BCM270X_DT: Add bcm2708-rpi-0-w.dts Add DT support for the Pi Zero W. N.B. It will not be loaded automatically without a corresponding change to the firmware. @@ -136886,3 +136478,5108 @@ index 0000000000000000000000000000000000000000..db0f99ddf2f46e83827d56e21c4846dd + sd_debug = <&sdhost>,"brcm,debug"; + }; +}; + +From c2d958c910600df334f245b20feb9d06e0c8dd28 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Mon, 6 Mar 2017 09:06:18 +0000 +Subject: [PATCH 191/218] clk-bcm2835: Read max core clock from firmware + +The VPU is responsible for managing the core clock, usually under +direction from the bcm2835-cpufreq driver but not via the clk-bcm2835 +driver. Since the core frequency can change without warning, it is +safer to report the maximum clock rate to users of the core clock - +I2C, SPI and the mini UART - to err on the safe side when calculating +clock divisors. + +If the DT node for the clock driver includes a reference to the +firmware node, use the firmware API to query the maximum core clock +instead of reading the divider registers. + +Prior to this patch, a "100KHz" I2C bus was sometimes clocked at about +160KHz. In particular, switching to the 4.9 kernel was likely to break +SenseHAT usage on a Pi3. + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/bcm2708-rpi.dtsi | 4 ++++ + drivers/clk/bcm/clk-bcm2835.c | 39 +++++++++++++++++++++++++++++++++++++- + 2 files changed, 42 insertions(+), 1 deletion(-) + +diff --git a/arch/arm/boot/dts/bcm2708-rpi.dtsi b/arch/arm/boot/dts/bcm2708-rpi.dtsi +index 1f5f40b9c7cbd574f12a42d8c3fa5344138d155e..72ab7fc673cef529c501026964284009b7cd401e 100644 +--- a/arch/arm/boot/dts/bcm2708-rpi.dtsi ++++ b/arch/arm/boot/dts/bcm2708-rpi.dtsi +@@ -111,3 +111,7 @@ + &vec { + status = "disabled"; + }; ++ ++&clocks { ++ firmware = <&firmware>; ++}; +diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c +index 8ea29fbc8dc451b9cff502bc1a918ae65fb1b306..fe3298b54cdfb96bd90fb4f39e13921d2e1d4356 100644 +--- a/drivers/clk/bcm/clk-bcm2835.c ++++ b/drivers/clk/bcm/clk-bcm2835.c +@@ -45,6 +45,7 @@ + #include + #include + #include ++#include + + #define CM_PASSWORD 0x5a000000 + +@@ -299,6 +300,8 @@ + #define LOCK_TIMEOUT_NS 100000000 + #define BCM2835_MAX_FB_RATE 1750000000u + ++#define VCMSG_ID_CORE_CLOCK 4 ++ + /* + * Names of clocks used within the driver that need to be replaced + * with an external parent's name. This array is in the order that +@@ -317,6 +320,7 @@ static const char *const cprman_parent_names[] = { + struct bcm2835_cprman { + struct device *dev; + void __iomem *regs; ++ struct rpi_firmware *fw; + spinlock_t regs_lock; /* spinlock for all clocks */ + + /* +@@ -1025,6 +1029,30 @@ static unsigned long bcm2835_clock_get_rate(struct clk_hw *hw, + return bcm2835_clock_rate_from_divisor(clock, parent_rate, div); + } + ++static unsigned long bcm2835_clock_get_rate_vpu(struct clk_hw *hw, ++ unsigned long parent_rate) ++{ ++ struct bcm2835_clock *clock = bcm2835_clock_from_hw(hw); ++ struct bcm2835_cprman *cprman = clock->cprman; ++ ++ if (cprman->fw) { ++ struct { ++ u32 id; ++ u32 val; ++ } packet; ++ ++ packet.id = VCMSG_ID_CORE_CLOCK; ++ packet.val = 0; ++ ++ if (!rpi_firmware_property(cprman->fw, ++ RPI_FIRMWARE_GET_MAX_CLOCK_RATE, ++ &packet, sizeof(packet))) ++ return packet.val; ++ } ++ ++ return bcm2835_clock_get_rate(hw, parent_rate); ++} ++ + static void bcm2835_clock_wait_busy(struct bcm2835_clock *clock) + { + struct bcm2835_cprman *cprman = clock->cprman; +@@ -1292,7 +1320,7 @@ static int bcm2835_vpu_clock_is_on(struct clk_hw *hw) + */ + static const struct clk_ops bcm2835_vpu_clock_clk_ops = { + .is_prepared = bcm2835_vpu_clock_is_on, +- .recalc_rate = bcm2835_clock_get_rate, ++ .recalc_rate = bcm2835_clock_get_rate_vpu, + .set_rate = bcm2835_clock_set_rate, + .determine_rate = bcm2835_clock_determine_rate, + .set_parent = bcm2835_clock_set_parent, +@@ -2155,6 +2183,7 @@ static int bcm2835_clk_probe(struct platform_device *pdev) + struct resource *res; + const struct bcm2835_clk_desc *desc; + const size_t asize = ARRAY_SIZE(clk_desc_array); ++ struct device_node *fw_node; + size_t i; + u32 clk_id; + int ret; +@@ -2172,6 +2201,14 @@ static int bcm2835_clk_probe(struct platform_device *pdev) + if (IS_ERR(cprman->regs)) + return PTR_ERR(cprman->regs); + ++ fw_node = of_parse_phandle(dev->of_node, "firmware", 0); ++ if (fw_node) { ++ struct rpi_firmware *fw = rpi_firmware_get(NULL); ++ if (!fw) ++ return -EPROBE_DEFER; ++ cprman->fw = fw; ++ } ++ + memset(bcm2835_clk_claimed, 0, sizeof(bcm2835_clk_claimed)); + for (i = 0; + !of_property_read_u32_index(pdev->dev.of_node, "claim-clocks", + +From 40ebee7ae82db7700a022addf75473132b1f4960 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 7 Mar 2017 19:48:23 +0000 +Subject: [PATCH 192/218] config: Add CONFIG_CRYPTO_LZ4 + +Enabling this options allows LZ4 memory compression. + +Fixes: https://github.com/raspberrypi/linux/issues/1875 + +Signed-off-by: Phil Elwell +--- + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 0173885ecbbfb98a27323a418d256841965412a1..ac50cc68f3a32ca897077d6fb70d8d2a7ec8cef2 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -1308,6 +1308,7 @@ CONFIG_CRYPTO_TGR192=m + CONFIG_CRYPTO_WP512=m + CONFIG_CRYPTO_CAST5=m + CONFIG_CRYPTO_DES=y ++CONFIG_CRYPTO_LZ4=m + CONFIG_CRYPTO_USER_API_SKCIPHER=m + # CONFIG_CRYPTO_HW is not set + CONFIG_ARM_CRYPTO=y +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 2c124bbfa343bf2c160250d055e1509678a80850..1748fcb84bdc3853ffccba93a41cd2dc0472d9fd 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -1318,6 +1318,7 @@ CONFIG_CRYPTO_TGR192=m + CONFIG_CRYPTO_WP512=m + CONFIG_CRYPTO_CAST5=m + CONFIG_CRYPTO_DES=y ++CONFIG_CRYPTO_LZ4=m + CONFIG_CRYPTO_USER_API_SKCIPHER=m + # CONFIG_CRYPTO_HW is not set + CONFIG_ARM_CRYPTO=y + +From b2dc4b0da8d4da904c2d6352df456f3fa35414fc Mon Sep 17 00:00:00 2001 +From: Michael Zoran +Date: Thu, 23 Feb 2017 17:54:31 -0800 +Subject: [PATCH 193/218] drm/vc4: Don't wait for vblank when updating the + cursor + +Commonly used desktop environments such as xfce4 and gnome +on debian sid can flood the graphics drivers with cursor +updates. Because the current implementation is waiting +for a vblank between cursor updates, this will cause the +display to hang for a long time since a typical refresh +rate is only 60Hz. + +This is unnecessary and unexpected by user mode software, +so simply swap out the cursor frame buffer without waiting. + +Signed-off-by: Michael Zoran +Reviewed-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_plane.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c +index 881bf489478b01b34e9e4df6013fe608c42215ee..14d69bb4967dedcd3bbc475639a8c27e38662fb3 100644 +--- a/drivers/gpu/drm/vc4/vc4_plane.c ++++ b/drivers/gpu/drm/vc4/vc4_plane.c +@@ -20,6 +20,7 @@ + + #include "vc4_drv.h" + #include "vc4_regs.h" ++#include "drm_atomic.h" + #include "drm_atomic_helper.h" + #include "drm_fb_cma_helper.h" + #include "drm_plane_helper.h" +@@ -769,12 +770,6 @@ vc4_update_plane(struct drm_plane *plane, + if (!plane_state) + goto out; + +- /* If we're changing the cursor contents, do that in the +- * normal vblank-synced atomic path. +- */ +- if (fb != plane_state->fb) +- goto out; +- + /* No configuring new scaling in the fast path. */ + if (crtc_w != plane_state->crtc_w || + crtc_h != plane_state->crtc_h || +@@ -783,6 +778,11 @@ vc4_update_plane(struct drm_plane *plane, + goto out; + } + ++ if (fb != plane_state->fb) { ++ drm_atomic_set_fb_for_plane(plane->state, fb); ++ vc4_plane_async_set_fb(plane, fb); ++ } ++ + /* Set the cursor's position on the screen. This is the + * expected change from the drm_mode_cursor_universal() + * helper. + +From c85d1b5d89cf13fa731bad864bc7c03c90e82dc5 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Mon, 6 Mar 2017 12:17:16 -0800 +Subject: [PATCH 194/218] panel-raspberrypi-touchscreen: Round up clk rate to + fix DSI panel. + +Commit 488f9bc8e3def93e0baef53cee2026c2cb0d8956 slightly increased the +reported rate of PLLD, so the clk driver decided that PLLD/3/8 was now +higher than our requested pixel clock rate and rejected it in favor of +PLLD/4/8, which then ran the pixel clock way out of spec. + +By bumping the requested clock rate just slightly, we get back to +PLLD/3/8 like we wanted and the panel displays content again. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c +index 1a536fe4d040f5fafe324baee110a6225dd0be08..7f315f04b109621ca7f3861fdd8acf956e752629 100644 +--- a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c ++++ b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c +@@ -220,7 +220,12 @@ static const struct drm_display_mode rpi_touchscreen_modes[] = { + #define HBP 46 + #define HFP ((PIXEL_CLOCK / (VTOTAL * VREFRESH)) - (HACT + HSW + HBP)) + +- .clock = PIXEL_CLOCK / 1000, ++ /* Round up the pixel clock a bit (10khz), so that the ++ * "don't run things faster than the requested clock ++ * rate" rule of the clk driver doesn't reject the ++ * divide-by-3 mode due to rounding error. ++ */ ++ .clock = PIXEL_CLOCK / 1000 + 10, + .hdisplay = HACT, + .hsync_start = HACT + HFP, + .hsync_end = HACT + HFP + HSW, + +From 6bd2872f819fa8c91c3addb12c6160507c586ab4 Mon Sep 17 00:00:00 2001 +From: Matt Flax +Date: Wed, 8 Mar 2017 20:04:13 +1100 +Subject: [PATCH 195/218] Add support for the AudioInjector.net Octo sound card + +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 6 + + .../dts/overlays/audioinjector-addons-overlay.dts | 50 ++++ + arch/arm/configs/bcm2709_defconfig | 2 + + arch/arm/configs/bcmrpi_defconfig | 2 + + sound/soc/bcm/Kconfig | 7 + + sound/soc/bcm/Makefile | 2 + + sound/soc/bcm/audioinjector-octo-soundcard.c | 286 +++++++++++++++++++++ + 8 files changed, 356 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/audioinjector-addons-overlay.dts + create mode 100644 sound/soc/bcm/audioinjector-octo-soundcard.c + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index c890e5ddb0e2eec982597a851023b539d318d6ce..0f7340799fb465ba1fb5aaa1e970cbf6295d75c4 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -9,6 +9,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + akkordion-iqdacplus.dtbo \ + allo-piano-dac-pcm512x-audio.dtbo \ + at86rf233.dtbo \ ++ audioinjector-addons.dtbo \ + audioinjector-wm8731-audio.dtbo \ + audremap.dtbo \ + bmp085_i2c-sensor.dtbo \ +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 970c9c9b5c74467a3014a77039fa765d8f8c4e6f..c1883bba938290f03826026651c764cfd4ac278b 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -295,6 +295,12 @@ Params: interrupt GPIO used for INT (default 23) + arrays (0=+0pF, 15=+4.5pF, default 15) + + ++Name: audioinjector-addons ++Info: Configures the audioinjector.net audio add on soundcards ++Load: dtoverlay=audioinjector-addons ++Params: ++ ++ + Name: audioinjector-wm8731-audio + Info: Configures the audioinjector.net audio add on soundcard + Load: dtoverlay=audioinjector-wm8731-audio +diff --git a/arch/arm/boot/dts/overlays/audioinjector-addons-overlay.dts b/arch/arm/boot/dts/overlays/audioinjector-addons-overlay.dts +new file mode 100644 +index 0000000000000000000000000000000000000000..dbf2f3cacc2e6bf5b7116fbadd97f2781580a79c +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/audioinjector-addons-overlay.dts +@@ -0,0 +1,50 @@ ++// Definitions for audioinjector.net audio add on soundcard ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target = <&i2s>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&i2c1>; ++ __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ cs42448: cs42448@48 { ++ #sound-dai-cells = <0>; ++ compatible = "cirrus,cs42448"; ++ reg = <0x48>; ++ clocks = <&cs42448_mclk>; ++ clock-names = "mclk"; ++ status = "okay"; ++ }; ++ ++ cs42448_mclk: codec-mclk { ++ compatible = "fixed-clock"; ++ #clock-cells = <0>; ++ clock-frequency = <49152000>; ++ }; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&sound>; ++ __overlay__ { ++ compatible = "ai,audioinjector-octo-soundcard"; ++ mult-gpios = <&gpio 27 0>, <&gpio 22 0>, <&gpio 23 0>, ++ <&gpio 24 0>; ++ i2s-controller = <&i2s>; ++ codec = <&cs42448>; ++ status = "okay"; ++ }; ++ }; ++}; +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index ac50cc68f3a32ca897077d6fb70d8d2a7ec8cef2..802ba0f149c571c215e556711367298d80409d71 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -888,6 +888,7 @@ CONFIG_SND_BCM2708_SOC_IQAUDIO_DIGI=m + CONFIG_SND_BCM2708_SOC_RASPIDAC3=m + CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m + CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m ++CONFIG_SND_AUDIOINJECTOR_OCTO_SOUNDCARD=m + CONFIG_SND_DIGIDAC1_SOUNDCARD=m + CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO=m + CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO_V2=m +@@ -897,6 +898,7 @@ CONFIG_SND_PISOUND=m + CONFIG_SND_SOC_ADAU1701=m + CONFIG_SND_SOC_ADAU7002=m + CONFIG_SND_SOC_AK4554=m ++CONFIG_SND_SOC_CS42XX8_I2C=m + CONFIG_SND_SOC_WM8804_I2C=m + CONFIG_SND_SIMPLE_CARD=m + CONFIG_SOUND_PRIME=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 1748fcb84bdc3853ffccba93a41cd2dc0472d9fd..bf52db66afb2aa18d6f6f9fb9b64dcbd97e24521 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -881,6 +881,7 @@ CONFIG_SND_BCM2708_SOC_IQAUDIO_DIGI=m + CONFIG_SND_BCM2708_SOC_RASPIDAC3=m + CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m + CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m ++CONFIG_SND_AUDIOINJECTOR_OCTO_SOUNDCARD=m + CONFIG_SND_DIGIDAC1_SOUNDCARD=m + CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO=m + CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO_V2=m +@@ -890,6 +891,7 @@ CONFIG_SND_PISOUND=m + CONFIG_SND_SOC_ADAU1701=m + CONFIG_SND_SOC_ADAU7002=m + CONFIG_SND_SOC_AK4554=m ++CONFIG_SND_SOC_CS42XX8_I2C=m + CONFIG_SND_SOC_WM8804_I2C=m + CONFIG_SND_SIMPLE_CARD=m + CONFIG_SOUND_PRIME=m +diff --git a/sound/soc/bcm/Kconfig b/sound/soc/bcm/Kconfig +index e626da6007a232e3e39660d7712ef1f4a5c30e8d..58d03b97f53363ed18df8fb10b4b3477a59e4ca3 100644 +--- a/sound/soc/bcm/Kconfig ++++ b/sound/soc/bcm/Kconfig +@@ -118,6 +118,13 @@ config SND_AUDIOINJECTOR_PI_SOUNDCARD + help + Say Y or M if you want to add support for audioinjector.net Pi Hat + ++config SND_AUDIOINJECTOR_OCTO_SOUNDCARD ++ tristate "Support for audioinjector.net Octo channel (Hat) soundcard" ++ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S ++ select SND_SOC_CS42XX8_I2C ++ help ++ Say Y or M if you want to add support for audioinjector.net octo add on ++ + config SND_DIGIDAC1_SOUNDCARD + tristate "Support for Red Rocks Audio DigiDAC1" + depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S +diff --git a/sound/soc/bcm/Makefile b/sound/soc/bcm/Makefile +index 8d2d2073dc2cede9fbd9eb8b49083650ba0a8172..d448aa517bf994fc0a41580c91b5d87deec9e1b0 100644 +--- a/sound/soc/bcm/Makefile ++++ b/sound/soc/bcm/Makefile +@@ -23,6 +23,7 @@ snd-soc-iqaudio-dac-objs := iqaudio-dac.o + snd-soc-iqaudio-digi-objs := iqaudio_digi.o + snd-soc-raspidac3-objs := raspidac3.o + snd-soc-audioinjector-pi-soundcard-objs := audioinjector-pi-soundcard.o ++snd-soc-audioinjector-octo-soundcard-objs := audioinjector-octo-soundcard.o + snd-soc-digidac1-soundcard-objs := digidac1-soundcard.o + snd-soc-dionaudio-loco-objs := dionaudio_loco.o + snd-soc-dionaudio-loco-v2-objs := dionaudio_loco-v2.o +@@ -44,6 +45,7 @@ obj-$(CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC) += snd-soc-iqaudio-dac.o + obj-$(CONFIG_SND_BCM2708_SOC_IQAUDIO_DIGI) += snd-soc-iqaudio-digi.o + obj-$(CONFIG_SND_BCM2708_SOC_RASPIDAC3) += snd-soc-raspidac3.o + obj-$(CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD) += snd-soc-audioinjector-pi-soundcard.o ++obj-$(CONFIG_SND_AUDIOINJECTOR_OCTO_SOUNDCARD) += snd-soc-audioinjector-octo-soundcard.o + obj-$(CONFIG_SND_DIGIDAC1_SOUNDCARD) += snd-soc-digidac1-soundcard.o + obj-$(CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO) += snd-soc-dionaudio-loco.o + obj-$(CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO_V2) += snd-soc-dionaudio-loco-v2.o +diff --git a/sound/soc/bcm/audioinjector-octo-soundcard.c b/sound/soc/bcm/audioinjector-octo-soundcard.c +new file mode 100644 +index 0000000000000000000000000000000000000000..9effea725798640887755dfa688da45338718afc +--- /dev/null ++++ b/sound/soc/bcm/audioinjector-octo-soundcard.c +@@ -0,0 +1,286 @@ ++/* ++ * ASoC Driver for AudioInjector Pi octo channel soundcard (hat) ++ * ++ * Created on: 27-October-2016 ++ * Author: flatmax@flatmax.org ++ * based on audioinjector-pi-soundcard.c ++ * ++ * Copyright (C) 2016 Flatmax Pty. Ltd. ++ * ++ * 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. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ */ ++ ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++ ++static struct gpio_descs *mult_gpios; ++static unsigned int audioinjector_octo_rate; ++ ++static int audioinjector_octo_dai_init(struct snd_soc_pcm_runtime *rtd) ++{ ++ return snd_soc_dai_set_bclk_ratio(rtd->cpu_dai, 64); ++} ++ ++static int audioinjector_octo_startup(struct snd_pcm_substream *substream) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ rtd->cpu_dai->driver->playback.channels_min = 8; ++ rtd->cpu_dai->driver->playback.channels_max = 8; ++ rtd->cpu_dai->driver->capture.channels_min = 8; ++ rtd->cpu_dai->driver->capture.channels_max = 8; ++ rtd->codec_dai->driver->capture.channels_max = 8; ++ return 0; ++} ++ ++static void audioinjector_octo_shutdown(struct snd_pcm_substream *substream) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ rtd->cpu_dai->driver->playback.channels_min = 2; ++ rtd->cpu_dai->driver->playback.channels_max = 2; ++ rtd->cpu_dai->driver->capture.channels_min = 2; ++ rtd->cpu_dai->driver->capture.channels_max = 2; ++ rtd->codec_dai->driver->capture.channels_max = 6; ++} ++ ++static int audioinjector_octo_hw_params(struct snd_pcm_substream *substream, ++ struct snd_pcm_hw_params *params) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ ++ // set codec DAI configuration ++ int ret = snd_soc_dai_set_fmt(rtd->codec_dai, ++ SND_SOC_DAIFMT_CBS_CFS|SND_SOC_DAIFMT_DSP_A| ++ SND_SOC_DAIFMT_NB_NF); ++ if (ret < 0) ++ return ret; ++ ++ // set cpu DAI configuration ++ ret = snd_soc_dai_set_fmt(rtd->cpu_dai, ++ SND_SOC_DAIFMT_CBM_CFM|SND_SOC_DAIFMT_I2S| ++ SND_SOC_DAIFMT_NB_NF); ++ if (ret < 0) ++ return ret; ++ ++ audioinjector_octo_rate = params_rate(params); ++ ++ return 0; ++} ++ ++static int audioinjector_octo_trigger(struct snd_pcm_substream *substream, ++ int cmd){ ++ int mult[4]; ++ mult[0] = 0; ++ mult[1] = 0; ++ mult[2] = 0; ++ mult[3] = 0; ++ ++ switch (cmd) { ++ case SNDRV_PCM_TRIGGER_START: ++ case SNDRV_PCM_TRIGGER_RESUME: ++ case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: ++ switch (audioinjector_octo_rate) { ++ case 192000: ++ mult[3] = 1; ++ case 176640: ++ mult[0] = 1; ++ mult[1] = 1; ++ mult[2] = 1; ++ break; ++ case 96000: ++ mult[3] = 1; ++ case 88200: ++ mult[1] = 1; ++ mult[2] = 1; ++ break; ++ case 64000: ++ mult[3] = 1; ++ case 58800: ++ mult[0] = 1; ++ mult[2] = 1; ++ break; ++ case 48000: ++ mult[3] = 1; ++ case 44100: ++ mult[2] = 1; ++ break; ++ case 32000: ++ mult[3] = 1; ++ case 29400: ++ mult[0] = 1; ++ mult[1] = 1; ++ break; ++ case 24000: ++ mult[3] = 1; ++ case 22050: ++ mult[1] = 1; ++ break; ++ case 16000: ++ mult[3] = 1; ++ case 14700: ++ mult[0] = 1; ++ break; ++ case 8000: ++ mult[3] = 1; ++ break; ++ default: ++ return -EINVAL; ++ } ++ break; ++ case SNDRV_PCM_TRIGGER_STOP: ++ case SNDRV_PCM_TRIGGER_SUSPEND: ++ case SNDRV_PCM_TRIGGER_PAUSE_PUSH: ++ break; ++ default: ++ return -EINVAL; ++ } ++ gpiod_set_array_value_cansleep(mult_gpios->ndescs, mult_gpios->desc, ++ mult); ++ ++ return 0; ++} ++ ++static struct snd_soc_ops audioinjector_octo_ops = { ++ .startup = audioinjector_octo_startup, ++ .shutdown = audioinjector_octo_shutdown, ++ .hw_params = audioinjector_octo_hw_params, ++ .trigger = audioinjector_octo_trigger, ++}; ++ ++static struct snd_soc_dai_link audioinjector_octo_dai[] = { ++ { ++ .name = "AudioInjector Octo", ++ .stream_name = "AudioInject-HIFI", ++ .codec_dai_name = "cs42448", ++ .ops = &audioinjector_octo_ops, ++ .init = audioinjector_octo_dai_init, ++ }, ++}; ++ ++static const struct snd_soc_dapm_widget audioinjector_octo_widgets[] = { ++ SND_SOC_DAPM_OUTPUT("OUTPUTS0"), ++ SND_SOC_DAPM_OUTPUT("OUTPUTS1"), ++ SND_SOC_DAPM_OUTPUT("OUTPUTS2"), ++ SND_SOC_DAPM_OUTPUT("OUTPUTS3"), ++ SND_SOC_DAPM_INPUT("INPUTS0"), ++ SND_SOC_DAPM_INPUT("INPUTS1"), ++ SND_SOC_DAPM_INPUT("INPUTS2"), ++}; ++ ++static const struct snd_soc_dapm_route audioinjector_octo_route[] = { ++ /* Balanced outputs */ ++ {"OUTPUTS0", NULL, "AOUT1L"}, ++ {"OUTPUTS0", NULL, "AOUT1R"}, ++ {"OUTPUTS1", NULL, "AOUT2L"}, ++ {"OUTPUTS1", NULL, "AOUT2R"}, ++ {"OUTPUTS2", NULL, "AOUT3L"}, ++ {"OUTPUTS2", NULL, "AOUT3R"}, ++ {"OUTPUTS3", NULL, "AOUT4L"}, ++ {"OUTPUTS3", NULL, "AOUT4R"}, ++ ++ /* Balanced inputs */ ++ {"AIN1L", NULL, "INPUTS0"}, ++ {"AIN1R", NULL, "INPUTS0"}, ++ {"AIN2L", NULL, "INPUTS1"}, ++ {"AIN2R", NULL, "INPUTS1"}, ++ {"AIN3L", NULL, "INPUTS2"}, ++ {"AIN3R", NULL, "INPUTS2"}, ++}; ++ ++static struct snd_soc_card snd_soc_audioinjector_octo = { ++ .name = "audioinjector-octo-soundcard", ++ .dai_link = audioinjector_octo_dai, ++ .num_links = ARRAY_SIZE(audioinjector_octo_dai), ++ ++ .dapm_widgets = audioinjector_octo_widgets, ++ .num_dapm_widgets = ARRAY_SIZE(audioinjector_octo_widgets), ++ .dapm_routes = audioinjector_octo_route, ++ .num_dapm_routes = ARRAY_SIZE(audioinjector_octo_route), ++}; ++ ++static int audioinjector_octo_probe(struct platform_device *pdev) ++{ ++ struct snd_soc_card *card = &snd_soc_audioinjector_octo; ++ int ret; ++ ++ card->dev = &pdev->dev; ++ ++ if (pdev->dev.of_node) { ++ struct snd_soc_dai_link *dai = &audioinjector_octo_dai[0]; ++ struct device_node *i2s_node = ++ of_parse_phandle(pdev->dev.of_node, ++ "i2s-controller", 0); ++ struct device_node *codec_node = ++ of_parse_phandle(pdev->dev.of_node, ++ "codec", 0); ++ ++ mult_gpios = devm_gpiod_get_array_optional(&pdev->dev, "mult", ++ GPIOD_OUT_LOW); ++ if (IS_ERR(mult_gpios)) ++ return PTR_ERR(mult_gpios); ++ ++ if (i2s_node && codec_node) { ++ dai->cpu_dai_name = NULL; ++ dai->cpu_of_node = i2s_node; ++ dai->platform_name = NULL; ++ dai->platform_of_node = i2s_node; ++ dai->codec_name = NULL; ++ dai->codec_of_node = codec_node; ++ } else ++ if (!dai->cpu_of_node) { ++ dev_err(&pdev->dev, ++ "i2s-controller missing or invalid in DT\n"); ++ return -EINVAL; ++ } else { ++ dev_err(&pdev->dev, ++ "Property 'codec' missing or invalid\n"); ++ return -EINVAL; ++ } ++ } ++ ++ ret = snd_soc_register_card(card); ++ if (ret != 0) ++ dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret); ++ return ret; ++} ++ ++static int audioinjector_octo_remove(struct platform_device *pdev) ++{ ++ struct snd_soc_card *card = platform_get_drvdata(pdev); ++ ++ return snd_soc_unregister_card(card); ++} ++ ++static const struct of_device_id audioinjector_octo_of_match[] = { ++ { .compatible = "ai,audioinjector-octo-soundcard", }, ++ {}, ++}; ++MODULE_DEVICE_TABLE(of, audioinjector_octo_of_match); ++ ++static struct platform_driver audioinjector_octo_driver = { ++ .driver = { ++ .name = "audioinjector-audio", ++ .owner = THIS_MODULE, ++ .of_match_table = audioinjector_octo_of_match, ++ }, ++ .probe = audioinjector_octo_probe, ++ .remove = audioinjector_octo_remove, ++}; ++ ++module_platform_driver(audioinjector_octo_driver); ++MODULE_AUTHOR("Matt Flax "); ++MODULE_DESCRIPTION("AudioInjector.net octo Soundcard"); ++MODULE_LICENSE("GPL v2"); ++MODULE_ALIAS("platform:audioinjector-octo-soundcard"); + +From b473b0188ccd8e6ef301295980b28f4293e95011 Mon Sep 17 00:00:00 2001 +From: Matt Flax +Date: Wed, 8 Mar 2017 21:13:24 +1100 +Subject: [PATCH 196/218] ASoC: bcm2835_i2s.c: relax the ch2 register setting + for 8 channels + +This patch allows ch2 registers to be set for 8 channels of audio. +--- + sound/soc/bcm/bcm2835-i2s.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/sound/soc/bcm/bcm2835-i2s.c b/sound/soc/bcm/bcm2835-i2s.c +index 6ba20498202ed36906b52096893a88867a79269f..c8dd065aea8414b47aa2ea4fc04168b5e29002ad 100644 +--- a/sound/soc/bcm/bcm2835-i2s.c ++++ b/sound/soc/bcm/bcm2835-i2s.c +@@ -239,6 +239,7 @@ static int bcm2835_i2s_hw_params(struct snd_pcm_substream *substream, + unsigned int ch1pos, ch2pos, mode, format; + uint32_t csreg; + ++ + /* + * If a stream is already enabled, + * the registers are already set properly. +@@ -312,6 +313,7 @@ static int bcm2835_i2s_hw_params(struct snd_pcm_substream *substream, + + switch (params_channels(params)) { + case 2: ++ case 8: + format = BCM2835_I2S_CH1(format) | BCM2835_I2S_CH2(format); + format |= BCM2835_I2S_CH1(BCM2835_I2S_CHPOS(ch1pos)); + format |= BCM2835_I2S_CH2(BCM2835_I2S_CHPOS(ch2pos)); + +From fc3ffd9c20046441b2e1fd8c1fec4a82320a3675 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Fri, 10 Mar 2017 14:43:15 +0000 +Subject: [PATCH 197/218] bcm2835-v4l2: Fix buffer overflow problem + +https://github.com/raspberrypi/linux/issues/1447 +port_parameter_get() failed to account for the header +(u32 id and u32 size) in the size before memcpying +the response into the response buffer, so overrunning +the provided buffer by 8 bytes. + +Account for those bytes, and also a belt-and-braces +check to ensure we never copy more than *value_size +bytes into value. + +Signed-off-by: Dave Stevenson +--- + drivers/media/platform/bcm2835/mmal-vchiq.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/drivers/media/platform/bcm2835/mmal-vchiq.c b/drivers/media/platform/bcm2835/mmal-vchiq.c +index 781322542d5a8295f3d7d5a3eaaf0cac29930c30..e4b243b33f58913f3d2952c97d2a2e3fbbbd0ae8 100644 +--- a/drivers/media/platform/bcm2835/mmal-vchiq.c ++++ b/drivers/media/platform/bcm2835/mmal-vchiq.c +@@ -1315,7 +1315,12 @@ static int port_parameter_get(struct vchiq_mmal_instance *instance, + } + + ret = -rmsg->u.port_parameter_get_reply.status; +- if (ret) { ++ /* port_parameter_get_reply.size includes the header, ++ * whilst *value_size doesn't. ++ */ ++ rmsg->u.port_parameter_get_reply.size -= (2 * sizeof(u32)); ++ ++ if (ret || rmsg->u.port_parameter_get_reply.size > *value_size) { + /* Copy only as much as we have space for + * but report true size of parameter + */ + +From 00c5b24eaf0de50b8773c228bd6f257eaf046c63 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 10 Feb 2017 17:57:08 -0800 +Subject: [PATCH 198/218] build/arm64: Add rules for .dtbo files for dts + overlays + +We now create overlays as .dtbo files. + +Signed-off-by: Khem Raj +--- + arch/arm64/Makefile | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile +index 3635b8662724569d3338ebb620d603c644fe38b7..822fefeb1cd0aa2dc8398f885cf28e9bfd5a2637 100644 +--- a/arch/arm64/Makefile ++++ b/arch/arm64/Makefile +@@ -113,6 +113,9 @@ zinstall install: + %.dtb: scripts + $(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@ + ++%.dtbo: | scripts ++ $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@ ++ + PHONY += dtbs dtbs_install + + dtbs: prepare scripts + +From 7adee42b6c209dcbcc23ad7ade54aabfd230b5d0 Mon Sep 17 00:00:00 2001 +From: John Greb +Date: Wed, 8 Mar 2017 15:12:29 +0000 +Subject: [PATCH 199/218] Match dwc2 device-tree fifo sizes to the hardware + values. + +Since commit aa381a7259c3f53727bcaa8c5f9359e940a0e3fd was reverted with 3fa9538539ac737096c81f3315a14670b1609092 the g-tx-fifo-size array in the device-tree needs to match the preset values in the bcm2835. + +Resolves https://github.com/raspberrypi/linux/issues/1876 +--- + arch/arm/boot/dts/overlays/dwc2-overlay.dts | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/arch/arm/boot/dts/overlays/dwc2-overlay.dts b/arch/arm/boot/dts/overlays/dwc2-overlay.dts +index 527abc9f0ddf71f4dc7d58336d87684c931cc2f3..265a16bab008453edba198cf2366c423509d60d6 100644 +--- a/arch/arm/boot/dts/overlays/dwc2-overlay.dts ++++ b/arch/arm/boot/dts/overlays/dwc2-overlay.dts +@@ -15,7 +15,7 @@ + dr_mode = "otg"; + g-np-tx-fifo-size = <32>; + g-rx-fifo-size = <256>; +- g-tx-fifo-size = <256 128 128 64 64 64 32>; ++ g-tx-fifo-size = <512 512 512 512 512 768>; + status = "okay"; + }; + }; +@@ -24,6 +24,5 @@ + dr_mode = <&dwc2_usb>, "dr_mode"; + g-np-tx-fifo-size = <&dwc2_usb>,"g-np-tx-fifo-size:0"; + g-rx-fifo-size = <&dwc2_usb>,"g-rx-fifo-size:0"; +- g-tx-fifo-size = <&dwc2_usb>,"g-tx-fifo-size:0"; + }; + }; + +From de86d38d29608e26b8c69636afe9ff1e9983aa77 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sun, 5 Mar 2017 11:46:41 +0000 +Subject: [PATCH 200/218] config: Add RTL8XXXU wifi module + +--- + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 802ba0f149c571c215e556711367298d80409d71..5f5f19f0e277e3f5e7bf12eedb2d42cb7220ae39 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -543,6 +543,7 @@ CONFIG_RT2800USB_RT55XX=y + CONFIG_RT2800USB_UNKNOWN=y + CONFIG_RTL8187=m + CONFIG_RTL8192CU=m ++CONFIG_RTL8XXXU=m + CONFIG_USB_ZD1201=m + CONFIG_ZD1211RW=m + CONFIG_MAC80211_HWSIM=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index bf52db66afb2aa18d6f6f9fb9b64dcbd97e24521..4bc0f8b52b7f39f99d650cb9c4cdfdba6fac59dd 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -539,6 +539,7 @@ CONFIG_RT2800USB_RT55XX=y + CONFIG_RT2800USB_UNKNOWN=y + CONFIG_RTL8187=m + CONFIG_RTL8192CU=m ++CONFIG_RTL8XXXU=m + CONFIG_USB_ZD1201=m + CONFIG_ZD1211RW=m + CONFIG_MAC80211_HWSIM=m + +From f3435e811e4cf3977192be51d694c5016fdd0372 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Tue, 7 Mar 2017 12:18:20 +0000 +Subject: [PATCH 201/218] BCM270X_DT: Invert Pi3 power LED to match fw change + +Firmware expgpio driver reworked due to complaint over +hotplug detect. +Requires power LED to change sense as firmware is no longer +inverting the read value. + +Signed-off-by: Dave Stevenson +--- + arch/arm/boot/dts/bcm2710-rpi-3-b.dts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm/boot/dts/bcm2710-rpi-3-b.dts b/arch/arm/boot/dts/bcm2710-rpi-3-b.dts +index 173103aaca503833b5e29530ed94e14c7cab0444..b21d2866d204adc533b46d581028f290e5c34a3d 100644 +--- a/arch/arm/boot/dts/bcm2710-rpi-3-b.dts ++++ b/arch/arm/boot/dts/bcm2710-rpi-3-b.dts +@@ -175,7 +175,7 @@ + pwr_led: pwr { + label = "led1"; + linux,default-trigger = "input"; +- gpios = <&expgpio 7 GPIO_ACTIVE_LOW>; ++ gpios = <&expgpio 7 0>; + }; + }; + + +From 622b1eb96dc5719ad7562e565311d8a68d229315 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 14 Mar 2017 09:10:05 +0000 +Subject: [PATCH 202/218] BCM270X_DT: Add lm75 to i2c-sensor overlay + +See: https://www.raspberrypi.org/forums/viewtopic.php?f=107&t=177236 + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/overlays/README | 8 +++++--- + arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts | 8 ++++++++ + 2 files changed, 13 insertions(+), 3 deletions(-) + +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index c1883bba938290f03826026651c764cfd4ac278b..a8853b7820cd7a333cdaa2421f770a834dc724d5 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -388,9 +388,6 @@ Params: dr_mode Dual role mode: "host", "peripheral" or "otg" + g-np-tx-fifo-size Size of non-periodic tx fifo size in gadget + mode + +- g-tx-fifo-size Size of periodic tx fifo per endpoint +- (except ep0) in gadget mode +- + + [ The ds1307-rtc overlay has been deleted. See i2c-rtc. ] + +@@ -608,6 +605,11 @@ Params: bmp085 Select the Bosch sensortronic BMP085 + + bmp280 Select the Bosch sensortronic BMP280 + ++ lm75 Select the Maxim LM75 temperature sensor ++ ++ lm75addr Choose the address for the LM75 (0x48-0x4f - ++ default 0x4f) ++ + si7020 Select the Silicon Labs Si7013/20/21 humidity/ + temperature sensor + +diff --git a/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts b/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts +index 31bda8da4cb6a56bfe493a81b918900995fb0589..606b2d5012abf2e85712be631c42ea40a0b512c5 100644 +--- a/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts ++++ b/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts +@@ -25,6 +25,12 @@ + status = "disable"; + }; + ++ lm75: lm75@4f { ++ compatible = "lm75"; ++ reg = <0x4f>; ++ status = "disable"; ++ }; ++ + si7020: si7020@40 { + compatible = "si7020"; + reg = <0x40>; +@@ -36,6 +42,8 @@ + __overrides__ { + bmp085 = <&bmp085>,"status"; + bmp280 = <&bmp280>,"status"; ++ lm75 = <&lm75>,"status"; ++ lm75addr = <&lm75>,"reg:0"; + si7020 = <&si7020>,"status"; + }; + }; + +From 9be8413c7b7975dcb27a5ce2aff72bb538b06d59 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Tue, 14 Mar 2017 14:23:06 +0000 +Subject: [PATCH 203/218] bcm2835-gpio-exp: Copy/paste error adding base twice + +brcmexp_gpio_set was adding gpio->gc.base to the offset +twice, so passing an invalid number to the mailbox service. +The firmware treated it modulo-8 anyway, but was logging an +assert every time. + +Signed-off-by: Dave Stevenson +--- + drivers/gpio/gpio-bcm-exp.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/drivers/gpio/gpio-bcm-exp.c b/drivers/gpio/gpio-bcm-exp.c +index 681a91492d4c33bdfd42416e069218e8611cc4d9..d68adafaee4ad406f45f4ff0d6b7c1ad5d10e330 100644 +--- a/drivers/gpio/gpio-bcm-exp.c ++++ b/drivers/gpio/gpio-bcm-exp.c +@@ -165,8 +165,6 @@ static void brcmexp_gpio_set(struct gpio_chip *gc, unsigned int off, int val) + + gpio = container_of(gc, struct brcmexp_gpio, gc); + +- off += gpio->gc.base; +- + set.gpio = off + gpio->gc.base; /* GPIO to update */ + set.state = val; /* Output state */ + + +From 9d7aa31a59af07d150cc733fbc29be367f97d93c Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Wed, 15 Mar 2017 11:12:40 +0000 +Subject: [PATCH 204/218] bcm2835-camera: Correct port_parameter_get return + value + +The API for port_parameter_get() requires that the +filled length is returned, or if insufficient space +that the required space is returned. + +Signed-off-by: Dave Stevenson +--- + drivers/media/platform/bcm2835/mmal-vchiq.c | 17 ++++++++++++----- + 1 file changed, 12 insertions(+), 5 deletions(-) + +diff --git a/drivers/media/platform/bcm2835/mmal-vchiq.c b/drivers/media/platform/bcm2835/mmal-vchiq.c +index e4b243b33f58913f3d2952c97d2a2e3fbbbd0ae8..ec2853ba9d4b1b0cd6e07a495a424e15159208e8 100644 +--- a/drivers/media/platform/bcm2835/mmal-vchiq.c ++++ b/drivers/media/platform/bcm2835/mmal-vchiq.c +@@ -1292,6 +1292,7 @@ static int port_parameter_get(struct vchiq_mmal_instance *instance, + struct mmal_msg m; + struct mmal_msg *rmsg; + VCHI_HELD_MSG_T rmsg_handle; ++ u32 reply_size; + + m.h.type = MMAL_MSG_TYPE_PORT_PARAMETER_GET; + +@@ -1315,21 +1316,27 @@ static int port_parameter_get(struct vchiq_mmal_instance *instance, + } + + ret = -rmsg->u.port_parameter_get_reply.status; +- /* port_parameter_get_reply.size includes the header, ++ /* ++ * port_parameter_get_reply.size includes the header, + * whilst *value_size doesn't. + */ +- rmsg->u.port_parameter_get_reply.size -= (2 * sizeof(u32)); ++ reply_size = rmsg->u.port_parameter_get_reply.size - (2 * sizeof(u32)); + +- if (ret || rmsg->u.port_parameter_get_reply.size > *value_size) { ++ if (ret || (reply_size > *value_size)) { + /* Copy only as much as we have space for + * but report true size of parameter + */ + memcpy(value, &rmsg->u.port_parameter_get_reply.value, + *value_size); +- *value_size = rmsg->u.port_parameter_get_reply.size; + } else + memcpy(value, &rmsg->u.port_parameter_get_reply.value, +- rmsg->u.port_parameter_get_reply.size); ++ reply_size); ++ ++ /* ++ * Return amount of data copied if big enough, ++ * or wanted if not big enough. ++ */ ++ *value_size = reply_size; + + pr_debug("%s:result:%d component:0x%x port:%d parameter:%d\n", __func__, + ret, port->component->handle, port->handle, parameter_id); + +From 3fe69a591172fbc6dd340267c4d82a8ec55c7976 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 17 Mar 2017 12:24:41 +0000 +Subject: [PATCH 205/218] config: Make spidev a loadable module + +spidev isn't required early in the boot process, and not all users +need it (spi_bcm2835 is a module), so make it a loadable module. + +See: https://github.com/raspberrypi/linux/issues/1897 + +Signed-off-by: Phil Elwell +--- + arch/arm/configs/bcm2709_defconfig | 3 +-- + arch/arm/configs/bcmrpi_defconfig | 3 +-- + 2 files changed, 2 insertions(+), 4 deletions(-) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 5f5f19f0e277e3f5e7bf12eedb2d42cb7220ae39..598b4bf29f30a920b79b6451ded7a56d06033d7d 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -621,7 +621,7 @@ CONFIG_I2C_GPIO=m + CONFIG_SPI=y + CONFIG_SPI_BCM2835=m + CONFIG_SPI_BCM2835AUX=m +-CONFIG_SPI_SPIDEV=y ++CONFIG_SPI_SPIDEV=m + CONFIG_PPS=m + CONFIG_PPS_CLIENT_LDISC=m + CONFIG_PPS_CLIENT_GPIO=m +@@ -899,7 +899,6 @@ CONFIG_SND_PISOUND=m + CONFIG_SND_SOC_ADAU1701=m + CONFIG_SND_SOC_ADAU7002=m + CONFIG_SND_SOC_AK4554=m +-CONFIG_SND_SOC_CS42XX8_I2C=m + CONFIG_SND_SOC_WM8804_I2C=m + CONFIG_SND_SIMPLE_CARD=m + CONFIG_SOUND_PRIME=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 4bc0f8b52b7f39f99d650cb9c4cdfdba6fac59dd..8d64ce4465f6f276b2d58ed1e2e45fb0d69ef3ad 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -616,7 +616,7 @@ CONFIG_I2C_GPIO=m + CONFIG_SPI=y + CONFIG_SPI_BCM2835=m + CONFIG_SPI_BCM2835AUX=m +-CONFIG_SPI_SPIDEV=y ++CONFIG_SPI_SPIDEV=m + CONFIG_PPS=m + CONFIG_PPS_CLIENT_LDISC=m + CONFIG_PPS_CLIENT_GPIO=m +@@ -892,7 +892,6 @@ CONFIG_SND_PISOUND=m + CONFIG_SND_SOC_ADAU1701=m + CONFIG_SND_SOC_ADAU7002=m + CONFIG_SND_SOC_AK4554=m +-CONFIG_SND_SOC_CS42XX8_I2C=m + CONFIG_SND_SOC_WM8804_I2C=m + CONFIG_SND_SIMPLE_CARD=m + CONFIG_SOUND_PRIME=m + +From feb3e1ccb66923da95ed9986338109079c4356e8 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Thu, 23 Mar 2017 10:06:56 +0000 +Subject: [PATCH 206/218] ASoC: Add prompt for ICS43432 codec + +Without a prompt string, a config setting can't be included in a +defconfig. Give CONFIG_SND_SOC_ICS43432 a prompt so that Pi soundcards +can use the driver. + +Signed-off-by: Phil Elwell +--- + sound/soc/codecs/Kconfig | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig +index 9824cdd04b0c11c45b8cedd0187a0eba8f1dc2d4..c0b88d43df0de283c58ed6158680bc7e3da0e608 100644 +--- a/sound/soc/codecs/Kconfig ++++ b/sound/soc/codecs/Kconfig +@@ -535,7 +535,7 @@ config SND_SOC_HDAC_HDMI + select HDMI + + config SND_SOC_ICS43432 +- tristate ++ tristate "InvenSense ICS43432 I2S microphone codec" + + config SND_SOC_INNO_RK3036 + tristate "Inno codec driver for RK3036 SoC" + +From 48a6797639e52ccdf237b405f53ae6a372ea98fa Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Thu, 23 Mar 2017 16:34:46 +0000 +Subject: [PATCH 207/218] bcm2835-aux: Add aux interrupt controller + +The AUX block has a shared interrupt line with a register indicating +which devices have active IRQs. Expose this as a nested interrupt +controller to avoid sharing problems. + +See: https://github.com/raspberrypi/linux/issues/1484 + https://github.com/raspberrypi/linux/issues/1573 + +Signed-off-by: Phil Elwell +--- + drivers/clk/bcm/clk-bcm2835-aux.c | 120 ++++++++++++++++++++++++++++++++++++++ + 1 file changed, 120 insertions(+) + +diff --git a/drivers/clk/bcm/clk-bcm2835-aux.c b/drivers/clk/bcm/clk-bcm2835-aux.c +index bd750cf2238d61489811e7d7bd3b5f9950ed53c8..41e0702fae4692221980b0d02aed1ba652945650 100644 +--- a/drivers/clk/bcm/clk-bcm2835-aux.c ++++ b/drivers/clk/bcm/clk-bcm2835-aux.c +@@ -17,17 +17,107 @@ + #include + #include + #include ++#include ++#include ++#include + #include + + #define BCM2835_AUXIRQ 0x00 + #define BCM2835_AUXENB 0x04 + ++#define BCM2835_AUXIRQ_NUM_IRQS 3 ++ ++#define BCM2835_AUXIRQ_UART_IRQ 0 ++#define BCM2835_AUXIRQ_SPI1_IRQ 1 ++#define BCM2835_AUXIRQ_SPI2_IRQ 2 ++ ++#define BCM2835_AUXIRQ_UART_MASK 0x01 ++#define BCM2835_AUXIRQ_SPI1_MASK 0x02 ++#define BCM2835_AUXIRQ_SPI2_MASK 0x04 ++ ++#define BCM2835_AUXIRQ_ALL_MASK \ ++ (BCM2835_AUXIRQ_UART_MASK | \ ++ BCM2835_AUXIRQ_SPI1_MASK | \ ++ BCM2835_AUXIRQ_SPI2_MASK) ++ ++struct auxirq_state { ++ void __iomem *status; ++ u32 enables; ++ struct irq_domain *domain; ++ struct regmap *local_regmap; ++}; ++ ++static struct auxirq_state auxirq __read_mostly; ++ ++static irqreturn_t bcm2835_auxirq_handler(int irq, void *dev_id) ++{ ++ u32 stat = readl_relaxed(auxirq.status); ++ u32 masked = stat & auxirq.enables; ++ ++ if (masked & BCM2835_AUXIRQ_UART_MASK) ++ generic_handle_irq(irq_linear_revmap(auxirq.domain, ++ BCM2835_AUXIRQ_UART_IRQ)); ++ ++ if (masked & BCM2835_AUXIRQ_SPI1_MASK) ++ generic_handle_irq(irq_linear_revmap(auxirq.domain, ++ BCM2835_AUXIRQ_SPI1_IRQ)); ++ ++ if (masked & BCM2835_AUXIRQ_SPI2_MASK) ++ generic_handle_irq(irq_linear_revmap(auxirq.domain, ++ BCM2835_AUXIRQ_SPI2_IRQ)); ++ ++ return (masked & BCM2835_AUXIRQ_ALL_MASK) ? IRQ_HANDLED : IRQ_NONE; ++} ++ ++static int bcm2835_auxirq_xlate(struct irq_domain *d, ++ struct device_node *ctrlr, ++ const u32 *intspec, unsigned int intsize, ++ unsigned long *out_hwirq, ++ unsigned int *out_type) ++{ ++ if (WARN_ON(intsize != 1)) ++ return -EINVAL; ++ ++ if (WARN_ON(intspec[0] >= BCM2835_AUXIRQ_NUM_IRQS)) ++ return -EINVAL; ++ ++ *out_hwirq = intspec[0]; ++ *out_type = IRQ_TYPE_NONE; ++ return 0; ++} ++ ++static void bcm2835_auxirq_mask(struct irq_data *data) ++{ ++ irq_hw_number_t hwirq = irqd_to_hwirq(data); ++ ++ auxirq.enables &= ~(1 << hwirq); ++} ++ ++static void bcm2835_auxirq_unmask(struct irq_data *data) ++{ ++ irq_hw_number_t hwirq = irqd_to_hwirq(data); ++ ++ auxirq.enables |= (1 << hwirq); ++} ++ ++static struct irq_chip bcm2835_auxirq_chip = { ++ .name = "bcm2835-auxirq", ++ .irq_mask = bcm2835_auxirq_mask, ++ .irq_unmask = bcm2835_auxirq_unmask, ++}; ++ ++static const struct irq_domain_ops bcm2835_auxirq_ops = { ++ .xlate = bcm2835_auxirq_xlate//irq_domain_xlate_onecell ++}; ++ + static int bcm2835_aux_clk_probe(struct platform_device *pdev) + { + struct device *dev = &pdev->dev; ++ struct device_node *node = dev->of_node; + struct clk_hw_onecell_data *onecell; + const char *parent; + struct clk *parent_clk; ++ int parent_irq; + struct resource *res; + void __iomem *reg, *gate; + +@@ -41,6 +131,36 @@ static int bcm2835_aux_clk_probe(struct platform_device *pdev) + if (IS_ERR(reg)) + return PTR_ERR(reg); + ++ parent_irq = irq_of_parse_and_map(node, 0); ++ if (parent_irq) { ++ int ret; ++ int i; ++ ++ /* Manage the AUX irq as well */ ++ auxirq.status = reg + BCM2835_AUXIRQ; ++ auxirq.domain = irq_domain_add_linear(node, ++ BCM2835_AUXIRQ_NUM_IRQS, ++ &bcm2835_auxirq_ops, ++ NULL); ++ if (!auxirq.domain) ++ return -ENXIO; ++ ++ for (i = 0; i < BCM2835_AUXIRQ_NUM_IRQS; i++) { ++ unsigned int irq = irq_create_mapping(auxirq.domain, i); ++ ++ if (irq == 0) ++ return -ENXIO; ++ ++ irq_set_chip_and_handler(irq, &bcm2835_auxirq_chip, ++ handle_level_irq); ++ } ++ ++ ret = devm_request_irq(dev, parent_irq, bcm2835_auxirq_handler, ++ 0, "bcm2835-auxirq", NULL); ++ if (ret) ++ return ret; ++ } ++ + onecell = devm_kmalloc(dev, sizeof(*onecell) + sizeof(*onecell->hws) * + BCM2835_AUX_CLOCK_COUNT, GFP_KERNEL); + if (!onecell) + +From bfb106980fb14b160f1691a669182511b412d017 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Thu, 23 Mar 2017 17:08:44 +0000 +Subject: [PATCH 208/218] BCM270X_DT: Enable AUX interrupt controller in DT + +See: https://github.com/raspberrypi/linux/issues/1484 + https://github.com/raspberrypi/linux/issues/1573 + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/bcm283x.dtsi | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/arch/arm/boot/dts/bcm283x.dtsi b/arch/arm/boot/dts/bcm283x.dtsi +index d3cc586661f903e67a840189c0446aa80e16a44e..348c71bbc913644c04bab43fcb95abe9b6c9c640 100644 +--- a/arch/arm/boot/dts/bcm283x.dtsi ++++ b/arch/arm/boot/dts/bcm283x.dtsi +@@ -216,12 +216,16 @@ + #clock-cells = <1>; + reg = <0x7e215000 0x8>; + clocks = <&clocks BCM2835_CLOCK_VPU>; ++ interrupts = <1 29>; ++ interrupt-controller; ++ #interrupt-cells = <1>; + }; + + uart1: serial@7e215040 { + compatible = "brcm,bcm2835-aux-uart"; + reg = <0x7e215040 0x40>; +- interrupts = <1 29>; ++ interrupt-parent = <&aux>; ++ interrupts = <0>; + clocks = <&aux BCM2835_AUX_CLOCK_UART>; + status = "disabled"; + }; +@@ -229,7 +233,8 @@ + spi1: spi@7e215080 { + compatible = "brcm,bcm2835-aux-spi"; + reg = <0x7e215080 0x40>; +- interrupts = <1 29>; ++ interrupt-parent = <&aux>; ++ interrupts = <1>; + clocks = <&aux BCM2835_AUX_CLOCK_SPI1>; + #address-cells = <1>; + #size-cells = <0>; +@@ -239,7 +244,8 @@ + spi2: spi@7e2150c0 { + compatible = "brcm,bcm2835-aux-spi"; + reg = <0x7e2150c0 0x40>; +- interrupts = <1 29>; ++ interrupt-parent = <&aux>; ++ interrupts = <2>; + clocks = <&aux BCM2835_AUX_CLOCK_SPI2>; + #address-cells = <1>; + #size-cells = <0>; + +From 2c8658ecfda835d4581015b450e12815a0c82375 Mon Sep 17 00:00:00 2001 +From: Matt Flax +Date: Mon, 27 Mar 2017 22:26:49 +1100 +Subject: [PATCH 209/218] Audioinjector addons dts : add reset and regulators + for the Octo product. + +This patch adds a reset GPIO for the AudioInjector.net octo sound card. +This patch adds missing regulators for the cs42448 codec. +--- + .../dts/overlays/audioinjector-addons-overlay.dts | 27 +++++++++++++++++++++- + 1 file changed, 26 insertions(+), 1 deletion(-) + +diff --git a/arch/arm/boot/dts/overlays/audioinjector-addons-overlay.dts b/arch/arm/boot/dts/overlays/audioinjector-addons-overlay.dts +index dbf2f3cacc2e6bf5b7116fbadd97f2781580a79c..a36fa85a61f7eaab35ca481ed1dac621e2342e6d 100644 +--- a/arch/arm/boot/dts/overlays/audioinjector-addons-overlay.dts ++++ b/arch/arm/boot/dts/overlays/audioinjector-addons-overlay.dts +@@ -13,6 +13,26 @@ + }; + + fragment@1 { ++ target = <&soc>; ++ __overlay__ { ++ reg_digital: reg_digital@0 { ++ compatible = "regulator-fixed"; ++ regulator-name = "cs42448_dig_supply"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-always-on; ++ }; ++ reg_analogue: reg_analogue@0 { ++ compatible = "regulator-fixed"; ++ regulator-name = "cs42448_ana_supply"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ regulator-always-on; ++ }; ++ }; ++ }; ++ ++ fragment@2 { + target = <&i2c1>; + __overlay__ { + #address-cells = <1>; +@@ -25,6 +45,10 @@ + reg = <0x48>; + clocks = <&cs42448_mclk>; + clock-names = "mclk"; ++ VA-supply = <®_analogue>; ++ VD-supply = <®_digital>; ++ VLS-supply = <®_digital>; ++ VLC-supply = <®_digital>; + status = "okay"; + }; + +@@ -36,12 +60,13 @@ + }; + }; + +- fragment@2 { ++ fragment@3 { + target = <&sound>; + __overlay__ { + compatible = "ai,audioinjector-octo-soundcard"; + mult-gpios = <&gpio 27 0>, <&gpio 22 0>, <&gpio 23 0>, + <&gpio 24 0>; ++ reset-gpios = <&gpio 5 0>; + i2s-controller = <&i2s>; + codec = <&cs42448>; + status = "okay"; + +From 4afa6049340f289a62810d5a231d615017e211f1 Mon Sep 17 00:00:00 2001 +From: Matt Flax +Date: Mon, 27 Mar 2017 22:27:26 +1100 +Subject: [PATCH 210/218] AudioInjector Octo : Consolidate sample rates and add + a codec reset. + +This patch consolidates the sample rates which the audioinjector.net octo +sound card can use. The consolidation of sample rates are due to the +capabilities of the cs42448 codec. + +This codec also requires a hard reset using the GPIO pin 5 upon probe. +--- + sound/soc/bcm/audioinjector-octo-soundcard.c | 75 ++++++++++++++++------------ + 1 file changed, 42 insertions(+), 33 deletions(-) + +diff --git a/sound/soc/bcm/audioinjector-octo-soundcard.c b/sound/soc/bcm/audioinjector-octo-soundcard.c +index 9effea725798640887755dfa688da45338718afc..1198c36c4563b8673e5d386d1dfa92d43689e297 100644 +--- a/sound/soc/bcm/audioinjector-octo-soundcard.c ++++ b/sound/soc/bcm/audioinjector-octo-soundcard.c +@@ -27,8 +27,18 @@ + #include + + static struct gpio_descs *mult_gpios; ++static struct gpio_desc *codec_rst_gpio; + static unsigned int audioinjector_octo_rate; + ++static const unsigned int audioinjector_octo_rates[] = { ++ 96000, 48000, 88200, 44100, ++}; ++ ++static struct snd_pcm_hw_constraint_list audioinjector_octo_constraints = { ++ .list = audioinjector_octo_rates, ++ .count = ARRAY_SIZE(audioinjector_octo_rates), ++}; ++ + static int audioinjector_octo_dai_init(struct snd_soc_pcm_runtime *rtd) + { + return snd_soc_dai_set_bclk_ratio(rtd->cpu_dai, 64); +@@ -42,6 +52,11 @@ static int audioinjector_octo_startup(struct snd_pcm_substream *substream) + rtd->cpu_dai->driver->capture.channels_min = 8; + rtd->cpu_dai->driver->capture.channels_max = 8; + rtd->codec_dai->driver->capture.channels_max = 8; ++ ++ snd_pcm_hw_constraint_list(substream->runtime, 0, ++ SNDRV_PCM_HW_PARAM_RATE, ++ &audioinjector_octo_constraints); ++ + return 0; + } + +@@ -76,7 +91,21 @@ static int audioinjector_octo_hw_params(struct snd_pcm_substream *substream, + + audioinjector_octo_rate = params_rate(params); + +- return 0; ++ // Set the correct sysclock for the codec ++ switch (audioinjector_octo_rate) { ++ case 96000: ++ case 48000: ++ return snd_soc_dai_set_sysclk(rtd->codec_dai, 0, 49152000, ++ 0); ++ break; ++ case 88200: ++ case 44100: ++ return snd_soc_dai_set_sysclk(rtd->codec_dai, 0, 45185400, ++ 0); ++ break; ++ default: ++ return -EINVAL; ++ } + } + + static int audioinjector_octo_trigger(struct snd_pcm_substream *substream, +@@ -92,49 +121,17 @@ static int audioinjector_octo_trigger(struct snd_pcm_substream *substream, + case SNDRV_PCM_TRIGGER_RESUME: + case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: + switch (audioinjector_octo_rate) { +- case 192000: +- mult[3] = 1; +- case 176640: +- mult[0] = 1; +- mult[1] = 1; +- mult[2] = 1; +- break; + case 96000: + mult[3] = 1; + case 88200: + mult[1] = 1; + mult[2] = 1; + break; +- case 64000: +- mult[3] = 1; +- case 58800: +- mult[0] = 1; +- mult[2] = 1; +- break; + case 48000: + mult[3] = 1; + case 44100: + mult[2] = 1; + break; +- case 32000: +- mult[3] = 1; +- case 29400: +- mult[0] = 1; +- mult[1] = 1; +- break; +- case 24000: +- mult[3] = 1; +- case 22050: +- mult[1] = 1; +- break; +- case 16000: +- mult[3] = 1; +- case 14700: +- mult[0] = 1; +- break; +- case 8000: +- mult[3] = 1; +- break; + default: + return -EINVAL; + } +@@ -231,6 +228,18 @@ static int audioinjector_octo_probe(struct platform_device *pdev) + if (IS_ERR(mult_gpios)) + return PTR_ERR(mult_gpios); + ++ codec_rst_gpio = devm_gpiod_get_optional(&pdev->dev, "reset", ++ GPIOD_OUT_LOW); ++ if (IS_ERR(codec_rst_gpio)) ++ return PTR_ERR(codec_rst_gpio); ++ ++ if (codec_rst_gpio) ++ gpiod_set_value(codec_rst_gpio, 0); ++ msleep(5); ++ if (codec_rst_gpio) ++ gpiod_set_value(codec_rst_gpio, 1); ++ msleep(50); ++ + if (i2s_node && codec_node) { + dai->cpu_dai_name = NULL; + dai->cpu_of_node = i2s_node; + +From dc8d7fe750d33056e1a0612b2fb903d02edc461b Mon Sep 17 00:00:00 2001 +From: Peter Malkin +Date: Mon, 27 Mar 2017 16:38:21 -0700 +Subject: [PATCH 211/218] Driver support for Google voiceHAT soundcard. + +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 6 + + .../overlays/googlevoicehat-soundcard-overlay.dts | 49 +++++ + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + sound/soc/bcm/Kconfig | 7 + + sound/soc/bcm/Makefile | 6 + + sound/soc/bcm/googlevoicehat-codec.c | 199 +++++++++++++++++++++ + sound/soc/bcm/googlevoicehat-soundcard.c | 124 +++++++++++++ + 9 files changed, 394 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/googlevoicehat-soundcard-overlay.dts + create mode 100644 sound/soc/bcm/googlevoicehat-codec.c + create mode 100644 sound/soc/bcm/googlevoicehat-soundcard.c + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index 0f7340799fb465ba1fb5aaa1e970cbf6295d75c4..2f1cd17697606687fe47cb4e6a25a572611bf241 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -23,6 +23,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + enc28j60.dtbo \ + enc28j60-spi2.dtbo \ + fe-pi-audio.dtbo \ ++ googlevoicehat-soundcard.dtbo \ + gpio-ir.dtbo \ + gpio-poweroff.dtbo \ + hifiberry-amp.dtbo \ +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index a8853b7820cd7a333cdaa2421f770a834dc724d5..6870e83a2e6acf842259a769d483b0b98c172279 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -414,6 +414,12 @@ Load: dtoverlay=fe-pi-audio + Params: + + ++Name: googlevoicehat-soundcard ++Info: Configures the Google voiceHAT soundcard ++Load: dtoverlay=googlevoicehat-soundcard ++Params: ++ ++ + Name: gpio-ir + Info: Use GPIO pin as rc-core style infrared receiver input. The rc-core- + based gpio_ir_recv driver maps received keys directly to a +diff --git a/arch/arm/boot/dts/overlays/googlevoicehat-soundcard-overlay.dts b/arch/arm/boot/dts/overlays/googlevoicehat-soundcard-overlay.dts +new file mode 100644 +index 0000000000000000000000000000000000000000..9a9e9a0ca28cf774a868b2882ae57b00de1cf7b7 +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/googlevoicehat-soundcard-overlay.dts +@@ -0,0 +1,49 @@ ++// Definitions for Google voiceHAT v1 soundcard overlay ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target = <&i2s>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&gpio>; ++ __overlay__ { ++ googlevoicehat_pins: googlevoicehat_pins { ++ brcm,pins = <16>; ++ brcm,function = <1>; /* out */ ++ brcm,pull = <0>; /* up */ ++ }; ++ }; ++ }; ++ ++ ++ fragment@2 { ++ target-path = "/"; ++ __overlay__ { ++ voicehat-codec { ++ #sound-dai-cells = <0>; ++ compatible = "google,voicehat"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&googlevoicehat_pins>; ++ sdmode-gpios= <&gpio 16 0>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ fragment@3 { ++ target = <&sound>; ++ __overlay__ { ++ compatible = "googlevoicehat,googlevoicehat-soundcard"; ++ i2s-controller = <&i2s>; ++ status = "okay"; ++ }; ++ }; ++}; +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 598b4bf29f30a920b79b6451ded7a56d06033d7d..38c52eb831715ec6c2ce3555c7a4d9e5383e35d5 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -888,6 +888,7 @@ CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m + CONFIG_SND_BCM2708_SOC_IQAUDIO_DIGI=m + CONFIG_SND_BCM2708_SOC_RASPIDAC3=m + CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m ++CONFIG_SND_BCM2708_SOC_GOOGLEVOICEHAT_SOUNDCARD=m + CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m + CONFIG_SND_AUDIOINJECTOR_OCTO_SOUNDCARD=m + CONFIG_SND_DIGIDAC1_SOUNDCARD=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 8d64ce4465f6f276b2d58ed1e2e45fb0d69ef3ad..c46b86dda8ade97cfa5589106e77d75e241147e0 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -881,6 +881,7 @@ CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m + CONFIG_SND_BCM2708_SOC_IQAUDIO_DIGI=m + CONFIG_SND_BCM2708_SOC_RASPIDAC3=m + CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m ++CONFIG_SND_BCM2708_SOC_GOOGLEVOICEHAT_SOUNDCARD=m + CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m + CONFIG_SND_AUDIOINJECTOR_OCTO_SOUNDCARD=m + CONFIG_SND_DIGIDAC1_SOUNDCARD=m +diff --git a/sound/soc/bcm/Kconfig b/sound/soc/bcm/Kconfig +index 58d03b97f53363ed18df8fb10b4b3477a59e4ca3..e4a47fa404d3fe7c8c0713e2512ee3092492e605 100644 +--- a/sound/soc/bcm/Kconfig ++++ b/sound/soc/bcm/Kconfig +@@ -17,6 +17,13 @@ config SND_SOC_CYGNUS + + If you don't know what to do here, say N. + ++config SND_BCM2708_SOC_GOOGLEVOICEHAT_SOUNDCARD ++ tristate "Support for Google voiceHAT soundcard" ++ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S ++ select SND_SOC_VOICEHAT ++ help ++ Say Y or M if you want to add support for voiceHAT soundcard. ++ + config SND_BCM2708_SOC_HIFIBERRY_DAC + tristate "Support for HifiBerry DAC" + depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S +diff --git a/sound/soc/bcm/Makefile b/sound/soc/bcm/Makefile +index d448aa517bf994fc0a41580c91b5d87deec9e1b0..e37457f01b263ba47ad884c7e945d33b001d9c66 100644 +--- a/sound/soc/bcm/Makefile ++++ b/sound/soc/bcm/Makefile +@@ -8,8 +8,12 @@ snd-soc-cygnus-objs := cygnus-pcm.o cygnus-ssp.o + + obj-$(CONFIG_SND_SOC_CYGNUS) += snd-soc-cygnus.o + ++# Google voiceHAT custom codec support ++snd-soc-googlevoicehat-codec-objs := googlevoicehat-codec.o ++ + # BCM2708 Machine Support + snd-soc-adau1977-adc-objs := adau1977-adc.o ++snd-soc-googlevoicehat-soundcard-objs := googlevoicehat-soundcard.o + snd-soc-hifiberry-amp-objs := hifiberry_amp.o + snd-soc-hifiberry-dac-objs := hifiberry_dac.o + snd-soc-hifiberry-dacplus-objs := hifiberry_dacplus.o +@@ -32,6 +36,8 @@ snd-soc-pisound-objs := pisound.o + snd-soc-fe-pi-audio-objs := fe-pi-audio.o + + obj-$(CONFIG_SND_BCM2708_SOC_ADAU1977_ADC) += snd-soc-adau1977-adc.o ++obj-$(CONFIG_SND_BCM2708_SOC_GOOGLEVOICEHAT_SOUNDCARD) += snd-soc-googlevoicehat-soundcard.o ++obj-$(CONFIG_SND_BCM2708_SOC_GOOGLEVOICEHAT_SOUNDCARD) += snd-soc-googlevoicehat-codec.o + obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_AMP) += snd-soc-hifiberry-amp.o + obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DAC) += snd-soc-hifiberry-dac.o + obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DACPLUS) += snd-soc-hifiberry-dacplus.o +diff --git a/sound/soc/bcm/googlevoicehat-codec.c b/sound/soc/bcm/googlevoicehat-codec.c +new file mode 100644 +index 0000000000000000000000000000000000000000..7e31c9c54652cd9bd050028efb82dfc09fd9fced +--- /dev/null ++++ b/sound/soc/bcm/googlevoicehat-codec.c +@@ -0,0 +1,199 @@ ++/* ++ * Driver for the Google voiceHAT audio codec for Raspberry Pi. ++ * ++ * Author: Peter Malkin ++ * Copyright 2016 ++ * ++ * 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. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define ICS43432_RATE_MIN_HZ 7190 /* from data sheet */ ++#define ICS43432_RATE_MAX_HZ 52800 /* from data sheet */ ++#define SDMODE_DELAY_MS \ ++ 5 /* Delay in enabling SDMODE after clock settles to remove pop */ ++ ++struct voicehat_priv { ++ struct delayed_work enable_sdmode_work; ++ struct gpio_desc *sdmode_gpio; ++ unsigned int sdmode_delay; ++}; ++ ++static void voicehat_enable_sdmode_work(struct work_struct *work) { ++ struct voicehat_priv *voicehat = ++ container_of(work, struct voicehat_priv, enable_sdmode_work.work); ++ gpiod_set_value(voicehat->sdmode_gpio, 1); ++} ++ ++static int voicehat_codec_probe(struct snd_soc_codec *codec) { ++ struct voicehat_priv *voicehat = snd_soc_codec_get_drvdata(codec); ++ ++ voicehat->sdmode_gpio = devm_gpiod_get(codec->dev, "sdmode", GPIOD_OUT_LOW); ++ if (IS_ERR(voicehat->sdmode_gpio)) { ++ dev_err(codec->dev, "Unable to allocate GPIO pin\n"); ++ return PTR_ERR(voicehat->sdmode_gpio); ++ } ++ ++ INIT_DELAYED_WORK(&voicehat->enable_sdmode_work, voicehat_enable_sdmode_work); ++ return 0; ++} ++ ++static int voicehat_codec_remove(struct snd_soc_codec *codec) { ++ struct voicehat_priv *voicehat = snd_soc_codec_get_drvdata(codec); ++ ++ cancel_delayed_work_sync(&voicehat->enable_sdmode_work); ++ ++ return 0; ++} ++ ++static const struct snd_soc_dapm_widget voicehat_dapm_widgets[] = { ++ SND_SOC_DAPM_OUTPUT("Speaker"), ++}; ++ ++static const struct snd_soc_dapm_route voicehat_dapm_routes[] = { ++ {"Speaker", NULL, "HiFi Playback"}, ++}; ++ ++static struct snd_soc_codec_driver voicehat_codec_driver = { ++ .probe = voicehat_codec_probe, ++ .remove = voicehat_codec_remove, ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0) ++ .component_driver = { ++#endif ++ .dapm_widgets = voicehat_dapm_widgets, ++ .num_dapm_widgets = ARRAY_SIZE(voicehat_dapm_widgets), ++ .dapm_routes = voicehat_dapm_routes, ++ .num_dapm_routes = ARRAY_SIZE(voicehat_dapm_routes), ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0) ++ }, ++#endif ++}; ++ ++static int voicehat_daiops_trigger(struct snd_pcm_substream *substream, int cmd, ++ struct snd_soc_dai *dai) { ++ struct snd_soc_codec *codec = dai->codec; ++ struct voicehat_priv *voicehat = snd_soc_codec_get_drvdata(codec); ++ ++ if (voicehat->sdmode_delay == 0) return 0; ++ ++ dev_dbg(dai->dev, "CMD %d", cmd); ++ dev_dbg(dai->dev, "Playback Active %d", dai->playback_active); ++ dev_dbg(dai->dev, "Capture Active %d", dai->capture_active); ++ ++ switch (cmd) { ++ case SNDRV_PCM_TRIGGER_START: ++ case SNDRV_PCM_TRIGGER_RESUME: ++ case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: ++ if (dai->playback_active) { ++ dev_info(dai->dev, "Enabling audio amp...\n"); ++ queue_delayed_work(system_power_efficient_wq, ++ &voicehat->enable_sdmode_work, ++ msecs_to_jiffies(voicehat->sdmode_delay)); ++ } ++ break; ++ case SNDRV_PCM_TRIGGER_STOP: ++ case SNDRV_PCM_TRIGGER_SUSPEND: ++ case SNDRV_PCM_TRIGGER_PAUSE_PUSH: ++ if (dai->playback_active) { ++ cancel_delayed_work(&voicehat->enable_sdmode_work); ++ dev_info(dai->dev, "Disabling audio amp...\n"); ++ gpiod_set_value(voicehat->sdmode_gpio, 0); ++ } ++ break; ++ } ++ return 0; ++} ++ ++static const struct snd_soc_dai_ops voicehat_dai_ops = { ++ .trigger = voicehat_daiops_trigger, ++}; ++ ++static struct snd_soc_dai_driver voicehat_dai = { ++ .name = "voicehat-hifi", ++ .capture = {.stream_name = "HiFi Capture", ++ .channels_min = 2, ++ .channels_max = 2, ++ .rates = SNDRV_PCM_RATE_48000, ++ .formats = SNDRV_PCM_FMTBIT_S32_LE}, ++ .playback = {.stream_name = "HiFi Playback", ++ .channels_min = 2, ++ .channels_max = 2, ++ .rates = SNDRV_PCM_RATE_48000, ++ .formats = SNDRV_PCM_FMTBIT_S32_LE}, ++ .ops = &voicehat_dai_ops, ++ .symmetric_rates = 1}; ++ ++#ifdef CONFIG_OF ++static const struct of_device_id voicehat_ids[] = { ++ { ++ .compatible = "google,voicehat", ++ }, ++ {}}; ++MODULE_DEVICE_TABLE(of, voicehat_ids); ++#endif ++ ++static int voicehat_platform_probe(struct platform_device *pdev) { ++ struct voicehat_priv *voicehat; ++ int ret; ++ ++ voicehat = devm_kzalloc(&pdev->dev, sizeof(*voicehat), GFP_KERNEL); ++ if (!voicehat) return -ENOMEM; ++ ++ ret = device_property_read_u32(&pdev->dev, "voicehat_sdmode_delay", ++ &voicehat->sdmode_delay); ++ ++ if (ret) { ++ voicehat->sdmode_delay = SDMODE_DELAY_MS; ++ dev_info(&pdev->dev, ++ "property 'voicehat_sdmode_delay' not found default 5 mS"); ++ } else { ++ dev_info(&pdev->dev, "property 'voicehat_sdmode_delay' found delay= %d mS", ++ voicehat->sdmode_delay); ++ } ++ ++ dev_set_drvdata(&pdev->dev, voicehat); ++ ++ return snd_soc_register_codec(&pdev->dev, &voicehat_codec_driver, &voicehat_dai, 1); ++} ++ ++static int voicehat_platform_remove(struct platform_device *pdev) { ++ snd_soc_unregister_codec(&pdev->dev); ++ return 0; ++} ++ ++static struct platform_driver voicehat_driver = { ++ .driver = ++ { ++ .name = "voicehat-codec", .of_match_table = of_match_ptr(voicehat_ids), ++ }, ++ .probe = voicehat_platform_probe, ++ .remove = voicehat_platform_remove, ++}; ++ ++module_platform_driver(voicehat_driver); ++ ++MODULE_DESCRIPTION("Google voiceHAT Codec driver"); ++MODULE_AUTHOR("Peter Malkin "); ++MODULE_LICENSE("GPL v2"); +diff --git a/sound/soc/bcm/googlevoicehat-soundcard.c b/sound/soc/bcm/googlevoicehat-soundcard.c +new file mode 100644 +index 0000000000000000000000000000000000000000..225854b8e5298b3c3018f59a49404354a831a24e +--- /dev/null ++++ b/sound/soc/bcm/googlevoicehat-soundcard.c +@@ -0,0 +1,124 @@ ++/* ++ * ASoC Driver for Google voiceHAT SoundCard ++ * ++ * Author: Peter Malkin ++ * Copyright 2016 ++ * ++ * 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. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ */ ++ ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++ ++static int snd_rpi_googlevoicehat_soundcard_init(struct snd_soc_pcm_runtime *rtd) ++{ ++ return 0; ++} ++ ++static int snd_rpi_googlevoicehat_soundcard_hw_params( ++ struct snd_pcm_substream *substream, ++ struct snd_pcm_hw_params *params) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_dai *cpu_dai = rtd->cpu_dai; ++ ++ unsigned int sample_bits = ++ snd_pcm_format_physical_width(params_format(params)); ++ ++ return snd_soc_dai_set_bclk_ratio(cpu_dai, sample_bits * 2); ++} ++ ++/* machine stream operations */ ++static struct snd_soc_ops snd_rpi_googlevoicehat_soundcard_ops = { ++ .hw_params = snd_rpi_googlevoicehat_soundcard_hw_params, ++}; ++ ++static struct snd_soc_dai_link snd_rpi_googlevoicehat_soundcard_dai[] = { ++{ ++ .name = "Google voiceHAT SoundCard", ++ .stream_name = "Google voiceHAT SoundCard HiFi", ++ .cpu_dai_name = "bcm2708-i2s.0", ++ .codec_dai_name = "voicehat-hifi", ++ .platform_name = "bcm2708-i2s.0", ++ .codec_name = "voicehat-codec", ++ .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | ++ SND_SOC_DAIFMT_CBS_CFS, ++ .ops = &snd_rpi_googlevoicehat_soundcard_ops, ++ .init = snd_rpi_googlevoicehat_soundcard_init, ++}, ++}; ++ ++/* audio machine driver */ ++static struct snd_soc_card snd_rpi_googlevoicehat_soundcard = { ++ .name = "snd_rpi_googlevoicehat_soundcard", ++ .owner = THIS_MODULE, ++ .dai_link = snd_rpi_googlevoicehat_soundcard_dai, ++ .num_links = ARRAY_SIZE(snd_rpi_googlevoicehat_soundcard_dai), ++}; ++ ++static int snd_rpi_googlevoicehat_soundcard_probe(struct platform_device *pdev) ++{ ++ int ret = 0; ++ ++ snd_rpi_googlevoicehat_soundcard.dev = &pdev->dev; ++ ++ if (pdev->dev.of_node) { ++ struct device_node *i2s_node; ++ struct snd_soc_dai_link *dai = &snd_rpi_googlevoicehat_soundcard_dai[0]; ++ i2s_node = of_parse_phandle(pdev->dev.of_node, ++ "i2s-controller", 0); ++ ++ if (i2s_node) { ++ dai->cpu_dai_name = NULL; ++ dai->cpu_of_node = i2s_node; ++ dai->platform_name = NULL; ++ dai->platform_of_node = i2s_node; ++ } ++ } ++ ++ ret = snd_soc_register_card(&snd_rpi_googlevoicehat_soundcard); ++ if (ret) ++ dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", ret); ++ ++ return ret; ++} ++ ++static int snd_rpi_googlevoicehat_soundcard_remove(struct platform_device *pdev) ++{ ++ return snd_soc_unregister_card(&snd_rpi_googlevoicehat_soundcard); ++} ++ ++static const struct of_device_id snd_rpi_googlevoicehat_soundcard_of_match[] = { ++ { .compatible = "googlevoicehat,googlevoicehat-soundcard", }, ++ {}, ++}; ++MODULE_DEVICE_TABLE(of, snd_rpi_googlevoicehat_soundcard_of_match); ++ ++static struct platform_driver snd_rpi_googlevoicehat_soundcard_driver = { ++ .driver = { ++ .name = "snd-googlevoicehat-soundcard", ++ .owner = THIS_MODULE, ++ .of_match_table = snd_rpi_googlevoicehat_soundcard_of_match, ++ }, ++ .probe = snd_rpi_googlevoicehat_soundcard_probe, ++ .remove = snd_rpi_googlevoicehat_soundcard_remove, ++}; ++ ++module_platform_driver(snd_rpi_googlevoicehat_soundcard_driver); ++ ++MODULE_AUTHOR("Peter Malkin "); ++MODULE_DESCRIPTION("ASoC Driver for Google voiceHAT SoundCard"); ++MODULE_LICENSE("GPL v2"); + +From a2df1bd37f752dbe06a36c437b24e4719614c26a Mon Sep 17 00:00:00 2001 +From: Raashid Muhammed +Date: Mon, 27 Mar 2017 12:35:00 +0530 +Subject: [PATCH 212/218] Add support for Allo Piano DAC 2.1 plus add-on board + for Raspberry Pi. + +The Piano DAC 2.1 has support for 4 channels with subwoofer. + +Signed-off-by: Baswaraj K +Reviewed-by: Vijay Kumar B. +Reviewed-by: Raashid Muhammed +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 18 + + .../allo-piano-dac-plus-pcm512x-audio-overlay.dts | 51 +++ + sound/soc/bcm/Kconfig | 7 + + sound/soc/bcm/Makefile | 2 + + sound/soc/bcm/allo-piano-dac-plus.c | 467 +++++++++++++++++++++ + 6 files changed, 546 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/allo-piano-dac-plus-pcm512x-audio-overlay.dts + create mode 100644 sound/soc/bcm/allo-piano-dac-plus.c + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index 2f1cd17697606687fe47cb4e6a25a572611bf241..73826c74d2cfb58cac1a72e523ce00b021411d16 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -8,6 +8,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + ads7846.dtbo \ + akkordion-iqdacplus.dtbo \ + allo-piano-dac-pcm512x-audio.dtbo \ ++ allo-piano-dac-plus-pcm512x-audio.dtbo \ + at86rf233.dtbo \ + audioinjector-addons.dtbo \ + audioinjector-wm8731-audio.dtbo \ +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 6870e83a2e6acf842259a769d483b0b98c172279..1e3420e80d620f3c376ffb7c905e7aba7f63d709 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -283,6 +283,24 @@ Params: 24db_digital_gain Allow gain to be applied via the PCM512x codec + that does not result in clipping/distortion!) + + ++Name: allo-piano-dac-plus-pcm512x-audio ++Info: Configures the Allo Piano DAC (2.1) audio cards. ++Load: dtoverlay=allo-piano-dac-plus-pcm512x-audio, ++Params: 24db_digital_gain Allow gain to be applied via the PCM512x codec ++ Digital volume control. ++ (The default behaviour is that the Digital ++ volume control is limited to a maximum of ++ 0dB. ie. it can attenuate but not provide ++ gain. For most users, this will be desired ++ as it will prevent clipping. By appending ++ the 24db_digital_gain parameter, the Digital ++ volume control will allow up to 24dB of ++ gain. If this parameter is enabled, it is the ++ responsibility of the user to ensure that ++ the Digital volume control is set to a value ++ that does not result in clipping/distortion!) ++ ++ + Name: at86rf233 + Info: Configures the Atmel AT86RF233 802.15.4 low-power WPAN transceiver, + connected to spi0.0 +diff --git a/arch/arm/boot/dts/overlays/allo-piano-dac-plus-pcm512x-audio-overlay.dts b/arch/arm/boot/dts/overlays/allo-piano-dac-plus-pcm512x-audio-overlay.dts +new file mode 100644 +index 0000000000000000000000000000000000000000..6943b55ca5f96097668e2d10c05f56a26be62b0a +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/allo-piano-dac-plus-pcm512x-audio-overlay.dts +@@ -0,0 +1,51 @@ ++// Definitions for Piano DAC ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target = <&i2s>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&i2c1>; ++ __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ pcm5122_4c: pcm5122@4c { ++ #sound-dai-cells = <0>; ++ compatible = "ti,pcm5122"; ++ reg = <0x4c>; ++ status = "okay"; ++ }; ++ pcm5122_4d: pcm5122@4d { ++ #sound-dai-cells = <0>; ++ compatible = "ti,pcm5122"; ++ reg = <0x4d>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&sound>; ++ piano_dac: __overlay__ { ++ compatible = "allo,piano-dac-plus"; ++ audio-codec = <&pcm5122_4c &pcm5122_4d>; ++ i2s-controller = <&i2s>; ++ status = "okay"; ++ }; ++ }; ++ ++ __overrides__ { ++ 24db_digital_gain = ++ <&piano_dac>,"piano,24db_digital_gain?"; ++ }; ++}; +diff --git a/sound/soc/bcm/Kconfig b/sound/soc/bcm/Kconfig +index e4a47fa404d3fe7c8c0713e2512ee3092492e605..4c647abe7504546dbd1d1566f2440cd6ceb12785 100644 +--- a/sound/soc/bcm/Kconfig ++++ b/sound/soc/bcm/Kconfig +@@ -161,6 +161,13 @@ config SND_BCM2708_SOC_ALLO_PIANO_DAC + help + Say Y or M if you want to add support for Allo Piano DAC. + ++config SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS ++ tristate "Support for Allo Piano DAC Plus" ++ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S ++ select SND_SOC_PCM512x_I2C ++ help ++ Say Y or M if you want to add support for Allo Piano DAC Plus. ++ + config SND_BCM2708_SOC_FE_PI_AUDIO + tristate "Support for Fe-Pi-Audio" + depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S +diff --git a/sound/soc/bcm/Makefile b/sound/soc/bcm/Makefile +index e37457f01b263ba47ad884c7e945d33b001d9c66..54b4111ad820b3f8086867ca2ce86d5339fca93e 100644 +--- a/sound/soc/bcm/Makefile ++++ b/sound/soc/bcm/Makefile +@@ -32,6 +32,7 @@ snd-soc-digidac1-soundcard-objs := digidac1-soundcard.o + snd-soc-dionaudio-loco-objs := dionaudio_loco.o + snd-soc-dionaudio-loco-v2-objs := dionaudio_loco-v2.o + snd-soc-allo-piano-dac-objs := allo-piano-dac.o ++snd-soc-allo-piano-dac-plus-objs := allo-piano-dac-plus.o + snd-soc-pisound-objs := pisound.o + snd-soc-fe-pi-audio-objs := fe-pi-audio.o + +@@ -56,5 +57,6 @@ obj-$(CONFIG_SND_DIGIDAC1_SOUNDCARD) += snd-soc-digidac1-soundcard.o + obj-$(CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO) += snd-soc-dionaudio-loco.o + obj-$(CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO_V2) += snd-soc-dionaudio-loco-v2.o + obj-$(CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC) += snd-soc-allo-piano-dac.o ++obj-$(CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS) += snd-soc-allo-piano-dac-plus.o + obj-$(CONFIG_SND_PISOUND) += snd-soc-pisound.o + obj-$(CONFIG_SND_BCM2708_SOC_FE_PI_AUDIO) += snd-soc-fe-pi-audio.o +diff --git a/sound/soc/bcm/allo-piano-dac-plus.c b/sound/soc/bcm/allo-piano-dac-plus.c +new file mode 100644 +index 0000000000000000000000000000000000000000..f66f42abadbd5f9d3fe000676e8297ed91630e47 +--- /dev/null ++++ b/sound/soc/bcm/allo-piano-dac-plus.c +@@ -0,0 +1,467 @@ ++/* ++ * ALSA ASoC Machine Driver for Allo Piano DAC Plus Subwoofer ++ * ++ * Author: Baswaraj K ++ * Copyright 2016 ++ * based on code by Daniel Matuschek ++ * based on code by Florian Meier ++ * ++ * 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. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ */ ++ ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "../codecs/pcm512x.h" ++ ++struct dsp_code { ++ char i2c_addr; ++ char offset; ++ char val; ++}; ++ ++static struct snd_soc_pcm_runtime *rtd_glb; ++static bool digital_gain_0db_limit = true; ++unsigned int set_lowpass, set_mode, set_rate, dsp_page_number; ++ ++static const char * const allo_piano_mode_texts[] = { ++ "2.0", ++ "2.1", ++ "2.2", ++}; ++ ++static const SOC_ENUM_SINGLE_DECL(allo_piano_mode_enum, ++ 0, 0, allo_piano_mode_texts); ++ ++static const char * const allo_piano_dsp_low_pass_texts[] = { ++ "60", ++ "70", ++ "80", ++ "90", ++ "100", ++ "110", ++ "120", ++ "130", ++ "140", ++ "150", ++ "160", ++ "170", ++ "180", ++ "190", ++ "200", ++}; ++ ++static const SOC_ENUM_SINGLE_DECL(allo_piano_enum, ++ 0, 0, allo_piano_dsp_low_pass_texts); ++ ++static int snd_allo_piano_dsp_program(struct snd_soc_pcm_runtime *rtd, ++ unsigned int mode, unsigned int rate, unsigned int lowpass) ++{ ++ const struct firmware *fw; ++ char firmware_name[40]; ++ int ret = 0, dac = 0; ++ ++ if (rate <= 46000) ++ rate = 44100; ++ else if (rate <= 68000) ++ rate = 48000; ++ else if (rate <= 92000) ++ rate = 88200; ++ else if (rate <= 136000) ++ rate = 96000; ++ else if (rate <= 184000) ++ rate = 176400; ++ else ++ rate = 192000; ++ ++ /* same configuration loaded */ ++ if ((rate == set_rate) && (lowpass == set_lowpass) ++ && (mode == set_mode)) ++ return 1; ++ ++ set_rate = rate; ++ set_mode = mode; ++ ++ if (mode == 0) { /* 2.0 */ ++ snd_soc_write(rtd->codec_dais[1]->codec, ++ PCM512x_MUTE, 0x11); ++ return 1; ++ } else { ++ snd_soc_write(rtd->codec_dais[1]->codec, ++ PCM512x_MUTE, 0x00); ++ } ++ ++ set_lowpass = lowpass; ++ ++ for (dac = 0; dac < rtd->num_codecs; dac++) { ++ struct dsp_code *dsp_code_read; ++ int i = 1; ++ struct snd_soc_codec *codec = rtd->codec_dais[dac]->codec; ++ ++ if (dac == 0) { /* high */ ++ sprintf(firmware_name, ++ "alloPiano/2.2/allo-piano-dsp-%d-%d-%d.bin", ++ rate, ((set_lowpass * 10) + 60), dac); ++ } else { /* low */ ++ sprintf(firmware_name, ++ "alloPiano/2.%d/allo-piano-dsp-%d-%d-%d.bin", ++ set_mode, rate, ((set_lowpass * 10) + 60), dac); ++ } ++ ++ dev_info(codec->dev, "Dsp Firmware File Name: %s\n", ++ firmware_name); ++ ++ ret = request_firmware(&fw, firmware_name, codec->dev); ++ if (ret < 0) { ++ dev_err(codec->dev, "Error: AlloPiano Firmware %s missing. %d\n", ++ firmware_name, ret); ++ goto err; ++ } ++ ++ while (i < (fw->size - 1)) { ++ dsp_code_read = (struct dsp_code *)&fw->data[i]; ++ ++ if (dsp_code_read->offset == 0) { ++ dsp_page_number = dsp_code_read->val; ++ ret = snd_soc_write(rtd->codec_dais[dac]->codec, ++ PCM512x_PAGE_BASE(0), ++ dsp_code_read->val); ++ ++ } else if (dsp_code_read->offset != 0) { ++ ret = snd_soc_write(rtd->codec_dais[dac]->codec, ++ (PCM512x_PAGE_BASE(dsp_page_number) + ++ dsp_code_read->offset), ++ dsp_code_read->val); ++ ++ } ++ if (ret < 0) { ++ dev_err(codec->dev, ++ "Failed to write Register: %d\n", ret); ++ goto err; ++ } ++ i = i + 3; ++ } ++ release_firmware(fw); ++ } ++ return 1; ++ ++err: ++ release_firmware(fw); ++ return ret; ++} ++ ++static int snd_allo_piano_mode_get(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ ucontrol->value.integer.value[0] = set_mode; ++ return 0; ++} ++ ++static int snd_allo_piano_mode_put(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ return(snd_allo_piano_dsp_program(rtd_glb, ++ ucontrol->value.integer.value[0], ++ set_rate, set_lowpass)); ++} ++ ++static int snd_allo_piano_lowpass_get(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ ucontrol->value.integer.value[0] = set_lowpass; ++ return 0; ++} ++ ++static int snd_allo_piano_lowpass_put(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ return(snd_allo_piano_dsp_program(rtd_glb, ++ set_mode, set_rate, ++ ucontrol->value.integer.value[0])); ++} ++ ++static int pcm512x_get_reg_sub(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ struct soc_mixer_control *mc = ++ (struct soc_mixer_control *)kcontrol->private_value; ++ unsigned int left_val = 0; ++ unsigned int right_val = 0; ++ ++ left_val = snd_soc_read(rtd_glb->codec_dais[1]->codec, ++ PCM512x_DIGITAL_VOLUME_2); ++ if (left_val < 0) ++ return left_val; ++ ++ right_val = snd_soc_read(rtd_glb->codec_dais[1]->codec, ++ PCM512x_DIGITAL_VOLUME_3); ++ if (right_val < 0) ++ return right_val; ++ ++ ucontrol->value.integer.value[0] = ++ (~(left_val >> mc->shift)) & mc->max; ++ ucontrol->value.integer.value[1] = ++ (~(right_val >> mc->shift)) & mc->max; ++ ++ return 0; ++} ++ ++static int pcm512x_set_reg_sub(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ struct soc_mixer_control *mc = ++ (struct soc_mixer_control *)kcontrol->private_value; ++ unsigned int left_val = (ucontrol->value.integer.value[0] & mc->max); ++ unsigned int right_val = (ucontrol->value.integer.value[1] & mc->max); ++ int ret = 0; ++ ++ ret = snd_soc_write(rtd_glb->codec_dais[1]->codec, ++ PCM512x_DIGITAL_VOLUME_2, (~left_val)); ++ if (ret < 0) ++ return ret; ++ ++ ret = snd_soc_write(rtd_glb->codec_dais[1]->codec, ++ PCM512x_DIGITAL_VOLUME_3, (~right_val)); ++ if (ret < 0) ++ return ret; ++ ++ return 1; ++} ++ ++static int pcm512x_get_reg_sub_switch(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ int val = 0; ++ ++ val = snd_soc_read(rtd_glb->codec_dais[1]->codec, PCM512x_MUTE); ++ if (val < 0) ++ return val; ++ ++ ucontrol->value.integer.value[0] = (val & 0x10) ? 0 : 1; ++ ucontrol->value.integer.value[1] = (val & 0x01) ? 0 : 1; ++ ++ return val; ++} ++ ++static int pcm512x_set_reg_sub_switch(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ unsigned int left_val = (ucontrol->value.integer.value[0]); ++ unsigned int right_val = (ucontrol->value.integer.value[1]); ++ int ret = 0; ++ ++ ret = snd_soc_write(rtd_glb->codec_dais[1]->codec, PCM512x_MUTE, ++ ~((left_val & 0x01)<<4 | (right_val & 0x01))); ++ if (ret < 0) ++ return ret; ++ ++ return 1; ++ ++} ++ ++static const DECLARE_TLV_DB_SCALE(digital_tlv_sub, -10350, 50, 1); ++ ++static const struct snd_kcontrol_new allo_piano_controls[] = { ++ SOC_ENUM_EXT("Subwoofer mode", ++ allo_piano_mode_enum, ++ snd_allo_piano_mode_get, ++ snd_allo_piano_mode_put), ++ ++ SOC_ENUM_EXT("Lowpass", allo_piano_enum, ++ snd_allo_piano_lowpass_get, ++ snd_allo_piano_lowpass_put), ++ ++ SOC_DOUBLE_R_EXT_TLV("Subwoofer Digital Playback Volume", ++ PCM512x_DIGITAL_VOLUME_2, ++ PCM512x_DIGITAL_VOLUME_3, 0, 255, 1, ++ pcm512x_get_reg_sub, ++ pcm512x_set_reg_sub, ++ digital_tlv_sub), ++ ++ SOC_DOUBLE_EXT("Subwoofer Digital Playback Switch", ++ PCM512x_MUTE, ++ PCM512x_RQML_SHIFT, ++ PCM512x_RQMR_SHIFT, 1, 1, ++ pcm512x_get_reg_sub_switch, ++ pcm512x_set_reg_sub_switch), ++}; ++ ++static int snd_allo_piano_dac_init(struct snd_soc_pcm_runtime *rtd) ++{ ++ rtd_glb = rtd; ++ ++ if (digital_gain_0db_limit) { ++ int ret; ++ struct snd_soc_card *card = rtd->card; ++ ++ ret = snd_soc_limit_volume(card, "Digital Playback Volume", ++ 207); ++ if (ret < 0) ++ dev_warn(card->dev, "Failed to set volume limit: %d\n", ++ ret); ++ } ++ ++ return 0; ++} ++ ++static int snd_allo_piano_dac_hw_params(struct snd_pcm_substream *substream, ++ struct snd_pcm_hw_params *params) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_dai *cpu_dai = rtd->cpu_dai; ++ unsigned int sample_bits = ++ snd_pcm_format_physical_width(params_format(params)); ++ unsigned int rate = params_rate(params); ++ struct snd_soc_card *card = rtd->card; ++ int ret = 0; ++ ++ rtd_glb = rtd; /* TODO */ ++ if (digital_gain_0db_limit) { ++ ret = snd_soc_limit_volume(card, ++ "Subwoofer Digital Playback Volume", 207); ++ if (ret < 0) ++ dev_warn(card->dev, "Failed to set volume limit: %d\n", ++ ret); ++ } ++ ret = snd_allo_piano_dsp_program(rtd, set_mode, rate, set_lowpass); ++ if (ret < 0) ++ return ret; ++ ++ ret = snd_soc_dai_set_bclk_ratio(cpu_dai, sample_bits * 2); ++ ++ return ret; ++} ++ ++/* machine stream operations */ ++static struct snd_soc_ops snd_allo_piano_dac_ops = { ++ .hw_params = snd_allo_piano_dac_hw_params, ++}; ++ ++static struct snd_soc_dai_link_component allo_piano_2_1_codecs[] = { ++ { ++ .dai_name = "pcm512x-hifi", ++ }, ++ { ++ .dai_name = "pcm512x-hifi", ++ }, ++}; ++ ++static struct snd_soc_dai_link snd_allo_piano_dac_dai[] = { ++ { ++ .name = "PianoDACPlus", ++ .stream_name = "PianoDACPlus", ++ .cpu_dai_name = "bcm2708-i2s.0", ++ .platform_name = "bcm2708-i2s.0", ++ .codecs = allo_piano_2_1_codecs, ++ .num_codecs = 2, ++ .dai_fmt = SND_SOC_DAIFMT_I2S | ++ SND_SOC_DAIFMT_NB_NF | ++ SND_SOC_DAIFMT_CBS_CFS, ++ .ops = &snd_allo_piano_dac_ops, ++ .init = snd_allo_piano_dac_init, ++ }, ++}; ++ ++/* audio machine driver */ ++static struct snd_soc_card snd_allo_piano_dac = { ++ .name = "PianoDACPlus", ++ .owner = THIS_MODULE, ++ .dai_link = snd_allo_piano_dac_dai, ++ .num_links = ARRAY_SIZE(snd_allo_piano_dac_dai), ++ .controls = allo_piano_controls, ++ .num_controls = ARRAY_SIZE(allo_piano_controls), ++}; ++ ++static int snd_allo_piano_dac_probe(struct platform_device *pdev) ++{ ++ int ret = 0, i = 0; ++ struct snd_soc_card *card = &snd_allo_piano_dac; ++ ++ card->dev = &pdev->dev; ++ snd_allo_piano_dac.dev = &pdev->dev; ++ ++ if (pdev->dev.of_node) { ++ struct device_node *i2s_node; ++ struct snd_soc_dai_link *dai; ++ ++ dai = &snd_allo_piano_dac_dai[0]; ++ i2s_node = of_parse_phandle(pdev->dev.of_node, ++ "i2s-controller", 0); ++ if (i2s_node) { ++ for (i = 0; i < card->num_links; i++) { ++ dai->cpu_dai_name = NULL; ++ dai->cpu_of_node = i2s_node; ++ dai->platform_name = NULL; ++ dai->platform_of_node = i2s_node; ++ } ++ } ++ digital_gain_0db_limit = ++ !of_property_read_bool(pdev->dev.of_node, ++ "allo,24db_digital_gain"); ++ ++ allo_piano_2_1_codecs[0].of_node = ++ of_parse_phandle(pdev->dev.of_node, "audio-codec", 0); ++ if (!allo_piano_2_1_codecs[0].of_node) { ++ dev_err(&pdev->dev, ++ "Property 'audio-codec' missing or invalid\n"); ++ return -EINVAL; ++ } ++ ++ allo_piano_2_1_codecs[1].of_node = ++ of_parse_phandle(pdev->dev.of_node, "audio-codec", 1); ++ if (!allo_piano_2_1_codecs[1].of_node) { ++ dev_err(&pdev->dev, ++ "Property 'audio-codec' missing or invalid\n"); ++ return -EINVAL; ++ } ++ } ++ ++ ret = snd_soc_register_card(&snd_allo_piano_dac); ++ if (ret < 0) ++ dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", ++ ret); ++ ++ return ret; ++} ++ ++static int snd_allo_piano_dac_remove(struct platform_device *pdev) ++{ ++ return snd_soc_unregister_card(&snd_allo_piano_dac); ++} ++ ++static const struct of_device_id snd_allo_piano_dac_of_match[] = { ++ { .compatible = "allo,piano-dac-plus", }, ++ { /* sentinel */ }, ++}; ++ ++MODULE_DEVICE_TABLE(of, snd_allo_piano_dac_of_match); ++ ++static struct platform_driver snd_allo_piano_dac_driver = { ++ .driver = { ++ .name = "snd-allo-piano-dac-plus", ++ .owner = THIS_MODULE, ++ .of_match_table = snd_allo_piano_dac_of_match, ++ }, ++ .probe = snd_allo_piano_dac_probe, ++ .remove = snd_allo_piano_dac_remove, ++}; ++ ++module_platform_driver(snd_allo_piano_dac_driver); ++ ++MODULE_AUTHOR("Baswaraj K "); ++MODULE_DESCRIPTION("ALSA ASoC Machine Driver for Allo Piano DAC Plus"); ++MODULE_LICENSE("GPL v2"); + +From 29ab0b844215f7f86b75bc05ba73add0caa422bb Mon Sep 17 00:00:00 2001 +From: BabuSubashChandar +Date: Tue, 28 Mar 2017 20:04:42 +0530 +Subject: [PATCH 213/218] Add support for Allo Boss DAC add-on board for + Raspberry Pi. (#1924) + +Signed-off-by: Baswaraj K +Reviewed-by: Deepak +Reviewed-by: BabuSubashChandar +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 24 ++ + .../allo-boss-dac-pcm512x-audio-overlay.dts | 58 ++++ + drivers/clk/Makefile | 1 + + drivers/clk/clk-allo-dac-45Mhz.c | 161 +++++++++ + sound/soc/bcm/Kconfig | 8 + + sound/soc/bcm/Makefile | 2 + + sound/soc/bcm/allo-boss-dac.c | 374 +++++++++++++++++++++ + 8 files changed, 629 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/allo-boss-dac-pcm512x-audio-overlay.dts + create mode 100644 drivers/clk/clk-allo-dac-45Mhz.c + create mode 100644 sound/soc/bcm/allo-boss-dac.c + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index 73826c74d2cfb58cac1a72e523ce00b021411d16..b64dd7ac0630b2b525809a9f5221420f34a58ac9 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -7,6 +7,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + ads1115.dtbo \ + ads7846.dtbo \ + akkordion-iqdacplus.dtbo \ ++ allo-boss-dac-pcm512x-audio.dtbo \ + allo-piano-dac-pcm512x-audio.dtbo \ + allo-piano-dac-plus-pcm512x-audio.dtbo \ + at86rf233.dtbo \ +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 1e3420e80d620f3c376ffb7c905e7aba7f63d709..c9e954253a6318dbd2605b93026c04974b3271bd 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -263,6 +263,30 @@ Params: 24db_digital_gain Allow gain to be applied via the PCM512x codec + that does not result in clipping/distortion!) + + ++Name: allo-boss-dac-pcm512x-audio ++Info: Configures the Allo Boss DAC audio cards. ++Load: dtoverlay=allo-boss-dac-pcm512x-audio, ++Params: 24db_digital_gain Allow gain to be applied via the PCM512x codec ++ Digital volume control. Enable with ++ "dtoverlay=allo-boss-dac-pcm512x-audio, ++ 24db_digital_gain" ++ (The default behaviour is that the Digital ++ volume control is limited to a maximum of ++ 0dB. ie. it can attenuate but not provide ++ gain. For most users, this will be desired ++ as it will prevent clipping. By appending ++ the 24db_digital_gain parameter, the Digital ++ volume control will allow up to 24dB of ++ gain. If this parameter is enabled, it is the ++ responsibility of the user to ensure that ++ the Digital volume control is set to a value ++ that does not result in clipping/distortion!) ++ slave Force Boss DAC into slave mode, using Pi a ++ master for bit clock and frame clock. Enable ++ with "dtoverlay=allo-boss-dac-pcm512x-audio, ++ slave" ++ ++ + Name: allo-piano-dac-pcm512x-audio + Info: Configures the Allo Piano DAC (2.0/2.1) audio cards. + (NB. This initial support is for 2.0 channel audio ONLY! ie. stereo. +diff --git a/arch/arm/boot/dts/overlays/allo-boss-dac-pcm512x-audio-overlay.dts b/arch/arm/boot/dts/overlays/allo-boss-dac-pcm512x-audio-overlay.dts +new file mode 100644 +index 0000000000000000000000000000000000000000..7df335a3d82f7043d31ba69331cdf3185264d78c +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/allo-boss-dac-pcm512x-audio-overlay.dts +@@ -0,0 +1,58 @@ ++/* ++ * Definitions for Allo Boss DAC board ++ */ ++ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target-path = "/clocks"; ++ __overlay__ { ++ boss_osc: boss_osc { ++ compatible = "allo,dac-clk"; ++ #clock-cells = <0>; ++ }; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&i2s>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&i2c1>; ++ __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ pcm5122@4d { ++ #sound-dai-cells = <0>; ++ compatible = "ti,pcm5122"; ++ clocks = <&boss_osc>; ++ reg = <0x4d>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ fragment@3 { ++ target = <&sound>; ++ boss_dac: __overlay__ { ++ compatible = "allo,boss-dac"; ++ i2s-controller = <&i2s>; ++ status = "okay"; ++ }; ++ }; ++ ++ __overrides__ { ++ 24db_digital_gain = <&boss_dac>,"allo,24db_digital_gain?"; ++ slave = <&boss_dac>,"allo,slave?"; ++ }; ++}; +diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile +index 2b6fcd8abf79da77aa85fdc53512aafd09f836cb..b1b3cf5d3a09fe8bd38dfed880dd7e6ac0ccc3d7 100644 +--- a/drivers/clk/Makefile ++++ b/drivers/clk/Makefile +@@ -17,6 +17,7 @@ endif + + # hardware specific clock types + # please keep this section sorted lexicographically by file path name ++obj-$(CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC) += clk-allo-dac-45Mhz.o + obj-$(CONFIG_MACH_ASM9260) += clk-asm9260.o + obj-$(CONFIG_COMMON_CLK_AXI_CLKGEN) += clk-axi-clkgen.o + obj-$(CONFIG_ARCH_AXXIA) += clk-axm5516.o +diff --git a/drivers/clk/clk-allo-dac-45Mhz.c b/drivers/clk/clk-allo-dac-45Mhz.c +new file mode 100644 +index 0000000000000000000000000000000000000000..d5e9e5b3495cfd2e94fae256f11bc6e0d1f470c6 +--- /dev/null ++++ b/drivers/clk/clk-allo-dac-45Mhz.c +@@ -0,0 +1,161 @@ ++/* ++ * Clock Driver for Allo DAC ++ * ++ * Author: Baswaraj K ++ * Copyright 2016 ++ * based on code by Stuart MacLean ++ * ++ * 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. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/* Clock rate of CLK44EN attached to GPIO6 pin */ ++#define CLK_44EN_RATE 45158400UL ++/* Clock rate of CLK48EN attached to GPIO3 pin */ ++#define CLK_48EN_RATE 49152000UL ++ ++/** ++ * struct allo_dac_clk - Common struct to the Allo DAC ++ * @hw: clk_hw for the common clk framework ++ * @mode: 0 => CLK44EN, 1 => CLK48EN ++ */ ++struct clk_allo_hw { ++ struct clk_hw hw; ++ uint8_t mode; ++}; ++ ++#define to_allo_clk(_hw) container_of(_hw, struct clk_allo_hw, hw) ++ ++static const struct of_device_id clk_allo_dac_dt_ids[] = { ++ { .compatible = "allo,dac-clk",}, ++ { } ++}; ++MODULE_DEVICE_TABLE(of, clk_allo_dac_dt_ids); ++ ++static unsigned long clk_allo_dac_recalc_rate(struct clk_hw *hw, ++ unsigned long parent_rate) ++{ ++ return (to_allo_clk(hw)->mode == 0) ? CLK_44EN_RATE : ++ CLK_48EN_RATE; ++} ++ ++static long clk_allo_dac_round_rate(struct clk_hw *hw, ++ unsigned long rate, unsigned long *parent_rate) ++{ ++ long actual_rate; ++ ++ if (rate <= CLK_44EN_RATE) { ++ actual_rate = (long)CLK_44EN_RATE; ++ } else if (rate >= CLK_48EN_RATE) { ++ actual_rate = (long)CLK_48EN_RATE; ++ } else { ++ long diff44Rate = (long)(rate - CLK_44EN_RATE); ++ long diff48Rate = (long)(CLK_48EN_RATE - rate); ++ ++ if (diff44Rate < diff48Rate) ++ actual_rate = (long)CLK_44EN_RATE; ++ else ++ actual_rate = (long)CLK_48EN_RATE; ++ } ++ return actual_rate; ++} ++ ++ ++static int clk_allo_dac_set_rate(struct clk_hw *hw, ++ unsigned long rate, unsigned long parent_rate) ++{ ++ unsigned long actual_rate; ++ struct clk_allo_hw *clk = to_allo_clk(hw); ++ ++ actual_rate = (unsigned long)clk_allo_dac_round_rate(hw, rate, ++ &parent_rate); ++ clk->mode = (actual_rate == CLK_44EN_RATE) ? 0 : 1; ++ return 0; ++} ++ ++ ++const struct clk_ops clk_allo_dac_rate_ops = { ++ .recalc_rate = clk_allo_dac_recalc_rate, ++ .round_rate = clk_allo_dac_round_rate, ++ .set_rate = clk_allo_dac_set_rate, ++}; ++ ++static int clk_allo_dac_probe(struct platform_device *pdev) ++{ ++ int ret; ++ struct clk_allo_hw *proclk; ++ struct clk *clk; ++ struct device *dev; ++ struct clk_init_data init; ++ ++ dev = &pdev->dev; ++ ++ proclk = kzalloc(sizeof(struct clk_allo_hw), GFP_KERNEL); ++ if (!proclk) ++ return -ENOMEM; ++ ++ init.name = "clk-allo-dac"; ++ init.ops = &clk_allo_dac_rate_ops; ++ init.flags = CLK_IS_ROOT | CLK_IS_BASIC; ++ init.parent_names = NULL; ++ init.num_parents = 0; ++ ++ proclk->mode = 0; ++ proclk->hw.init = &init; ++ ++ clk = devm_clk_register(dev, &proclk->hw); ++ if (!IS_ERR(clk)) { ++ ret = of_clk_add_provider(dev->of_node, of_clk_src_simple_get, ++ clk); ++ } else { ++ dev_err(dev, "Fail to register clock driver\n"); ++ kfree(proclk); ++ ret = PTR_ERR(clk); ++ } ++ return ret; ++} ++ ++static int clk_allo_dac_remove(struct platform_device *pdev) ++{ ++ of_clk_del_provider(pdev->dev.of_node); ++ return 0; ++} ++ ++static struct platform_driver clk_allo_dac_driver = { ++ .probe = clk_allo_dac_probe, ++ .remove = clk_allo_dac_remove, ++ .driver = { ++ .name = "clk-allo-dac", ++ .of_match_table = clk_allo_dac_dt_ids, ++ }, ++}; ++ ++static int __init clk_allo_dac_init(void) ++{ ++ return platform_driver_register(&clk_allo_dac_driver); ++} ++core_initcall(clk_allo_dac_init); ++ ++static void __exit clk_allo_dac_exit(void) ++{ ++ platform_driver_unregister(&clk_allo_dac_driver); ++} ++module_exit(clk_allo_dac_exit); ++ ++MODULE_DESCRIPTION("Allo DAC clock driver"); ++MODULE_LICENSE("GPL v2"); ++MODULE_ALIAS("platform:clk-allo-dac"); +diff --git a/sound/soc/bcm/Kconfig b/sound/soc/bcm/Kconfig +index 4c647abe7504546dbd1d1566f2440cd6ceb12785..76cb7626d7651b144fb268c46f2099b4981a330e 100644 +--- a/sound/soc/bcm/Kconfig ++++ b/sound/soc/bcm/Kconfig +@@ -175,6 +175,14 @@ config SND_BCM2708_SOC_FE_PI_AUDIO + help + Say Y or M if you want to add support for Fe-Pi-Audio. + ++config SND_BCM2708_SOC_ALLO_BOSS_DAC ++ tristate "Support for allo Boss DAC" ++ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S ++ select SND_SOC_PCM512x_I2C ++ help ++ Say Y or M if you want to add support for allo Boss DAC. ++ ++ + config SND_PISOUND + tristate "Support for Blokas Labs pisound" + depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S +diff --git a/sound/soc/bcm/Makefile b/sound/soc/bcm/Makefile +index 54b4111ad820b3f8086867ca2ce86d5339fca93e..72e1620fa4038035804cf3b2a09c6b12e7ae0fe1 100644 +--- a/sound/soc/bcm/Makefile ++++ b/sound/soc/bcm/Makefile +@@ -31,6 +31,7 @@ snd-soc-audioinjector-octo-soundcard-objs := audioinjector-octo-soundcard.o + snd-soc-digidac1-soundcard-objs := digidac1-soundcard.o + snd-soc-dionaudio-loco-objs := dionaudio_loco.o + snd-soc-dionaudio-loco-v2-objs := dionaudio_loco-v2.o ++snd-soc-allo-boss-dac-objs := allo-boss-dac.o + snd-soc-allo-piano-dac-objs := allo-piano-dac.o + snd-soc-allo-piano-dac-plus-objs := allo-piano-dac-plus.o + snd-soc-pisound-objs := pisound.o +@@ -56,6 +57,7 @@ obj-$(CONFIG_SND_AUDIOINJECTOR_OCTO_SOUNDCARD) += snd-soc-audioinjector-octo-sou + obj-$(CONFIG_SND_DIGIDAC1_SOUNDCARD) += snd-soc-digidac1-soundcard.o + obj-$(CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO) += snd-soc-dionaudio-loco.o + obj-$(CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO_V2) += snd-soc-dionaudio-loco-v2.o ++obj-$(CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC) += snd-soc-allo-boss-dac.o + obj-$(CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC) += snd-soc-allo-piano-dac.o + obj-$(CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS) += snd-soc-allo-piano-dac-plus.o + obj-$(CONFIG_SND_PISOUND) += snd-soc-pisound.o +diff --git a/sound/soc/bcm/allo-boss-dac.c b/sound/soc/bcm/allo-boss-dac.c +new file mode 100644 +index 0000000000000000000000000000000000000000..c080e31065d99ab309ab3bdf41a44adfdd8f8039 +--- /dev/null ++++ b/sound/soc/bcm/allo-boss-dac.c +@@ -0,0 +1,374 @@ ++/* ++ * ALSA ASoC Machine Driver for Allo Boss DAC ++ * ++ * Author: Baswaraj K ++ * Copyright 2016 ++ * based on code by Daniel Matuschek, Stuart MacLean ++ * based on code by Florian Meier ++ * ++ * 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. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include "../codecs/pcm512x.h" ++ ++#define ALLO_BOSS_NOCLOCK 0 ++#define ALLO_BOSS_CLK44EN 1 ++#define ALLO_BOSS_CLK48EN 2 ++ ++struct pcm512x_priv { ++ struct regmap *regmap; ++ struct clk *sclk; ++}; ++ ++/* Clock rate of CLK44EN attached to GPIO6 pin */ ++#define CLK_44EN_RATE 45158400UL ++/* Clock rate of CLK48EN attached to GPIO3 pin */ ++#define CLK_48EN_RATE 49152000UL ++ ++static bool slave; ++static bool snd_soc_allo_boss_master; ++static bool digital_gain_0db_limit = true; ++ ++static void snd_allo_boss_select_clk(struct snd_soc_codec *codec, ++ int clk_id) ++{ ++ switch (clk_id) { ++ case ALLO_BOSS_NOCLOCK: ++ snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x24, 0x00); ++ break; ++ case ALLO_BOSS_CLK44EN: ++ snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x24, 0x20); ++ break; ++ case ALLO_BOSS_CLK48EN: ++ snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x24, 0x04); ++ break; ++ } ++} ++ ++static void snd_allo_boss_clk_gpio(struct snd_soc_codec *codec) ++{ ++ snd_soc_update_bits(codec, PCM512x_GPIO_EN, 0x24, 0x24); ++ snd_soc_update_bits(codec, PCM512x_GPIO_OUTPUT_3, 0x0f, 0x02); ++ snd_soc_update_bits(codec, PCM512x_GPIO_OUTPUT_6, 0x0f, 0x02); ++} ++ ++static bool snd_allo_boss_is_sclk(struct snd_soc_codec *codec) ++{ ++ int sck; ++ ++ sck = snd_soc_read(codec, PCM512x_RATE_DET_4); ++ return (!(sck & 0x40)); ++} ++ ++static bool snd_allo_boss_is_sclk_sleep( ++ struct snd_soc_codec *codec) ++{ ++ msleep(2); ++ return snd_allo_boss_is_sclk(codec); ++} ++ ++static bool snd_allo_boss_is_master_card(struct snd_soc_codec *codec) ++{ ++ bool isClk44EN, isClk48En, isNoClk; ++ ++ snd_allo_boss_clk_gpio(codec); ++ ++ snd_allo_boss_select_clk(codec, ALLO_BOSS_CLK44EN); ++ isClk44EN = snd_allo_boss_is_sclk_sleep(codec); ++ ++ snd_allo_boss_select_clk(codec, ALLO_BOSS_NOCLOCK); ++ isNoClk = snd_allo_boss_is_sclk_sleep(codec); ++ ++ snd_allo_boss_select_clk(codec, ALLO_BOSS_CLK48EN); ++ isClk48En = snd_allo_boss_is_sclk_sleep(codec); ++ ++ return (isClk44EN && isClk48En && !isNoClk); ++} ++ ++static int snd_allo_boss_clk_for_rate(int sample_rate) ++{ ++ int type; ++ ++ switch (sample_rate) { ++ case 11025: ++ case 22050: ++ case 44100: ++ case 88200: ++ case 176400: ++ type = ALLO_BOSS_CLK44EN; ++ break; ++ default: ++ type = ALLO_BOSS_CLK48EN; ++ break; ++ } ++ return type; ++} ++ ++static void snd_allo_boss_set_sclk(struct snd_soc_codec *codec, ++ int sample_rate) ++{ ++ struct pcm512x_priv *pcm512x = snd_soc_codec_get_drvdata(codec); ++ ++ if (!IS_ERR(pcm512x->sclk)) { ++ int ctype; ++ ++ ctype = snd_allo_boss_clk_for_rate(sample_rate); ++ clk_set_rate(pcm512x->sclk, (ctype == ALLO_BOSS_CLK44EN) ++ ? CLK_44EN_RATE : CLK_48EN_RATE); ++ snd_allo_boss_select_clk(codec, ctype); ++ } ++} ++ ++static int snd_allo_boss_init(struct snd_soc_pcm_runtime *rtd) ++{ ++ struct snd_soc_codec *codec = rtd->codec; ++ struct pcm512x_priv *priv; ++ ++ if (slave) ++ snd_soc_allo_boss_master = false; ++ else ++ snd_soc_allo_boss_master = ++ snd_allo_boss_is_master_card(codec); ++ ++ if (snd_soc_allo_boss_master) { ++ struct snd_soc_dai_link *dai = rtd->dai_link; ++ ++ dai->name = "BossDAC"; ++ dai->stream_name = "BossDAC"; ++ dai->dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF ++ | SND_SOC_DAIFMT_CBM_CFM; ++ ++ snd_soc_update_bits(codec, PCM512x_BCLK_LRCLK_CFG, 0x31, 0x11); ++ snd_soc_update_bits(codec, PCM512x_MASTER_MODE, 0x03, 0x03); ++ snd_soc_update_bits(codec, PCM512x_MASTER_CLKDIV_2, 0x7f, 63); ++ } else { ++ priv = snd_soc_codec_get_drvdata(codec); ++ priv->sclk = ERR_PTR(-ENOENT); ++ } ++ ++ snd_soc_update_bits(codec, PCM512x_GPIO_EN, 0x08, 0x08); ++ snd_soc_update_bits(codec, PCM512x_GPIO_OUTPUT_4, 0x0f, 0x02); ++ snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08, 0x08); ++ ++ if (digital_gain_0db_limit) { ++ int ret; ++ struct snd_soc_card *card = rtd->card; ++ ++ ret = snd_soc_limit_volume(card, "Digital Playback Volume", ++ 207); ++ if (ret < 0) ++ dev_warn(card->dev, "Failed to set volume limit: %d\n", ++ ret); ++ } ++ ++ return 0; ++} ++ ++static int snd_allo_boss_update_rate_den( ++ struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_codec *codec = rtd->codec; ++ struct pcm512x_priv *pcm512x = snd_soc_codec_get_drvdata(codec); ++ struct snd_ratnum *rats_no_pll; ++ unsigned int num = 0, den = 0; ++ int err; ++ ++ rats_no_pll = devm_kzalloc(rtd->dev, sizeof(*rats_no_pll), GFP_KERNEL); ++ if (!rats_no_pll) ++ return -ENOMEM; ++ ++ rats_no_pll->num = clk_get_rate(pcm512x->sclk) / 64; ++ rats_no_pll->den_min = 1; ++ rats_no_pll->den_max = 128; ++ rats_no_pll->den_step = 1; ++ ++ err = snd_interval_ratnum(hw_param_interval(params, ++ SNDRV_PCM_HW_PARAM_RATE), 1, rats_no_pll, &num, &den); ++ if (err >= 0 && den) { ++ params->rate_num = num; ++ params->rate_den = den; ++ } ++ ++ devm_kfree(rtd->dev, rats_no_pll); ++ return 0; ++} ++ ++static int snd_allo_boss_set_bclk_ratio_pro( ++ struct snd_soc_dai *cpu_dai, struct snd_pcm_hw_params *params) ++{ ++ int bratio = snd_pcm_format_physical_width(params_format(params)) ++ * params_channels(params); ++ return snd_soc_dai_set_bclk_ratio(cpu_dai, bratio); ++} ++ ++static int snd_allo_boss_hw_params( ++ struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) ++{ ++ int ret = 0; ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_dai *cpu_dai = rtd->cpu_dai; ++ unsigned int sample_bits = ++ snd_pcm_format_physical_width(params_format(params)); ++ ++ if (snd_soc_allo_boss_master) { ++ struct snd_soc_codec *codec = rtd->codec; ++ ++ snd_allo_boss_set_sclk(codec, ++ params_rate(params)); ++ ++ ret = snd_allo_boss_set_bclk_ratio_pro(cpu_dai, ++ params); ++ if (!ret) ++ ret = snd_allo_boss_update_rate_den( ++ substream, params); ++ } else { ++ if (snd_allo_boss_is_sclk(rtd->codec)) { ++ snd_soc_update_bits(rtd->codec, PCM512x_PLL_EN, ++ PCM512x_PLLE, 0x01); ++ snd_soc_update_bits(rtd->codec, PCM512x_PLL_REF, ++ PCM512x_SREF, PCM512x_SREF_BCK); ++ dev_dbg(rtd->codec->dev, ++ "Setting BCLK as input clock and Enable PLL\n"); ++ } else { ++ snd_soc_update_bits(rtd->codec, PCM512x_PLL_EN, ++ PCM512x_PLLE, 0x00); ++ snd_soc_update_bits(rtd->codec, PCM512x_PLL_REF, ++ PCM512x_SREF, PCM512x_SREF_SCK); ++ ++ dev_dbg(rtd->codec->dev, ++ "Setting SCLK as input clock and disabled PLL\n"); ++ } ++ ++ ret = snd_soc_dai_set_bclk_ratio(cpu_dai, sample_bits * 2); ++ } ++ return ret; ++} ++ ++static int snd_allo_boss_startup( ++ struct snd_pcm_substream *substream) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_codec *codec = rtd->codec; ++ ++ snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08, 0x08); ++ return 0; ++} ++ ++static void snd_allo_boss_shutdown( ++ struct snd_pcm_substream *substream) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_codec *codec = rtd->codec; ++ ++ snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08, 0x00); ++} ++ ++/* machine stream operations */ ++static struct snd_soc_ops snd_allo_boss_ops = { ++ .hw_params = snd_allo_boss_hw_params, ++ .startup = snd_allo_boss_startup, ++ .shutdown = snd_allo_boss_shutdown, ++}; ++ ++static struct snd_soc_dai_link snd_allo_boss_dai[] = { ++{ ++ .name = "Boss DAC", ++ .stream_name = "Boss DAC HiFi", ++ .cpu_dai_name = "bcm2708-i2s.0", ++ .codec_dai_name = "pcm512x-hifi", ++ .platform_name = "bcm2708-i2s.0", ++ .codec_name = "pcm512x.1-004d", ++ .dai_fmt = SND_SOC_DAIFMT_I2S | ++ SND_SOC_DAIFMT_NB_NF | ++ SND_SOC_DAIFMT_CBS_CFS, ++ .ops = &snd_allo_boss_ops, ++ .init = snd_allo_boss_init, ++}, ++}; ++ ++/* audio machine driver */ ++static struct snd_soc_card snd_allo_boss = { ++ .name = "BossDAC", ++ .owner = THIS_MODULE, ++ .dai_link = snd_allo_boss_dai, ++ .num_links = ARRAY_SIZE(snd_allo_boss_dai), ++}; ++ ++static int snd_allo_boss_probe(struct platform_device *pdev) ++{ ++ int ret = 0; ++ ++ snd_allo_boss.dev = &pdev->dev; ++ ++ if (pdev->dev.of_node) { ++ struct device_node *i2s_node; ++ struct snd_soc_dai_link *dai; ++ ++ dai = &snd_allo_boss_dai[0]; ++ i2s_node = of_parse_phandle(pdev->dev.of_node, ++ "i2s-controller", 0); ++ ++ if (i2s_node) { ++ dai->cpu_dai_name = NULL; ++ dai->cpu_of_node = i2s_node; ++ dai->platform_name = NULL; ++ dai->platform_of_node = i2s_node; ++ } ++ ++ digital_gain_0db_limit = !of_property_read_bool( ++ pdev->dev.of_node, "allo,24db_digital_gain"); ++ slave = of_property_read_bool(pdev->dev.of_node, ++ "allo,slave"); ++ } ++ ++ ret = snd_soc_register_card(&snd_allo_boss); ++ if (ret) ++ dev_err(&pdev->dev, ++ "snd_soc_register_card() failed: %d\n", ret); ++ ++ return ret; ++} ++ ++static int snd_allo_boss_remove(struct platform_device *pdev) ++{ ++ return snd_soc_unregister_card(&snd_allo_boss); ++} ++ ++static const struct of_device_id snd_allo_boss_of_match[] = { ++ { .compatible = "allo,boss-dac", }, ++ { /* sentinel */ }, ++}; ++MODULE_DEVICE_TABLE(of, snd_allo_boss_of_match); ++ ++static struct platform_driver snd_allo_boss_driver = { ++ .driver = { ++ .name = "snd-allo-boss-dac", ++ .owner = THIS_MODULE, ++ .of_match_table = snd_allo_boss_of_match, ++ }, ++ .probe = snd_allo_boss_probe, ++ .remove = snd_allo_boss_remove, ++}; ++ ++module_platform_driver(snd_allo_boss_driver); ++ ++MODULE_AUTHOR("Baswaraj K "); ++MODULE_DESCRIPTION("ALSA ASoC Machine Driver for Allo Boss DAC"); ++MODULE_LICENSE("GPL v2"); + +From f0fe0c0a16c869d7a0a315969ae7ab3232ebd6c8 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 28 Mar 2017 14:22:20 +0100 +Subject: [PATCH 214/218] BCM270X_DT: Allow multiple instances of w1-gpio + overlays + +Upcoming firmware will modify the address portion of node names when +their "reg" property is written by a dtparam. Modify the w1-gpio +overlays to write the gpiopin parameter value to "reg" properties, so +that multiple instances can be loaded simultaneously. + +Note: The value of the "address" is unimportant - the w1 subsystem +assigns instance numbers to buses sequentially from 1, and it is +not necessary to know which bus a device is on in order to find it. +--- + arch/arm/boot/dts/overlays/w1-gpio-overlay.dts | 6 ++++-- + arch/arm/boot/dts/overlays/w1-gpio-pullup-overlay.dts | 6 ++++-- + 2 files changed, 8 insertions(+), 4 deletions(-) + +diff --git a/arch/arm/boot/dts/overlays/w1-gpio-overlay.dts b/arch/arm/boot/dts/overlays/w1-gpio-overlay.dts +index 29a3b48d19ab36b814c09e4cc4eef6d9e2022da1..f7f8747512653465d01dd1c41a0fcbd2e3e5fbdb 100644 +--- a/arch/arm/boot/dts/overlays/w1-gpio-overlay.dts ++++ b/arch/arm/boot/dts/overlays/w1-gpio-overlay.dts +@@ -23,7 +23,7 @@ + fragment@1 { + target = <&gpio>; + __overlay__ { +- w1_pins: w1_pins { ++ w1_pins: w1_pins@0 { + brcm,pins = <4>; + brcm,function = <0>; // in (initially) + brcm,pull = <0>; // off +@@ -33,7 +33,9 @@ + + __overrides__ { + gpiopin = <&w1>,"gpios:4", +- <&w1_pins>,"brcm,pins:0"; ++ <&w1>,"reg:0", ++ <&w1_pins>,"brcm,pins:0", ++ <&w1_pins>,"reg:0"; + pullup = <&w1>,"rpi,parasitic-power:0"; + }; + }; +diff --git a/arch/arm/boot/dts/overlays/w1-gpio-pullup-overlay.dts b/arch/arm/boot/dts/overlays/w1-gpio-pullup-overlay.dts +index 66a98f6c9601f51483f27803995bec772bb3350e..ef8bfbcabdb31231075d5c281df3b38b1b857c7c 100644 +--- a/arch/arm/boot/dts/overlays/w1-gpio-pullup-overlay.dts ++++ b/arch/arm/boot/dts/overlays/w1-gpio-pullup-overlay.dts +@@ -23,7 +23,7 @@ + fragment@1 { + target = <&gpio>; + __overlay__ { +- w1_pins: w1_pins { ++ w1_pins: w1_pins@0 { + brcm,pins = <4 5>; + brcm,function = <0 1>; // in out + brcm,pull = <0 0>; // off off +@@ -33,7 +33,9 @@ + + __overrides__ { + gpiopin = <&w1>,"gpios:4", +- <&w1_pins>,"brcm,pins:0"; ++ <&w1>,"reg:0", ++ <&w1_pins>,"brcm,pins:0", ++ <&w1_pins>,"reg:0"; + extpullup = <&w1>,"gpios:16", + <&w1_pins>,"brcm,pins:4"; + pullup = <&w1>,"rpi,parasitic-power:0"; + +From 5f04b2d8ae6476f42d0d134a6baf169af4f0cefa Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 28 Mar 2017 17:41:30 +0100 +Subject: [PATCH 215/218] leds-gpio: Remove stray assignment to brightness_set + +The brightness_set method is intended for use cases that must not +block, and can only be used if the GPIO provider can never sleep. +Remove an accidental initialisation (a copy-and-paste error) that +sets it regardless, which has been seen to cause crashes with the +gpio expander driver. + +Signed-off-by: Phil Elwell +--- + drivers/leds/leds-gpio.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c +index 6a27a693034825de2897bb7b338b60cc10c9e59f..a6b352cb003ff5e6c87cf6d37d6502b6b7c63e89 100644 +--- a/drivers/leds/leds-gpio.c ++++ b/drivers/leds/leds-gpio.c +@@ -136,7 +136,6 @@ static int create_gpio_led(const struct gpio_led *template, + led_dat->platform_gpio_blink_set = blink_set; + led_dat->cdev.blink_set = gpio_blink_set; + } +- led_dat->cdev.brightness_set = gpio_led_set; + led_dat->cdev.brightness_get = gpio_led_get; + if (template->default_state == LEDS_GPIO_DEFSTATE_KEEP) { + state = gpiod_get_value_cansleep(led_dat->gpiod); + +From 5db062ea8d7a63257abbbfbeadfe7eb338a0643b Mon Sep 17 00:00:00 2001 +From: Matt Flax +Date: Thu, 30 Mar 2017 11:43:57 +1100 +Subject: [PATCH 216/218] Audioinjector Octo : add extra sample rates, fix rst + and use bcm270x regs + +This patch adds new sample rates to the Audioinjector Octo sound card. The +new supported rates are (in kHz) : +96, 48, 32, 24, 16, 8, 88.2, 44.1, 29.4, 22.05, 14.7 + +This patch also replaces the regulators in the device tree overlay with +the ones declared in bcm270x.dtsi include file. + +This patch also adds an extra codec reset and delay on probe. +--- + .../dts/overlays/audioinjector-addons-overlay.dts | 30 +++---------- + sound/soc/bcm/audioinjector-octo-soundcard.c | 50 ++++++++++++++++++++-- + 2 files changed, 52 insertions(+), 28 deletions(-) + +diff --git a/arch/arm/boot/dts/overlays/audioinjector-addons-overlay.dts b/arch/arm/boot/dts/overlays/audioinjector-addons-overlay.dts +index a36fa85a61f7eaab35ca481ed1dac621e2342e6d..a40bb1193a4cebc5672709e8db861e1167d3a699 100644 +--- a/arch/arm/boot/dts/overlays/audioinjector-addons-overlay.dts ++++ b/arch/arm/boot/dts/overlays/audioinjector-addons-overlay.dts +@@ -13,26 +13,6 @@ + }; + + fragment@1 { +- target = <&soc>; +- __overlay__ { +- reg_digital: reg_digital@0 { +- compatible = "regulator-fixed"; +- regulator-name = "cs42448_dig_supply"; +- regulator-min-microvolt = <3300000>; +- regulator-max-microvolt = <3300000>; +- regulator-always-on; +- }; +- reg_analogue: reg_analogue@0 { +- compatible = "regulator-fixed"; +- regulator-name = "cs42448_ana_supply"; +- regulator-min-microvolt = <5000000>; +- regulator-max-microvolt = <5000000>; +- regulator-always-on; +- }; +- }; +- }; +- +- fragment@2 { + target = <&i2c1>; + __overlay__ { + #address-cells = <1>; +@@ -45,10 +25,10 @@ + reg = <0x48>; + clocks = <&cs42448_mclk>; + clock-names = "mclk"; +- VA-supply = <®_analogue>; +- VD-supply = <®_digital>; +- VLS-supply = <®_digital>; +- VLC-supply = <®_digital>; ++ VA-supply = <&vdd_5v0_reg>; ++ VD-supply = <&vdd_3v3_reg>; ++ VLS-supply = <&vdd_3v3_reg>; ++ VLC-supply = <&vdd_3v3_reg>; + status = "okay"; + }; + +@@ -60,7 +40,7 @@ + }; + }; + +- fragment@3 { ++ fragment@2 { + target = <&sound>; + __overlay__ { + compatible = "ai,audioinjector-octo-soundcard"; +diff --git a/sound/soc/bcm/audioinjector-octo-soundcard.c b/sound/soc/bcm/audioinjector-octo-soundcard.c +index 1198c36c4563b8673e5d386d1dfa92d43689e297..dcf403ab37639ba79e38278d7e4b1ade452c292a 100644 +--- a/sound/soc/bcm/audioinjector-octo-soundcard.c ++++ b/sound/soc/bcm/audioinjector-octo-soundcard.c +@@ -31,7 +31,7 @@ static struct gpio_desc *codec_rst_gpio; + static unsigned int audioinjector_octo_rate; + + static const unsigned int audioinjector_octo_rates[] = { +- 96000, 48000, 88200, 44100, ++ 96000, 48000, 32000, 24000, 16000, 8000, 88200, 44100, 29400, 22050, 14700, + }; + + static struct snd_pcm_hw_constraint_list audioinjector_octo_constraints = { +@@ -98,11 +98,33 @@ static int audioinjector_octo_hw_params(struct snd_pcm_substream *substream, + return snd_soc_dai_set_sysclk(rtd->codec_dai, 0, 49152000, + 0); + break; ++ case 24000: ++ return snd_soc_dai_set_sysclk(rtd->codec_dai, 0, 49152000/2, ++ 0); ++ break; ++ case 32000: ++ case 16000: ++ return snd_soc_dai_set_sysclk(rtd->codec_dai, 0, 49152000/3, ++ 0); ++ break; ++ case 8000: ++ return snd_soc_dai_set_sysclk(rtd->codec_dai, 0, 49152000/6, ++ 0); ++ break; + case 88200: + case 44100: + return snd_soc_dai_set_sysclk(rtd->codec_dai, 0, 45185400, + 0); + break; ++ case 22050: ++ return snd_soc_dai_set_sysclk(rtd->codec_dai, 0, 45185400/2, ++ 0); ++ break; ++ case 29400: ++ case 14700: ++ return snd_soc_dai_set_sysclk(rtd->codec_dai, 0, 45185400/3, ++ 0); ++ break; + default: + return -EINVAL; + } +@@ -132,6 +154,25 @@ static int audioinjector_octo_trigger(struct snd_pcm_substream *substream, + case 44100: + mult[2] = 1; + break; ++ case 32000: ++ mult[3] = 1; ++ case 29400: ++ mult[0] = 1; ++ mult[1] = 1; ++ break; ++ case 24000: ++ mult[3] = 1; ++ case 22050: ++ mult[1] = 1; ++ break; ++ case 16000: ++ mult[3] = 1; ++ case 14700: ++ mult[0] = 1; ++ break; ++ case 8000: ++ mult[3] = 1; ++ break; + default: + return -EINVAL; + } +@@ -234,11 +275,14 @@ static int audioinjector_octo_probe(struct platform_device *pdev) + return PTR_ERR(codec_rst_gpio); + + if (codec_rst_gpio) ++ gpiod_set_value(codec_rst_gpio, 1); ++ msleep(500); ++ if (codec_rst_gpio) + gpiod_set_value(codec_rst_gpio, 0); +- msleep(5); ++ msleep(500); + if (codec_rst_gpio) + gpiod_set_value(codec_rst_gpio, 1); +- msleep(50); ++ msleep(500); + + if (i2s_node && codec_node) { + dai->cpu_dai_name = NULL; + +From 19a3cefda797f4596d3a4a1083aa644a9b28a8c7 Mon Sep 17 00:00:00 2001 +From: BabuSubashChandar C +Date: Thu, 30 Mar 2017 20:17:27 +0530 +Subject: [PATCH 217/218] Add support for new clock rate and mute gpios. + +Signed-off-by: Baswaraj K +Reviewed-by: Deepak +Reviewed-by: BabuSubashChandar +--- + .../allo-boss-dac-pcm512x-audio-overlay.dts | 1 + + arch/arm/configs/bcm2709_defconfig | 1 + + drivers/clk/Makefile | 2 +- + drivers/clk/clk-allo-dac-45Mhz.c | 161 --------------------- + drivers/clk/clk-allo-dac.c | 161 +++++++++++++++++++++ + sound/soc/bcm/Kconfig | 4 +- + sound/soc/bcm/allo-boss-dac.c | 145 +++++++++++++++---- + 7 files changed, 282 insertions(+), 193 deletions(-) + delete mode 100644 drivers/clk/clk-allo-dac-45Mhz.c + create mode 100644 drivers/clk/clk-allo-dac.c + +diff --git a/arch/arm/boot/dts/overlays/allo-boss-dac-pcm512x-audio-overlay.dts b/arch/arm/boot/dts/overlays/allo-boss-dac-pcm512x-audio-overlay.dts +index 7df335a3d82f7043d31ba69331cdf3185264d78c..ac1cfe093d9aa8a77ef25cc62a9d8100d81ca684 100644 +--- a/arch/arm/boot/dts/overlays/allo-boss-dac-pcm512x-audio-overlay.dts ++++ b/arch/arm/boot/dts/overlays/allo-boss-dac-pcm512x-audio-overlay.dts +@@ -47,6 +47,7 @@ + boss_dac: __overlay__ { + compatible = "allo,boss-dac"; + i2s-controller = <&i2s>; ++ mute-gpios = <&gpio 6 1>; + status = "okay"; + }; + }; +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 38c52eb831715ec6c2ce3555c7a4d9e5383e35d5..6a95db4edd5680f3c8889a3a41d0589bf33d7f2d 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -894,6 +894,7 @@ CONFIG_SND_AUDIOINJECTOR_OCTO_SOUNDCARD=m + CONFIG_SND_DIGIDAC1_SOUNDCARD=m + CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO=m + CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO_V2=m ++CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC=m + CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC=m + CONFIG_SND_BCM2708_SOC_FE_PI_AUDIO=m + CONFIG_SND_PISOUND=m +diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile +index b1b3cf5d3a09fe8bd38dfed880dd7e6ac0ccc3d7..eb521affd5b7d30290dd6120e32c3c2a0b0b60f0 100644 +--- a/drivers/clk/Makefile ++++ b/drivers/clk/Makefile +@@ -17,7 +17,7 @@ endif + + # hardware specific clock types + # please keep this section sorted lexicographically by file path name +-obj-$(CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC) += clk-allo-dac-45Mhz.o ++obj-$(CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC) += clk-allo-dac.o + obj-$(CONFIG_MACH_ASM9260) += clk-asm9260.o + obj-$(CONFIG_COMMON_CLK_AXI_CLKGEN) += clk-axi-clkgen.o + obj-$(CONFIG_ARCH_AXXIA) += clk-axm5516.o +diff --git a/drivers/clk/clk-allo-dac-45Mhz.c b/drivers/clk/clk-allo-dac-45Mhz.c +deleted file mode 100644 +index d5e9e5b3495cfd2e94fae256f11bc6e0d1f470c6..0000000000000000000000000000000000000000 +--- a/drivers/clk/clk-allo-dac-45Mhz.c ++++ /dev/null +@@ -1,161 +0,0 @@ +-/* +- * Clock Driver for Allo DAC +- * +- * Author: Baswaraj K +- * Copyright 2016 +- * based on code by Stuart MacLean +- * +- * 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. +- * +- * This program is distributed in the hope that it will be useful, but +- * WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- * General Public License for more details. +- */ +- +-#include +-#include +-#include +-#include +-#include +-#include +-#include +- +-/* Clock rate of CLK44EN attached to GPIO6 pin */ +-#define CLK_44EN_RATE 45158400UL +-/* Clock rate of CLK48EN attached to GPIO3 pin */ +-#define CLK_48EN_RATE 49152000UL +- +-/** +- * struct allo_dac_clk - Common struct to the Allo DAC +- * @hw: clk_hw for the common clk framework +- * @mode: 0 => CLK44EN, 1 => CLK48EN +- */ +-struct clk_allo_hw { +- struct clk_hw hw; +- uint8_t mode; +-}; +- +-#define to_allo_clk(_hw) container_of(_hw, struct clk_allo_hw, hw) +- +-static const struct of_device_id clk_allo_dac_dt_ids[] = { +- { .compatible = "allo,dac-clk",}, +- { } +-}; +-MODULE_DEVICE_TABLE(of, clk_allo_dac_dt_ids); +- +-static unsigned long clk_allo_dac_recalc_rate(struct clk_hw *hw, +- unsigned long parent_rate) +-{ +- return (to_allo_clk(hw)->mode == 0) ? CLK_44EN_RATE : +- CLK_48EN_RATE; +-} +- +-static long clk_allo_dac_round_rate(struct clk_hw *hw, +- unsigned long rate, unsigned long *parent_rate) +-{ +- long actual_rate; +- +- if (rate <= CLK_44EN_RATE) { +- actual_rate = (long)CLK_44EN_RATE; +- } else if (rate >= CLK_48EN_RATE) { +- actual_rate = (long)CLK_48EN_RATE; +- } else { +- long diff44Rate = (long)(rate - CLK_44EN_RATE); +- long diff48Rate = (long)(CLK_48EN_RATE - rate); +- +- if (diff44Rate < diff48Rate) +- actual_rate = (long)CLK_44EN_RATE; +- else +- actual_rate = (long)CLK_48EN_RATE; +- } +- return actual_rate; +-} +- +- +-static int clk_allo_dac_set_rate(struct clk_hw *hw, +- unsigned long rate, unsigned long parent_rate) +-{ +- unsigned long actual_rate; +- struct clk_allo_hw *clk = to_allo_clk(hw); +- +- actual_rate = (unsigned long)clk_allo_dac_round_rate(hw, rate, +- &parent_rate); +- clk->mode = (actual_rate == CLK_44EN_RATE) ? 0 : 1; +- return 0; +-} +- +- +-const struct clk_ops clk_allo_dac_rate_ops = { +- .recalc_rate = clk_allo_dac_recalc_rate, +- .round_rate = clk_allo_dac_round_rate, +- .set_rate = clk_allo_dac_set_rate, +-}; +- +-static int clk_allo_dac_probe(struct platform_device *pdev) +-{ +- int ret; +- struct clk_allo_hw *proclk; +- struct clk *clk; +- struct device *dev; +- struct clk_init_data init; +- +- dev = &pdev->dev; +- +- proclk = kzalloc(sizeof(struct clk_allo_hw), GFP_KERNEL); +- if (!proclk) +- return -ENOMEM; +- +- init.name = "clk-allo-dac"; +- init.ops = &clk_allo_dac_rate_ops; +- init.flags = CLK_IS_ROOT | CLK_IS_BASIC; +- init.parent_names = NULL; +- init.num_parents = 0; +- +- proclk->mode = 0; +- proclk->hw.init = &init; +- +- clk = devm_clk_register(dev, &proclk->hw); +- if (!IS_ERR(clk)) { +- ret = of_clk_add_provider(dev->of_node, of_clk_src_simple_get, +- clk); +- } else { +- dev_err(dev, "Fail to register clock driver\n"); +- kfree(proclk); +- ret = PTR_ERR(clk); +- } +- return ret; +-} +- +-static int clk_allo_dac_remove(struct platform_device *pdev) +-{ +- of_clk_del_provider(pdev->dev.of_node); +- return 0; +-} +- +-static struct platform_driver clk_allo_dac_driver = { +- .probe = clk_allo_dac_probe, +- .remove = clk_allo_dac_remove, +- .driver = { +- .name = "clk-allo-dac", +- .of_match_table = clk_allo_dac_dt_ids, +- }, +-}; +- +-static int __init clk_allo_dac_init(void) +-{ +- return platform_driver_register(&clk_allo_dac_driver); +-} +-core_initcall(clk_allo_dac_init); +- +-static void __exit clk_allo_dac_exit(void) +-{ +- platform_driver_unregister(&clk_allo_dac_driver); +-} +-module_exit(clk_allo_dac_exit); +- +-MODULE_DESCRIPTION("Allo DAC clock driver"); +-MODULE_LICENSE("GPL v2"); +-MODULE_ALIAS("platform:clk-allo-dac"); +diff --git a/drivers/clk/clk-allo-dac.c b/drivers/clk/clk-allo-dac.c +new file mode 100644 +index 0000000000000000000000000000000000000000..0baf821d6947ebb757c8ea4594f6c1b04b4e10dd +--- /dev/null ++++ b/drivers/clk/clk-allo-dac.c +@@ -0,0 +1,161 @@ ++/* ++ * Clock Driver for Allo DAC ++ * ++ * Author: Baswaraj K ++ * Copyright 2016 ++ * based on code by Stuart MacLean ++ * ++ * 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. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/* Clock rate of CLK44EN attached to GPIO6 pin */ ++#define CLK_44EN_RATE 45158400UL ++/* Clock rate of CLK48EN attached to GPIO3 pin */ ++#define CLK_48EN_RATE 49152000UL ++ ++/** ++ * struct allo_dac_clk - Common struct to the Allo DAC ++ * @hw: clk_hw for the common clk framework ++ * @mode: 0 => CLK44EN, 1 => CLK48EN ++ */ ++struct clk_allo_hw { ++ struct clk_hw hw; ++ uint8_t mode; ++}; ++ ++#define to_allo_clk(_hw) container_of(_hw, struct clk_allo_hw, hw) ++ ++static const struct of_device_id clk_allo_dac_dt_ids[] = { ++ { .compatible = "allo,dac-clk",}, ++ { } ++}; ++MODULE_DEVICE_TABLE(of, clk_allo_dac_dt_ids); ++ ++static unsigned long clk_allo_dac_recalc_rate(struct clk_hw *hw, ++ unsigned long parent_rate) ++{ ++ return (to_allo_clk(hw)->mode == 0) ? CLK_44EN_RATE : ++ CLK_48EN_RATE; ++} ++ ++static long clk_allo_dac_round_rate(struct clk_hw *hw, ++ unsigned long rate, unsigned long *parent_rate) ++{ ++ long actual_rate; ++ ++ if (rate <= CLK_44EN_RATE) { ++ actual_rate = (long)CLK_44EN_RATE; ++ } else if (rate >= CLK_48EN_RATE) { ++ actual_rate = (long)CLK_48EN_RATE; ++ } else { ++ long diff44Rate = (long)(rate - CLK_44EN_RATE); ++ long diff48Rate = (long)(CLK_48EN_RATE - rate); ++ ++ if (diff44Rate < diff48Rate) ++ actual_rate = (long)CLK_44EN_RATE; ++ else ++ actual_rate = (long)CLK_48EN_RATE; ++ } ++ return actual_rate; ++} ++ ++ ++static int clk_allo_dac_set_rate(struct clk_hw *hw, ++ unsigned long rate, unsigned long parent_rate) ++{ ++ unsigned long actual_rate; ++ struct clk_allo_hw *clk = to_allo_clk(hw); ++ ++ actual_rate = (unsigned long)clk_allo_dac_round_rate(hw, rate, ++ &parent_rate); ++ clk->mode = (actual_rate == CLK_44EN_RATE) ? 0 : 1; ++ return 0; ++} ++ ++ ++const struct clk_ops clk_allo_dac_rate_ops = { ++ .recalc_rate = clk_allo_dac_recalc_rate, ++ .round_rate = clk_allo_dac_round_rate, ++ .set_rate = clk_allo_dac_set_rate, ++}; ++ ++static int clk_allo_dac_probe(struct platform_device *pdev) ++{ ++ int ret; ++ struct clk_allo_hw *proclk; ++ struct clk *clk; ++ struct device *dev; ++ struct clk_init_data init; ++ ++ dev = &pdev->dev; ++ ++ proclk = kzalloc(sizeof(struct clk_allo_hw), GFP_KERNEL); ++ if (!proclk) ++ return -ENOMEM; ++ ++ init.name = "clk-allo-dac"; ++ init.ops = &clk_allo_dac_rate_ops; ++ init.flags = CLK_IS_BASIC; ++ init.parent_names = NULL; ++ init.num_parents = 0; ++ ++ proclk->mode = 0; ++ proclk->hw.init = &init; ++ ++ clk = devm_clk_register(dev, &proclk->hw); ++ if (!IS_ERR(clk)) { ++ ret = of_clk_add_provider(dev->of_node, of_clk_src_simple_get, ++ clk); ++ } else { ++ dev_err(dev, "Fail to register clock driver\n"); ++ kfree(proclk); ++ ret = PTR_ERR(clk); ++ } ++ return ret; ++} ++ ++static int clk_allo_dac_remove(struct platform_device *pdev) ++{ ++ of_clk_del_provider(pdev->dev.of_node); ++ return 0; ++} ++ ++static struct platform_driver clk_allo_dac_driver = { ++ .probe = clk_allo_dac_probe, ++ .remove = clk_allo_dac_remove, ++ .driver = { ++ .name = "clk-allo-dac", ++ .of_match_table = clk_allo_dac_dt_ids, ++ }, ++}; ++ ++static int __init clk_allo_dac_init(void) ++{ ++ return platform_driver_register(&clk_allo_dac_driver); ++} ++core_initcall(clk_allo_dac_init); ++ ++static void __exit clk_allo_dac_exit(void) ++{ ++ platform_driver_unregister(&clk_allo_dac_driver); ++} ++module_exit(clk_allo_dac_exit); ++ ++MODULE_DESCRIPTION("Allo DAC clock driver"); ++MODULE_LICENSE("GPL v2"); ++MODULE_ALIAS("platform:clk-allo-dac"); +diff --git a/sound/soc/bcm/Kconfig b/sound/soc/bcm/Kconfig +index 76cb7626d7651b144fb268c46f2099b4981a330e..ede81ecbfa2ac6e0430768ddf31cb957201eb3fd 100644 +--- a/sound/soc/bcm/Kconfig ++++ b/sound/soc/bcm/Kconfig +@@ -176,11 +176,11 @@ config SND_BCM2708_SOC_FE_PI_AUDIO + Say Y or M if you want to add support for Fe-Pi-Audio. + + config SND_BCM2708_SOC_ALLO_BOSS_DAC +- tristate "Support for allo Boss DAC" ++ tristate "Support for Allo Boss DAC" + depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S + select SND_SOC_PCM512x_I2C + help +- Say Y or M if you want to add support for allo Boss DAC. ++ Say Y or M if you want to add support for Allo Boss DAC. + + + config SND_PISOUND +diff --git a/sound/soc/bcm/allo-boss-dac.c b/sound/soc/bcm/allo-boss-dac.c +index c080e31065d99ab309ab3bdf41a44adfdd8f8039..203ab76c7045b081578e23bda1099dd103d11154 100644 +--- a/sound/soc/bcm/allo-boss-dac.c ++++ b/sound/soc/bcm/allo-boss-dac.c +@@ -2,8 +2,9 @@ + * ALSA ASoC Machine Driver for Allo Boss DAC + * + * Author: Baswaraj K +- * Copyright 2016 +- * based on code by Daniel Matuschek, Stuart MacLean ++ * Copyright 2017 ++ * based on code by Daniel Matuschek, ++ * Stuart MacLean + * based on code by Florian Meier + * + * This program is free software; you can redistribute it and/or +@@ -17,6 +18,7 @@ + */ + + #include ++#include + #include + #include + #include +@@ -36,6 +38,8 @@ struct pcm512x_priv { + struct clk *sclk; + }; + ++static struct gpio_desc *mute_gpio; ++ + /* Clock rate of CLK44EN attached to GPIO6 pin */ + #define CLK_44EN_RATE 45158400UL + /* Clock rate of CLK48EN attached to GPIO3 pin */ +@@ -111,6 +115,7 @@ static int snd_allo_boss_clk_for_rate(int sample_rate) + case 44100: + case 88200: + case 176400: ++ case 352800: + type = ALLO_BOSS_CLK44EN; + break; + default: +@@ -138,7 +143,7 @@ static void snd_allo_boss_set_sclk(struct snd_soc_codec *codec, + static int snd_allo_boss_init(struct snd_soc_pcm_runtime *rtd) + { + struct snd_soc_codec *codec = rtd->codec; +- struct pcm512x_priv *priv; ++ struct pcm512x_priv *priv = snd_soc_codec_get_drvdata(codec); + + if (slave) + snd_soc_allo_boss_master = false; +@@ -150,15 +155,22 @@ static int snd_allo_boss_init(struct snd_soc_pcm_runtime *rtd) + struct snd_soc_dai_link *dai = rtd->dai_link; + + dai->name = "BossDAC"; +- dai->stream_name = "BossDAC"; ++ dai->stream_name = "Boss DAC HiFi [Master]"; + dai->dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF + | SND_SOC_DAIFMT_CBM_CFM; + + snd_soc_update_bits(codec, PCM512x_BCLK_LRCLK_CFG, 0x31, 0x11); + snd_soc_update_bits(codec, PCM512x_MASTER_MODE, 0x03, 0x03); + snd_soc_update_bits(codec, PCM512x_MASTER_CLKDIV_2, 0x7f, 63); ++ /* ++ * Default sclk to CLK_48EN_RATE, otherwise codec ++ * pcm512x_dai_startup_master method could call ++ * snd_pcm_hw_constraint_ratnums using CLK_44EN/64 ++ * which will mask 384k sample rate. ++ */ ++ if (!IS_ERR(priv->sclk)) ++ clk_set_rate(priv->sclk, CLK_48EN_RATE); + } else { +- priv = snd_soc_codec_get_drvdata(codec); + priv->sclk = ERR_PTR(-ENOENT); + } + +@@ -218,6 +230,52 @@ static int snd_allo_boss_set_bclk_ratio_pro( + return snd_soc_dai_set_bclk_ratio(cpu_dai, bratio); + } + ++static void snd_allo_boss_gpio_mute(struct snd_soc_card *card) ++{ ++ if (mute_gpio) ++ gpiod_set_value_cansleep(mute_gpio, 1); ++} ++ ++static void snd_allo_boss_gpio_unmute(struct snd_soc_card *card) ++{ ++ if (mute_gpio) ++ gpiod_set_value_cansleep(mute_gpio, 0); ++} ++ ++static int snd_allo_boss_set_bias_level(struct snd_soc_card *card, ++ struct snd_soc_dapm_context *dapm, enum snd_soc_bias_level level) ++{ ++ struct snd_soc_pcm_runtime *rtd; ++ struct snd_soc_dai *codec_dai; ++ ++ rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); ++ codec_dai = rtd->codec_dai; ++ ++ if (dapm->dev != codec_dai->dev) ++ return 0; ++ ++ switch (level) { ++ case SND_SOC_BIAS_PREPARE: ++ if (dapm->bias_level != SND_SOC_BIAS_STANDBY) ++ break; ++ /* UNMUTE DAC */ ++ snd_allo_boss_gpio_unmute(card); ++ break; ++ ++ case SND_SOC_BIAS_STANDBY: ++ if (dapm->bias_level != SND_SOC_BIAS_PREPARE) ++ break; ++ /* MUTE DAC */ ++ snd_allo_boss_gpio_mute(card); ++ break; ++ ++ default: ++ break; ++ } ++ ++ return 0; ++} ++ + static int snd_allo_boss_hw_params( + struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) + { +@@ -239,23 +297,6 @@ static int snd_allo_boss_hw_params( + ret = snd_allo_boss_update_rate_den( + substream, params); + } else { +- if (snd_allo_boss_is_sclk(rtd->codec)) { +- snd_soc_update_bits(rtd->codec, PCM512x_PLL_EN, +- PCM512x_PLLE, 0x01); +- snd_soc_update_bits(rtd->codec, PCM512x_PLL_REF, +- PCM512x_SREF, PCM512x_SREF_BCK); +- dev_dbg(rtd->codec->dev, +- "Setting BCLK as input clock and Enable PLL\n"); +- } else { +- snd_soc_update_bits(rtd->codec, PCM512x_PLL_EN, +- PCM512x_PLLE, 0x00); +- snd_soc_update_bits(rtd->codec, PCM512x_PLL_REF, +- PCM512x_SREF, PCM512x_SREF_SCK); +- +- dev_dbg(rtd->codec->dev, +- "Setting SCLK as input clock and disabled PLL\n"); +- } +- + ret = snd_soc_dai_set_bclk_ratio(cpu_dai, sample_bits * 2); + } + return ret; +@@ -266,8 +307,23 @@ static int snd_allo_boss_startup( + { + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_codec *codec = rtd->codec; ++ struct snd_soc_card *card = rtd->card; + + snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08, 0x08); ++ snd_allo_boss_gpio_mute(card); ++ ++ if (snd_soc_allo_boss_master) { ++ struct pcm512x_priv *priv = snd_soc_codec_get_drvdata(codec); ++ /* ++ * Default sclk to CLK_48EN_RATE, otherwise codec ++ * pcm512x_dai_startup_master method could call ++ * snd_pcm_hw_constraint_ratnums using CLK_44EN/64 ++ * which will mask 384k sample rate. ++ */ ++ if (!IS_ERR(priv->sclk)) ++ clk_set_rate(priv->sclk, CLK_48EN_RATE); ++ } ++ + return 0; + } + +@@ -280,11 +336,21 @@ static void snd_allo_boss_shutdown( + snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08, 0x00); + } + ++static int snd_allo_boss_prepare( ++ struct snd_pcm_substream *substream) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_card *card = rtd->card; ++ ++ snd_allo_boss_gpio_unmute(card); ++ return 0; ++} + /* machine stream operations */ + static struct snd_soc_ops snd_allo_boss_ops = { + .hw_params = snd_allo_boss_hw_params, + .startup = snd_allo_boss_startup, + .shutdown = snd_allo_boss_shutdown, ++ .prepare = snd_allo_boss_prepare, + }; + + static struct snd_soc_dai_link snd_allo_boss_dai[] = { +@@ -335,19 +401,40 @@ static int snd_allo_boss_probe(struct platform_device *pdev) + digital_gain_0db_limit = !of_property_read_bool( + pdev->dev.of_node, "allo,24db_digital_gain"); + slave = of_property_read_bool(pdev->dev.of_node, +- "allo,slave"); +- } ++ "allo,slave"); ++ ++ mute_gpio = devm_gpiod_get_optional(&pdev->dev, "mute", ++ GPIOD_OUT_LOW); ++ if (IS_ERR(mute_gpio)) { ++ ret = PTR_ERR(mute_gpio); ++ dev_err(&pdev->dev, ++ "failed to get mute gpio: %d\n", ret); ++ return ret; ++ } + +- ret = snd_soc_register_card(&snd_allo_boss); +- if (ret) +- dev_err(&pdev->dev, +- "snd_soc_register_card() failed: %d\n", ret); ++ if (mute_gpio) ++ snd_allo_boss.set_bias_level = ++ snd_allo_boss_set_bias_level; + +- return ret; ++ ret = snd_soc_register_card(&snd_allo_boss); ++ if (ret) { ++ dev_err(&pdev->dev, ++ "snd_soc_register_card() failed: %d\n", ret); ++ return ret; ++ } ++ ++ if (mute_gpio) ++ snd_allo_boss_gpio_mute(&snd_allo_boss); ++ ++ return 0; ++ } ++ ++ return -EINVAL; + } + + static int snd_allo_boss_remove(struct platform_device *pdev) + { ++ snd_allo_boss_gpio_mute(&snd_allo_boss); + return snd_soc_unregister_card(&snd_allo_boss); + } + + +From a279188d3efbc8900336ef484536247513ecf472 Mon Sep 17 00:00:00 2001 +From: BabuSubashChandar +Date: Sat, 1 Apr 2017 00:46:52 +0530 +Subject: [PATCH 218/218] Add clock changes and mute gpios (#1938) + +Also improve code style and adhere to ALSA coding conventions. + +Signed-off-by: Baswaraj K +Reviewed-by: Vijay Kumar B. +Reviewed-by: Raashid Muhammed +--- + arch/arm/boot/dts/overlays/README | 3 + + .../allo-piano-dac-plus-pcm512x-audio-overlay.dts | 12 +- + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 2 + + sound/soc/bcm/allo-piano-dac-plus.c | 338 +++++++++++++++++---- + 5 files changed, 291 insertions(+), 65 deletions(-) + +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index c9e954253a6318dbd2605b93026c04974b3271bd..1377e5b8e8363c3e0ede318ce54bd784cb70d4c9 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -323,6 +323,9 @@ Params: 24db_digital_gain Allow gain to be applied via the PCM512x codec + responsibility of the user to ensure that + the Digital volume control is set to a value + that does not result in clipping/distortion!) ++ glb_mclk This option is only with Kali board. If enabled, ++ MCLK for Kali is used and PLL is disabled for ++ better voice quality. (default Off) + + + Name: at86rf233 +diff --git a/arch/arm/boot/dts/overlays/allo-piano-dac-plus-pcm512x-audio-overlay.dts b/arch/arm/boot/dts/overlays/allo-piano-dac-plus-pcm512x-audio-overlay.dts +index 6943b55ca5f96097668e2d10c05f56a26be62b0a..5c1c81c427a8b396ca9e9c903e97f2711850d4c6 100644 +--- a/arch/arm/boot/dts/overlays/allo-piano-dac-plus-pcm512x-audio-overlay.dts ++++ b/arch/arm/boot/dts/overlays/allo-piano-dac-plus-pcm512x-audio-overlay.dts +@@ -19,13 +19,13 @@ + #size-cells = <0>; + status = "okay"; + +- pcm5122_4c: pcm5122@4c { ++ allo_pcm5122_4c: pcm5122@4c { + #sound-dai-cells = <0>; + compatible = "ti,pcm5122"; + reg = <0x4c>; + status = "okay"; + }; +- pcm5122_4d: pcm5122@4d { ++ allo_pcm5122_4d: pcm5122@4d { + #sound-dai-cells = <0>; + compatible = "ti,pcm5122"; + reg = <0x4d>; +@@ -38,14 +38,18 @@ + target = <&sound>; + piano_dac: __overlay__ { + compatible = "allo,piano-dac-plus"; +- audio-codec = <&pcm5122_4c &pcm5122_4d>; ++ audio-codec = <&allo_pcm5122_4c &allo_pcm5122_4d>; + i2s-controller = <&i2s>; ++ mute1-gpios = <&gpio 6 1>; ++ mute2-gpios = <&gpio 25 1>; + status = "okay"; + }; + }; + + __overrides__ { + 24db_digital_gain = +- <&piano_dac>,"piano,24db_digital_gain?"; ++ <&piano_dac>,"allo,24db_digital_gain?"; ++ glb_mclk = ++ <&piano_dac>,"allo,glb_mclk?"; + }; + }; +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 6a95db4edd5680f3c8889a3a41d0589bf33d7f2d..6290adaf6b07e8b9aacc72343dc67f4cfd6f1a97 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -896,6 +896,7 @@ CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO=m + CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO_V2=m + CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC=m + CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC=m ++CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS=m + CONFIG_SND_BCM2708_SOC_FE_PI_AUDIO=m + CONFIG_SND_PISOUND=m + CONFIG_SND_SOC_ADAU1701=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index c46b86dda8ade97cfa5589106e77d75e241147e0..fd535ff21e7dab6717eb61f1b966b7d92791ec8d 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -887,7 +887,9 @@ CONFIG_SND_AUDIOINJECTOR_OCTO_SOUNDCARD=m + CONFIG_SND_DIGIDAC1_SOUNDCARD=m + CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO=m + CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO_V2=m ++CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC=m + CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC=m ++CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS=m + CONFIG_SND_BCM2708_SOC_FE_PI_AUDIO=m + CONFIG_SND_PISOUND=m + CONFIG_SND_SOC_ADAU1701=m +diff --git a/sound/soc/bcm/allo-piano-dac-plus.c b/sound/soc/bcm/allo-piano-dac-plus.c +index f66f42abadbd5f9d3fe000676e8297ed91630e47..56e43f98846b41e487b3089813f7edc3c08517eb 100644 +--- a/sound/soc/bcm/allo-piano-dac-plus.c ++++ b/sound/soc/bcm/allo-piano-dac-plus.c +@@ -18,7 +18,7 @@ + + #include + #include +- ++#include + #include + #include + #include +@@ -34,9 +34,19 @@ struct dsp_code { + char val; + }; + +-static struct snd_soc_pcm_runtime *rtd_glb; ++struct glb_pool { ++ struct mutex lock; ++ unsigned int set_lowpass; ++ unsigned int set_mode; ++ unsigned int set_rate; ++ unsigned int dsp_page_number; ++}; ++ + static bool digital_gain_0db_limit = true; +-unsigned int set_lowpass, set_mode, set_rate, dsp_page_number; ++bool glb_mclk; ++ ++static struct gpio_desc *mute_gpio[2]; ++ + + static const char * const allo_piano_mode_texts[] = { + "2.0", +@@ -68,12 +78,14 @@ static const char * const allo_piano_dsp_low_pass_texts[] = { + static const SOC_ENUM_SINGLE_DECL(allo_piano_enum, + 0, 0, allo_piano_dsp_low_pass_texts); + +-static int snd_allo_piano_dsp_program(struct snd_soc_pcm_runtime *rtd, ++static int __snd_allo_piano_dsp_program(struct snd_soc_pcm_runtime *rtd, + unsigned int mode, unsigned int rate, unsigned int lowpass) + { + const struct firmware *fw; +- char firmware_name[40]; ++ char firmware_name[60]; + int ret = 0, dac = 0; ++ struct snd_soc_card *card = rtd->card; ++ struct glb_pool *glb_ptr = card->drvdata; + + if (rate <= 46000) + rate = 44100; +@@ -88,47 +100,51 @@ static int snd_allo_piano_dsp_program(struct snd_soc_pcm_runtime *rtd, + else + rate = 192000; + +- /* same configuration loaded */ +- if ((rate == set_rate) && (lowpass == set_lowpass) +- && (mode == set_mode)) +- return 1; ++ if ((lowpass > 14) || (lowpass < 0)) ++ lowpass = 3; ++ if ((mode > 2) || (mode < 0)) ++ mode = 0; + +- set_rate = rate; +- set_mode = mode; ++ /* same configuration loaded */ ++ if ((rate == glb_ptr->set_rate) && (lowpass == glb_ptr->set_lowpass) ++ && (mode == glb_ptr->set_mode)) ++ return 0; + + if (mode == 0) { /* 2.0 */ + snd_soc_write(rtd->codec_dais[1]->codec, +- PCM512x_MUTE, 0x11); ++ PCM512x_MUTE, 0x11); ++ glb_ptr->set_rate = rate; ++ glb_ptr->set_mode = mode; ++ glb_ptr->set_lowpass = lowpass; + return 1; + } else { + snd_soc_write(rtd->codec_dais[1]->codec, +- PCM512x_MUTE, 0x00); ++ PCM512x_MUTE, 0x00); + } + +- set_lowpass = lowpass; +- + for (dac = 0; dac < rtd->num_codecs; dac++) { + struct dsp_code *dsp_code_read; +- int i = 1; + struct snd_soc_codec *codec = rtd->codec_dais[dac]->codec; ++ int i = 1; + + if (dac == 0) { /* high */ + sprintf(firmware_name, +- "alloPiano/2.2/allo-piano-dsp-%d-%d-%d.bin", +- rate, ((set_lowpass * 10) + 60), dac); ++ "allo/piano/2.2/allo-piano-dsp-%d-%d-%d.bin", ++ rate, ((lowpass * 10) + 60), dac); + } else { /* low */ + sprintf(firmware_name, +- "alloPiano/2.%d/allo-piano-dsp-%d-%d-%d.bin", +- set_mode, rate, ((set_lowpass * 10) + 60), dac); ++ "allo/piano/2.%d/allo-piano-dsp-%d-%d-%d.bin", ++ mode, rate, ((lowpass * 10) + 60), dac); + } + + dev_info(codec->dev, "Dsp Firmware File Name: %s\n", +- firmware_name); ++ firmware_name); + + ret = request_firmware(&fw, firmware_name, codec->dev); + if (ret < 0) { +- dev_err(codec->dev, "Error: AlloPiano Firmware %s missing. %d\n", +- firmware_name, ret); ++ dev_err(codec->dev, ++ "Error: Allo Piano Firmware %s missing. %d\n", ++ firmware_name, ret); + goto err; + } + +@@ -136,62 +152,97 @@ static int snd_allo_piano_dsp_program(struct snd_soc_pcm_runtime *rtd, + dsp_code_read = (struct dsp_code *)&fw->data[i]; + + if (dsp_code_read->offset == 0) { +- dsp_page_number = dsp_code_read->val; ++ glb_ptr->dsp_page_number = dsp_code_read->val; + ret = snd_soc_write(rtd->codec_dais[dac]->codec, + PCM512x_PAGE_BASE(0), + dsp_code_read->val); + + } else if (dsp_code_read->offset != 0) { + ret = snd_soc_write(rtd->codec_dais[dac]->codec, +- (PCM512x_PAGE_BASE(dsp_page_number) + ++ (PCM512x_PAGE_BASE( ++ glb_ptr->dsp_page_number) + + dsp_code_read->offset), + dsp_code_read->val); +- + } + if (ret < 0) { + dev_err(codec->dev, + "Failed to write Register: %d\n", ret); ++ release_firmware(fw); + goto err; + } + i = i + 3; + } + release_firmware(fw); + } ++ glb_ptr->set_rate = rate; ++ glb_ptr->set_mode = mode; ++ glb_ptr->set_lowpass = lowpass; + return 1; + + err: +- release_firmware(fw); ++ return ret; ++} ++ ++static int snd_allo_piano_dsp_program(struct snd_soc_pcm_runtime *rtd, ++ unsigned int mode, unsigned int rate, unsigned int lowpass) ++{ ++ struct snd_soc_card *card = rtd->card; ++ struct glb_pool *glb_ptr = card->drvdata; ++ int ret = 0; ++ ++ mutex_lock(&glb_ptr->lock); ++ ++ ret = __snd_allo_piano_dsp_program(rtd, ++ mode, rate, lowpass); ++ mutex_unlock(&glb_ptr->lock); ++ + return ret; + } + + static int snd_allo_piano_mode_get(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) + { +- ucontrol->value.integer.value[0] = set_mode; ++ struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); ++ struct glb_pool *glb_ptr = card->drvdata; ++ ++ ucontrol->value.integer.value[0] = glb_ptr->set_mode; + return 0; + } + + static int snd_allo_piano_mode_put(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) + { +- return(snd_allo_piano_dsp_program(rtd_glb, +- ucontrol->value.integer.value[0], +- set_rate, set_lowpass)); ++ struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); ++ struct snd_soc_pcm_runtime *rtd; ++ struct glb_pool *glb_ptr = card->drvdata; ++ ++ rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); ++ return(snd_allo_piano_dsp_program(rtd, ++ ucontrol->value.integer.value[0], ++ glb_ptr->set_rate, glb_ptr->set_lowpass)); + } + + static int snd_allo_piano_lowpass_get(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) + { +- ucontrol->value.integer.value[0] = set_lowpass; ++ struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); ++ struct glb_pool *glb_ptr = card->drvdata; ++ ++ ucontrol->value.integer.value[0] = glb_ptr->set_lowpass; + return 0; + } + + static int snd_allo_piano_lowpass_put(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) + { +- return(snd_allo_piano_dsp_program(rtd_glb, +- set_mode, set_rate, +- ucontrol->value.integer.value[0])); ++ struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); ++ struct snd_soc_pcm_runtime *rtd; ++ struct glb_pool *glb_ptr = card->drvdata; ++ ++ rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); ++ return(snd_allo_piano_dsp_program(rtd, ++ glb_ptr->set_mode, glb_ptr->set_rate, ++ ucontrol->value.integer.value[0])); + } + + static int pcm512x_get_reg_sub(struct snd_kcontrol *kcontrol, +@@ -199,15 +250,18 @@ static int pcm512x_get_reg_sub(struct snd_kcontrol *kcontrol, + { + struct soc_mixer_control *mc = + (struct soc_mixer_control *)kcontrol->private_value; ++ struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); ++ struct snd_soc_pcm_runtime *rtd; + unsigned int left_val = 0; + unsigned int right_val = 0; + +- left_val = snd_soc_read(rtd_glb->codec_dais[1]->codec, ++ rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); ++ left_val = snd_soc_read(rtd->codec_dais[1]->codec, + PCM512x_DIGITAL_VOLUME_2); + if (left_val < 0) + return left_val; + +- right_val = snd_soc_read(rtd_glb->codec_dais[1]->codec, ++ right_val = snd_soc_read(rtd->codec_dais[1]->codec, + PCM512x_DIGITAL_VOLUME_3); + if (right_val < 0) + return right_val; +@@ -225,16 +279,19 @@ static int pcm512x_set_reg_sub(struct snd_kcontrol *kcontrol, + { + struct soc_mixer_control *mc = + (struct soc_mixer_control *)kcontrol->private_value; ++ struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); ++ struct snd_soc_pcm_runtime *rtd; + unsigned int left_val = (ucontrol->value.integer.value[0] & mc->max); + unsigned int right_val = (ucontrol->value.integer.value[1] & mc->max); + int ret = 0; + +- ret = snd_soc_write(rtd_glb->codec_dais[1]->codec, ++ rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); ++ ret = snd_soc_write(rtd->codec_dais[1]->codec, + PCM512x_DIGITAL_VOLUME_2, (~left_val)); + if (ret < 0) + return ret; + +- ret = snd_soc_write(rtd_glb->codec_dais[1]->codec, ++ ret = snd_soc_write(rtd->codec_dais[1]->codec, + PCM512x_DIGITAL_VOLUME_3, (~right_val)); + if (ret < 0) + return ret; +@@ -245,9 +302,12 @@ static int pcm512x_set_reg_sub(struct snd_kcontrol *kcontrol, + static int pcm512x_get_reg_sub_switch(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) + { ++ struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); ++ struct snd_soc_pcm_runtime *rtd; + int val = 0; + +- val = snd_soc_read(rtd_glb->codec_dais[1]->codec, PCM512x_MUTE); ++ rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); ++ val = snd_soc_read(rtd->codec_dais[1]->codec, PCM512x_MUTE); + if (val < 0) + return val; + +@@ -260,11 +320,14 @@ static int pcm512x_get_reg_sub_switch(struct snd_kcontrol *kcontrol, + static int pcm512x_set_reg_sub_switch(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) + { ++ struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); ++ struct snd_soc_pcm_runtime *rtd; + unsigned int left_val = (ucontrol->value.integer.value[0]); + unsigned int right_val = (ucontrol->value.integer.value[1]); + int ret = 0; + +- ret = snd_soc_write(rtd_glb->codec_dais[1]->codec, PCM512x_MUTE, ++ rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); ++ ret = snd_soc_write(rtd->codec_dais[1]->codec, PCM512x_MUTE, + ~((left_val & 0x01)<<4 | (right_val & 0x01))); + if (ret < 0) + return ret; +@@ -276,23 +339,23 @@ static int pcm512x_set_reg_sub_switch(struct snd_kcontrol *kcontrol, + static const DECLARE_TLV_DB_SCALE(digital_tlv_sub, -10350, 50, 1); + + static const struct snd_kcontrol_new allo_piano_controls[] = { +- SOC_ENUM_EXT("Subwoofer mode", ++ SOC_ENUM_EXT("Subwoofer mode Route", + allo_piano_mode_enum, + snd_allo_piano_mode_get, + snd_allo_piano_mode_put), + +- SOC_ENUM_EXT("Lowpass", allo_piano_enum, ++ SOC_ENUM_EXT("Lowpass Route", allo_piano_enum, + snd_allo_piano_lowpass_get, + snd_allo_piano_lowpass_put), + +- SOC_DOUBLE_R_EXT_TLV("Subwoofer Digital Playback Volume", ++ SOC_DOUBLE_R_EXT_TLV("Subwoofer Playback Volume", + PCM512x_DIGITAL_VOLUME_2, + PCM512x_DIGITAL_VOLUME_3, 0, 255, 1, + pcm512x_get_reg_sub, + pcm512x_set_reg_sub, + digital_tlv_sub), + +- SOC_DOUBLE_EXT("Subwoofer Digital Playback Switch", ++ SOC_DOUBLE_EXT("Subwoofer Playback Switch", + PCM512x_MUTE, + PCM512x_RQML_SHIFT, + PCM512x_RQMR_SHIFT, 1, 1, +@@ -302,11 +365,20 @@ static const struct snd_kcontrol_new allo_piano_controls[] = { + + static int snd_allo_piano_dac_init(struct snd_soc_pcm_runtime *rtd) + { +- rtd_glb = rtd; ++ struct snd_soc_card *card = rtd->card; ++ struct glb_pool *glb_ptr; ++ ++ glb_ptr = kmalloc(sizeof(struct glb_pool), GFP_KERNEL); ++ if (!glb_ptr) ++ return -ENOMEM; ++ ++ memset(glb_ptr, 0x00, sizeof(glb_ptr)); ++ card->drvdata = glb_ptr; ++ ++ mutex_init(&glb_ptr->lock); + + if (digital_gain_0db_limit) { + int ret; +- struct snd_soc_card *card = rtd->card; + + ret = snd_soc_limit_volume(card, "Digital Playback Volume", + 207); +@@ -318,7 +390,71 @@ static int snd_allo_piano_dac_init(struct snd_soc_pcm_runtime *rtd) + return 0; + } + +-static int snd_allo_piano_dac_hw_params(struct snd_pcm_substream *substream, ++static void snd_allo_piano_gpio_mute(struct snd_soc_card *card) ++{ ++ if (mute_gpio[0]) ++ gpiod_set_value_cansleep(mute_gpio[0], 1); ++ ++ if (mute_gpio[1]) ++ gpiod_set_value_cansleep(mute_gpio[1], 1); ++} ++ ++static void snd_allo_piano_gpio_unmute(struct snd_soc_card *card) ++{ ++ if (mute_gpio[0]) ++ gpiod_set_value_cansleep(mute_gpio[0], 0); ++ ++ if (mute_gpio[1]) ++ gpiod_set_value_cansleep(mute_gpio[1], 0); ++} ++ ++static int snd_allo_piano_set_bias_level(struct snd_soc_card *card, ++ struct snd_soc_dapm_context *dapm, enum snd_soc_bias_level level) ++{ ++ struct snd_soc_pcm_runtime *rtd; ++ struct snd_soc_dai *codec_dai; ++ ++ rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); ++ codec_dai = rtd->codec_dai; ++ ++ if (dapm->dev != codec_dai->dev) ++ return 0; ++ ++ switch (level) { ++ case SND_SOC_BIAS_PREPARE: ++ if (dapm->bias_level != SND_SOC_BIAS_STANDBY) ++ break; ++ /* UNMUTE DAC */ ++ snd_allo_piano_gpio_unmute(card); ++ break; ++ ++ case SND_SOC_BIAS_STANDBY: ++ if (dapm->bias_level != SND_SOC_BIAS_PREPARE) ++ break; ++ /* MUTE DAC */ ++ snd_allo_piano_gpio_mute(card); ++ break; ++ ++ default: ++ break; ++ } ++ ++ return 0; ++} ++ ++static int snd_allo_piano_dac_startup( ++ struct snd_pcm_substream *substream) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_card *card = rtd->card; ++ ++ snd_allo_piano_gpio_mute(card); ++ ++ return 0; ++} ++ ++static int snd_allo_piano_dac_hw_params( ++ struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params) + { + struct snd_soc_pcm_runtime *rtd = substream->private_data; +@@ -327,17 +463,49 @@ static int snd_allo_piano_dac_hw_params(struct snd_pcm_substream *substream, + snd_pcm_format_physical_width(params_format(params)); + unsigned int rate = params_rate(params); + struct snd_soc_card *card = rtd->card; +- int ret = 0; ++ struct glb_pool *glb_ptr = card->drvdata; ++ int ret = 0, val = 0, dac; ++ ++ for (dac = 0; (glb_mclk && dac < 2); dac++) { ++ /* Configure the PLL clock reference for both the Codecs */ ++ val = snd_soc_read(rtd->codec_dais[dac]->codec, ++ PCM512x_RATE_DET_4); ++ if (val < 0) { ++ dev_err(rtd->codec_dais[dac]->codec->dev, ++ "Failed to read register PCM512x_RATE_DET_4\n"); ++ return val; ++ } ++ ++ if (val & 0x40) { ++ snd_soc_write(rtd->codec_dais[dac]->codec, ++ PCM512x_PLL_REF, ++ PCM512x_SREF_BCK); ++ ++ dev_info(rtd->codec_dais[dac]->codec->dev, ++ "Setting BCLK as input clock & Enable PLL\n"); ++ } else { ++ snd_soc_write(rtd->codec_dais[dac]->codec, ++ PCM512x_PLL_EN, ++ 0x00); ++ ++ snd_soc_write(rtd->codec_dais[dac]->codec, ++ PCM512x_PLL_REF, ++ PCM512x_SREF_SCK); ++ ++ dev_info(rtd->codec_dais[dac]->codec->dev, ++ "Setting SCLK as input clock & disabled PLL\n"); ++ } ++ } + +- rtd_glb = rtd; /* TODO */ + if (digital_gain_0db_limit) { + ret = snd_soc_limit_volume(card, +- "Subwoofer Digital Playback Volume", 207); ++ "Subwoofer Playback Volume", 207); + if (ret < 0) + dev_warn(card->dev, "Failed to set volume limit: %d\n", + ret); + } +- ret = snd_allo_piano_dsp_program(rtd, set_mode, rate, set_lowpass); ++ ret = snd_allo_piano_dsp_program(rtd, glb_ptr->set_mode, rate, ++ glb_ptr->set_lowpass); + if (ret < 0) + return ret; + +@@ -346,9 +514,21 @@ static int snd_allo_piano_dac_hw_params(struct snd_pcm_substream *substream, + return ret; + } + ++static int snd_allo_piano_dac_prepare( ++ struct snd_pcm_substream *substream) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_card *card = rtd->card; ++ ++ snd_allo_piano_gpio_unmute(card); ++ return 0; ++} ++ + /* machine stream operations */ + static struct snd_soc_ops snd_allo_piano_dac_ops = { ++ .startup = snd_allo_piano_dac_startup, + .hw_params = snd_allo_piano_dac_hw_params, ++ .prepare = snd_allo_piano_dac_prepare, + }; + + static struct snd_soc_dai_link_component allo_piano_2_1_codecs[] = { +@@ -388,11 +568,11 @@ static struct snd_soc_card snd_allo_piano_dac = { + + static int snd_allo_piano_dac_probe(struct platform_device *pdev) + { +- int ret = 0, i = 0; + struct snd_soc_card *card = &snd_allo_piano_dac; ++ int ret = 0, i = 0; + + card->dev = &pdev->dev; +- snd_allo_piano_dac.dev = &pdev->dev; ++ platform_set_drvdata(pdev, &snd_allo_piano_dac); + + if (pdev->dev.of_node) { + struct device_node *i2s_node; +@@ -400,7 +580,7 @@ static int snd_allo_piano_dac_probe(struct platform_device *pdev) + + dai = &snd_allo_piano_dac_dai[0]; + i2s_node = of_parse_phandle(pdev->dev.of_node, +- "i2s-controller", 0); ++ "i2s-controller", 0); + if (i2s_node) { + for (i = 0; i < card->num_links; i++) { + dai->cpu_dai_name = NULL; +@@ -413,6 +593,9 @@ static int snd_allo_piano_dac_probe(struct platform_device *pdev) + !of_property_read_bool(pdev->dev.of_node, + "allo,24db_digital_gain"); + ++ glb_mclk = of_property_read_bool(pdev->dev.of_node, ++ "allo,glb_mclk"); ++ + allo_piano_2_1_codecs[0].of_node = + of_parse_phandle(pdev->dev.of_node, "audio-codec", 0); + if (!allo_piano_2_1_codecs[0].of_node) { +@@ -428,18 +611,51 @@ static int snd_allo_piano_dac_probe(struct platform_device *pdev) + "Property 'audio-codec' missing or invalid\n"); + return -EINVAL; + } +- } + +- ret = snd_soc_register_card(&snd_allo_piano_dac); +- if (ret < 0) +- dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", +- ret); ++ mute_gpio[0] = devm_gpiod_get_optional(&pdev->dev, "mute1", ++ GPIOD_OUT_LOW); ++ if (IS_ERR(mute_gpio[0])) { ++ ret = PTR_ERR(mute_gpio[0]); ++ dev_err(&pdev->dev, ++ "failed to get mute1 gpio6: %d\n", ret); ++ return ret; ++ } + +- return ret; ++ mute_gpio[1] = devm_gpiod_get_optional(&pdev->dev, "mute2", ++ GPIOD_OUT_LOW); ++ if (IS_ERR(mute_gpio[1])) { ++ ret = PTR_ERR(mute_gpio[1]); ++ dev_err(&pdev->dev, ++ "failed to get mute2 gpio25: %d\n", ret); ++ return ret; ++ } ++ ++ if (mute_gpio[0] && mute_gpio[1]) ++ snd_allo_piano_dac.set_bias_level = ++ snd_allo_piano_set_bias_level; ++ ++ ret = snd_soc_register_card(&snd_allo_piano_dac); ++ if (ret < 0) { ++ dev_err(&pdev->dev, ++ "snd_soc_register_card() failed: %d\n", ret); ++ return ret; ++ } ++ ++ if ((mute_gpio[0]) && (mute_gpio[1])) ++ snd_allo_piano_gpio_mute(&snd_allo_piano_dac); ++ ++ return 0; ++ } ++ ++ return -EINVAL; + } + + static int snd_allo_piano_dac_remove(struct platform_device *pdev) + { ++ struct snd_soc_card *card = platform_get_drvdata(pdev); ++ ++ kfree(&card->drvdata); ++ snd_allo_piano_gpio_mute(&snd_allo_piano_dac); + return snd_soc_unregister_card(&snd_allo_piano_dac); + } + diff --git a/projects/RPi2/linux/linux.arm.conf b/projects/RPi2/linux/linux.arm.conf index edc8fde892..6d71483c4c 100644 --- a/projects/RPi2/linux/linux.arm.conf +++ b/projects/RPi2/linux/linux.arm.conf @@ -1,6 +1,6 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/arm 4.9.13 Kernel Configuration +# Linux/arm 4.9.20 Kernel Configuration # CONFIG_ARM=y CONFIG_ARM_HAS_SG_CHAIN=y @@ -2867,6 +2867,7 @@ CONFIG_SND_SOC_COMPRESS=y # CONFIG_SND_SOC_AMD_ACP is not set # CONFIG_SND_ATMEL_SOC is not set CONFIG_SND_BCM2835_SOC_I2S=m +CONFIG_SND_BCM2708_SOC_GOOGLEVOICEHAT_SOUNDCARD=m CONFIG_SND_BCM2708_SOC_HIFIBERRY_DAC=m CONFIG_SND_BCM2708_SOC_HIFIBERRY_DACPLUS=m CONFIG_SND_BCM2708_SOC_HIFIBERRY_DIGI=m @@ -2881,11 +2882,14 @@ CONFIG_SND_BCM2708_SOC_IQAUDIO_DIGI=m CONFIG_SND_BCM2708_SOC_RASPIDAC3=m CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m +CONFIG_SND_AUDIOINJECTOR_OCTO_SOUNDCARD=m CONFIG_SND_DIGIDAC1_SOUNDCARD=m CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO=m CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO_V2=m CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC=m +CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS=m CONFIG_SND_BCM2708_SOC_FE_PI_AUDIO=m +CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC=m CONFIG_SND_PISOUND=m # CONFIG_SND_DESIGNWARE_I2S is not set @@ -2933,11 +2937,13 @@ CONFIG_SND_SOC_ADAU7002=m # CONFIG_SND_SOC_CS4270 is not set # CONFIG_SND_SOC_CS4271_I2C is not set # CONFIG_SND_SOC_CS4271_SPI is not set -# CONFIG_SND_SOC_CS42XX8_I2C is not set +CONFIG_SND_SOC_CS42XX8=m +CONFIG_SND_SOC_CS42XX8_I2C=m # CONFIG_SND_SOC_CS4349 is not set # CONFIG_SND_SOC_CS53L30 is not set # CONFIG_SND_SOC_ES8328 is not set # CONFIG_SND_SOC_GTM601 is not set +# CONFIG_SND_SOC_ICS43432 is not set # CONFIG_SND_SOC_INNO_RK3036 is not set # CONFIG_SND_SOC_MAX98504 is not set # CONFIG_SND_SOC_MAX9860 is not set diff --git a/projects/RPi2/patches/linux/linux-01-RPi_support.patch b/projects/RPi2/patches/linux/linux-01-RPi_support.patch index 1e9e991f28..3e1969a7e8 100644 --- a/projects/RPi2/patches/linux/linux-01-RPi_support.patch +++ b/projects/RPi2/patches/linux/linux-01-RPi_support.patch @@ -1,7 +1,7 @@ -From 824b91157e25e6eeea39df1a2c27f83a6b6838ba Mon Sep 17 00:00:00 2001 +From ace6fd3ca18068ece94afeee6eddb8d190ea8c79 Mon Sep 17 00:00:00 2001 From: Steve Glendinning Date: Thu, 19 Feb 2015 18:47:12 +0000 -Subject: [PATCH 001/195] smsx95xx: fix crimes against truesize +Subject: [PATCH 001/218] smsx95xx: fix crimes against truesize smsc95xx is adjusting truesize when it shouldn't, and following a recent patch from Eric this is now triggering warnings. @@ -48,10 +48,10 @@ index 831aa33d078ae7d2dd57fdded5de71d1eb915f99..b77935bded8c0ff7808b00f170ff10e5 usbnet_skb_return(dev, ax_skb); } -From e2de8f6dd732c5950eba7158e48caf47f1ef741f Mon Sep 17 00:00:00 2001 +From 77227dfd51d9f6cb24da1ee9fce7c29d8fdd26d8 Mon Sep 17 00:00:00 2001 From: Sam Nazarko Date: Fri, 1 Apr 2016 17:27:21 +0100 -Subject: [PATCH 002/195] smsc95xx: Experimental: Enable turbo_mode and +Subject: [PATCH 002/218] smsc95xx: Experimental: Enable turbo_mode and packetsize=2560 by default See: http://forum.kodi.tv/showthread.php?tid=285288 @@ -94,10 +94,10 @@ index b77935bded8c0ff7808b00f170ff10e594300ad0..693f163684de921404738e33244881e0 netif_dbg(dev, ifup, dev->net, "rx_urb_size=%ld\n", -From a76700f447adb955fecd8bbfc955c0dcbbb2a178 Mon Sep 17 00:00:00 2001 +From bfcc45ab8ec29eddf9068f709e19a71c0750ca35 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 17:26:38 +0000 -Subject: [PATCH 003/195] Allow mac address to be set in smsc95xx +Subject: [PATCH 003/218] Allow mac address to be set in smsc95xx Signed-off-by: popcornmix --- @@ -193,10 +193,10 @@ index 693f163684de921404738e33244881e0aab92ec9..df60c989fc229bf0aab3c27e95ccd453 eth_hw_addr_random(dev->net); netif_dbg(dev, ifup, dev->net, "MAC address set to eth_random_addr\n"); -From 4eda25522b37725205be1e303a97bf00cf7c94d7 Mon Sep 17 00:00:00 2001 +From 5c7af355f2985972bffc0c547818bc67bd9f2d47 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 13 Mar 2015 12:43:36 +0000 -Subject: [PATCH 004/195] Protect __release_resource against resources without +Subject: [PATCH 004/218] Protect __release_resource against resources without parents Without this patch, removing a device tree overlay can crash here. @@ -224,10 +224,10 @@ index 9b5f04404152c296af3a96132f27cfc80ffa9af9..f8a9af6e6b915812be2ba2c1c2b40106 for (;;) { tmp = *p; -From a3b99f8ac80b99d8274616bc7dcc763a74515dba Mon Sep 17 00:00:00 2001 +From 8b39431fedbaa4e15cc8187416649b679aa88517 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 18 Dec 2014 16:07:15 -0800 -Subject: [PATCH 005/195] mm: Remove the PFN busy warning +Subject: [PATCH 005/218] mm: Remove the PFN busy warning See commit dae803e165a11bc88ca8dbc07a11077caf97bbcb -- the warning is expected sometimes when using CMA. However, that commit still spams @@ -239,7 +239,7 @@ Signed-off-by: Eric Anholt 1 file changed, 2 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c -index f4a02e240fb68acbaa0d3a0c7ac5a498c051a272..0e1fba92702858ceaf2f92a1d5fa53d5b16b52fe 100644 +index 1460e6ad5e141788edea4b4ea3a294352d788af1..69dc54cf662fbac6b67af7bdfb7b7a41deb78d06 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -7323,8 +7323,6 @@ int alloc_contig_range(unsigned long start, unsigned long end, @@ -252,10 +252,10 @@ index f4a02e240fb68acbaa0d3a0c7ac5a498c051a272..0e1fba92702858ceaf2f92a1d5fa53d5 goto done; } -From fa1cc418ea9a009dd6c3b18f61bc5968d11fafa6 Mon Sep 17 00:00:00 2001 +From 73f0130d019611fe110d734bd94cb5384140f035 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 4 Dec 2015 17:41:50 +0000 -Subject: [PATCH 006/195] irq-bcm2836: Prevent spurious interrupts, and trap +Subject: [PATCH 006/218] irq-bcm2836: Prevent spurious interrupts, and trap them early The old arch-specific IRQ macros included a dsb to ensure the @@ -282,10 +282,10 @@ index d96b2c947e74e3edab3917551c64fbd1ced0f34c..93e3f7660c4230c9f1dd3b195958cb49 #endif } else if (stat) { -From d5eaa943c8f729701c17c557968c096c05212934 Mon Sep 17 00:00:00 2001 +From 2ccd0c4c9b5fb75670cb506403c52b1b1fe38d9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 12 Jun 2015 19:01:05 +0200 -Subject: [PATCH 007/195] irqchip: bcm2835: Add FIQ support +Subject: [PATCH 007/218] irqchip: bcm2835: Add FIQ support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -414,10 +414,10 @@ index 44d7c38dde479d771f3552e914bf8c1c1f5019f7..42ff5e6a8e0d532f5b60a1e7af7cc4d9 } -From 5315497e356586a8a2320972e389fbefda551bfb Mon Sep 17 00:00:00 2001 +From 0e091203819ee3c24cb7d9ef27fda64160b0cee5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 23 Oct 2015 16:26:55 +0200 -Subject: [PATCH 008/195] irqchip: irq-bcm2835: Add 2836 FIQ support +Subject: [PATCH 008/218] irqchip: irq-bcm2835: Add 2836 FIQ support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -516,10 +516,10 @@ index 42ff5e6a8e0d532f5b60a1e7af7cc4d941bd5008..eccf6ed025299cb480884f5bcbe77abf for (b = 0; b < NR_BANKS; b++) { for (i = 0; i < bank_irqs[b]; i++) { -From df18a91051c324c2e31c25c231f414a7ef3959fe Mon Sep 17 00:00:00 2001 +From 1f36307a91673999b54a458708660828bbb57e87 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Jul 2015 10:26:09 +0100 -Subject: [PATCH 009/195] spidev: Add "spidev" compatible string to silence +Subject: [PATCH 009/218] spidev: Add "spidev" compatible string to silence warning See: https://github.com/raspberrypi/linux/issues/1054 @@ -540,10 +540,10 @@ index 2e05046f866bd01bf87edcdeff0d5b76d4d0aea7..d780491b8013a4e97fa843958964454e }; MODULE_DEVICE_TABLE(of, spidev_dt_ids); -From 2045b89a909b65aed659fa79a89fd6d9ff9f7fd4 Mon Sep 17 00:00:00 2001 +From 098c16955ecffe714b0b9c8a1e71155a39be354c Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 30 Jun 2015 14:12:42 +0100 -Subject: [PATCH 010/195] serial: 8250: Don't crash when nr_uarts is 0 +Subject: [PATCH 010/218] serial: 8250: Don't crash when nr_uarts is 0 --- drivers/tty/serial/8250/8250_core.c | 2 ++ @@ -563,10 +563,10 @@ index e8819aa20415603c80547e382838a8fa3ce54792..cf9c7d2e3f95e1a19410247a89c2e49c for (i = 0; i < nr_uarts; i++) { struct uart_8250_port *up = &serial8250_ports[i]; -From 45b37f24824142cd8ca6ab05ca6be636dc96a558 Mon Sep 17 00:00:00 2001 +From 4f351bb67f89906f34b83cc9fa32223e8e9e9887 Mon Sep 17 00:00:00 2001 From: notro Date: Thu, 10 Jul 2014 13:59:47 +0200 -Subject: [PATCH 011/195] pinctrl-bcm2835: Set base to 0 give expected gpio +Subject: [PATCH 011/218] pinctrl-bcm2835: Set base to 0 give expected gpio numbering Signed-off-by: Noralf Tronnes @@ -588,10 +588,10 @@ index fa77165fab2c1348163979da507df17e7168c49b..d11e2e4ea189466e686d762cb6c6fef9 .can_sleep = false, }; -From ff2a58fb3e008c98952f11da3687796edf8c869e Mon Sep 17 00:00:00 2001 +From f9b822f58271c75e81a9354f1167dc719f9a233d Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 24 Feb 2015 13:40:50 +0000 -Subject: [PATCH 012/195] pinctrl-bcm2835: Fix interrupt handling for GPIOs +Subject: [PATCH 012/218] pinctrl-bcm2835: Fix interrupt handling for GPIOs 28-31 and 46-53 Contrary to the documentation, the BCM2835 GPIO controller actually has @@ -737,10 +737,10 @@ index d11e2e4ea189466e686d762cb6c6fef9111ecf8e..107ad7d58de8f8a7f55e09c9cdcf7d66 }, }; -From 93cdac4155cc22b603b7239693f28ea4376f60b7 Mon Sep 17 00:00:00 2001 +From d2dc0ee0513fbcdd90576a0765e061dc29b8067c Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 26 Feb 2015 09:58:22 +0000 -Subject: [PATCH 013/195] pinctrl-bcm2835: Only request the interrupts listed +Subject: [PATCH 013/218] pinctrl-bcm2835: Only request the interrupts listed in the DTB Although the GPIO controller can generate three interrupts (four counting @@ -767,10 +767,10 @@ index 107ad7d58de8f8a7f55e09c9cdcf7d66fa7ab66b..644bdecbcfcb79d3b84a33769265fca5 pc->irq_data[i].irqgroup = i; -From 35ef1ffba1fa601537d4971605bc47305bcc7140 Mon Sep 17 00:00:00 2001 +From e4d48693d7cf2b97fc189e4344ec3f09c333903d Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 6 May 2016 12:32:47 +0100 -Subject: [PATCH 014/195] pinctrl-bcm2835: Return pins to inputs when freed +Subject: [PATCH 014/218] pinctrl-bcm2835: Return pins to inputs when freed When dynamically unloading overlays, it is important that freed pins are restored to being inputs to prevent functions from being enabled in @@ -811,10 +811,10 @@ index 644bdecbcfcb79d3b84a33769265fca5d3d0c9e5..81a66cba2ab0f7e3ae179de7edd10122 .get_function_name = bcm2835_pmx_get_function_name, .get_function_groups = bcm2835_pmx_get_function_groups, -From 91fca4e04d43b9871bb9a05f5fd53f412f44ad7a Mon Sep 17 00:00:00 2001 +From ca1600077e78e1a5cde5e329aa2aaa8b4261453a Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 24 Jun 2015 14:10:44 +0100 -Subject: [PATCH 015/195] spi-bcm2835: Support pin groups other than 7-11 +Subject: [PATCH 015/218] spi-bcm2835: Support pin groups other than 7-11 The spi-bcm2835 driver automatically uses GPIO chip-selects due to some unreliability of the native ones. In doing so it chooses the @@ -895,10 +895,10 @@ index f35cc10772f6670397ea923ad30158270dd68578..5dfe20ffc2866fa6789825016c585175 /* and set up the "mode" and level */ dev_info(&spi->dev, "setting up native-CS%i as GPIO %i\n", -From f6ca889d38c151f406a6979435ea3365c9c309c3 Mon Sep 17 00:00:00 2001 +From aa8c3ce9cad4a9c450f305b25bf6e099fc788102 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 1 Jul 2016 22:09:24 +0100 -Subject: [PATCH 016/195] spi-bcm2835: Disable forced software CS +Subject: [PATCH 016/218] spi-bcm2835: Disable forced software CS Select software CS in bcm2708_common.dtsi, and disable the automatic conversion in the driver to allow hardware CS to be re-enabled with an @@ -932,10 +932,10 @@ index 5dfe20ffc2866fa6789825016c585175a29705b6..8493474d286f7a1ac6454a22c61c8c2c return 0; } -From 18d0cd4df7ff1d864ba5c9919ff0dcbb9ff461b9 Mon Sep 17 00:00:00 2001 +From d13a1d0c1b9ae58ff0cd262d8d79ce4c4ef342d2 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 8 Nov 2016 21:35:38 +0000 -Subject: [PATCH 017/195] spi-bcm2835: Remove unused code +Subject: [PATCH 017/218] spi-bcm2835: Remove unused code --- drivers/spi/spi-bcm2835.c | 61 ----------------------------------------------- @@ -1023,10 +1023,10 @@ index 8493474d286f7a1ac6454a22c61c8c2cef9121bf..33d75ad38a7f77d085321ace9101900a } -From cd05fecde7c8dc71f0a50ac33a31136e2c763c1c Mon Sep 17 00:00:00 2001 +From c893ea9baa610d6c6348d7628279c77679055d97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Wed, 3 Jun 2015 12:26:13 +0200 -Subject: [PATCH 018/195] ARM: bcm2835: Set Serial number and Revision +Subject: [PATCH 018/218] ARM: bcm2835: Set Serial number and Revision MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -1079,10 +1079,10 @@ index 0c1edfc98696da0e0bb7f4a18cdfbcdd27a9795d..8f152266ba9b470df2eaaed9ebcf158e static const char * const bcm2835_compat[] = { -From be74b1a8c91452b4da15cd93498d822dcd59081c Mon Sep 17 00:00:00 2001 +From e997f981519f0c1b0d922cf3b893fb799f7f4686 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Sat, 3 Oct 2015 22:22:55 +0200 -Subject: [PATCH 019/195] dmaengine: bcm2835: Load driver early and support +Subject: [PATCH 019/218] dmaengine: bcm2835: Load driver early and support legacy API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -1185,10 +1185,10 @@ index e18dc596cf2447fa9ef7e41b62d9396e29043426..80d35f760b4a4a51e60c355a84d538ba MODULE_ALIAS("platform:bcm2835-dma"); MODULE_DESCRIPTION("BCM2835 DMA engine driver"); -From 7edcdd77d6a68ea8da112c4155d195c79f892140 Mon Sep 17 00:00:00 2001 +From a0a01cf3fd1469a6b94a16d21aa7cfb61d02d7cb Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 25 Jan 2016 17:25:12 +0000 -Subject: [PATCH 020/195] firmware: Updated mailbox header +Subject: [PATCH 020/218] firmware: Updated mailbox header --- include/soc/bcm2835/raspberrypi-firmware.h | 11 +++++++++++ @@ -1251,10 +1251,10 @@ index 3fb357193f09914fe21f8555a4b8613f74f22bc3..227a107214a02deadcca3db202da265e RPI_FIRMWARE_GET_COMMAND_LINE = 0x00050001, RPI_FIRMWARE_GET_DMA_CHANNELS = 0x00060001, -From 81012e53f2fd85631e900caee73120c0a568b3a0 Mon Sep 17 00:00:00 2001 +From c7b70d7bf562b9611f342862653ad7f68fa9e0c6 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 9 May 2016 17:28:18 -0700 -Subject: [PATCH 021/195] clk: bcm2835: Mark GPIO clocks enabled at boot as +Subject: [PATCH 021/218] clk: bcm2835: Mark GPIO clocks enabled at boot as critical. These divide off of PLLD_PER and are used for the ethernet and wifi @@ -1272,7 +1272,7 @@ Signed-off-by: Eric Anholt 1 file changed, 9 insertions(+) diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c -index 3bbd2a58db470a89b870a793e59ddf9fc4f48e57..7040c6426e35c11608121893b662c601cd8d6543 100644 +index 2acaa77ad482a99f28ea64ea43c891501125304c..d13cbbf5bbe06314bfdf103ff85d5cd73cbf7f7a 100644 --- a/drivers/clk/bcm/clk-bcm2835.c +++ b/drivers/clk/bcm/clk-bcm2835.c @@ -1262,6 +1262,15 @@ static struct clk_hw *bcm2835_register_clock(struct bcm2835_cprman *cprman, @@ -1292,10 +1292,10 @@ index 3bbd2a58db470a89b870a793e59ddf9fc4f48e57..7040c6426e35c11608121893b662c601 init.ops = &bcm2835_vpu_clock_clk_ops; } else { -From 95a2b87baa9268288a2a29fdf3fb6be7b2c4b396 Mon Sep 17 00:00:00 2001 +From 70bd41a7fa143e6083f8e6fda573ccc8b11d5de0 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 15 Jun 2016 16:48:41 +0100 -Subject: [PATCH 022/195] rtc: Add SPI alias for pcf2123 driver +Subject: [PATCH 022/218] rtc: Add SPI alias for pcf2123 driver Without this alias, Device Tree won't cause the driver to be loaded. @@ -1315,10 +1315,10 @@ index 8895f77726e8da5444afcd602dceff8f25a9b3fd..1833b8853ceb0e6147cceb93a00e558c MODULE_LICENSE("GPL"); +MODULE_ALIAS("spi:rtc-pcf2123"); -From 45564555c0782c49ed3c1d004710310648eac7f9 Mon Sep 17 00:00:00 2001 +From ea7d87c6e8212f5559000d9471f9e87169797430 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 7 Oct 2016 16:50:59 +0200 -Subject: [PATCH 023/195] watchdog: bcm2835: Support setting reboot partition +Subject: [PATCH 023/218] watchdog: bcm2835: Support setting reboot partition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -1442,10 +1442,10 @@ index 4dddd8298a227d64862f2e92954a465f2e44b3f6..1f545e024422f59280932713e6a1b051 register_restart_handler(&wdt->restart_handler); if (pm_power_off == NULL) -From e97b21ffc3fb98c0dfcc10a397afb0d3fe7fb4c8 Mon Sep 17 00:00:00 2001 +From 639060b6afee11534ce54ab416abeb0ed7fd6965 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 5 Apr 2016 19:40:12 +0100 -Subject: [PATCH 024/195] reboot: Use power off rather than busy spinning when +Subject: [PATCH 024/218] reboot: Use power off rather than busy spinning when halt is requested --- @@ -1468,10 +1468,10 @@ index 3fa867a2aae672755c6ce6448f4148c989dbf964..80dca8dcd6709034b643c6a3f35729e0 /* -From 87babae12f5085ea93481ba7412701f18a032cbb Mon Sep 17 00:00:00 2001 +From c020700a444e1e3ed5db75038f9b6c299b890e64 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 9 Nov 2016 13:02:52 +0000 -Subject: [PATCH 025/195] bcm: Make RASPBERRYPI_POWER depend on PM +Subject: [PATCH 025/218] bcm: Make RASPBERRYPI_POWER depend on PM --- drivers/soc/bcm/Kconfig | 1 + @@ -1490,10 +1490,10 @@ index a39b0d58ddd0fdf0ac1cc7295f8aafb12546e226..e037a6dd79d1881a09e3ca9115782709 help This enables support for the RPi power domains which can be enabled -From 0334dbeaae76c66d8f7d19fbdd7fd7a99bf74039 Mon Sep 17 00:00:00 2001 +From a2bda2acba829767aeead5be052c7b6eee905d97 Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Fri, 2 Sep 2016 16:45:27 +0100 -Subject: [PATCH 026/195] Register the clocks early during the boot process, so +Subject: [PATCH 026/218] Register the clocks early during the boot process, so that special/critical clocks can get enabled early on in the boot process avoiding the risk of disabling a clock, pll_divider or pll when a claiming driver fails to install propperly - maybe it needs to defer. @@ -1504,7 +1504,7 @@ Signed-off-by: Martin Sperl 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c -index 7040c6426e35c11608121893b662c601cd8d6543..21e2a538ff0d0ab4e63adff9b93705f3d45fa15d 100644 +index d13cbbf5bbe06314bfdf103ff85d5cd73cbf7f7a..a99ccf9f056d3a3e7c482339e08483f3701ebc04 100644 --- a/drivers/clk/bcm/clk-bcm2835.c +++ b/drivers/clk/bcm/clk-bcm2835.c @@ -1903,8 +1903,15 @@ static int bcm2835_clk_probe(struct platform_device *pdev) @@ -1538,10 +1538,10 @@ index 7040c6426e35c11608121893b662c601cd8d6543..21e2a538ff0d0ab4e63adff9b93705f3 MODULE_AUTHOR("Eric Anholt "); MODULE_DESCRIPTION("BCM2835 clock driver"); -From 887b64752dac7a46001d47bb940aad4e77cfc895 Mon Sep 17 00:00:00 2001 +From f8fdbafbd1b8a67f07ae454be34e61e9e420998a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 6 Dec 2016 17:05:39 +0000 -Subject: [PATCH 027/195] bcm2835-rng: Avoid initialising if already enabled +Subject: [PATCH 027/218] bcm2835-rng: Avoid initialising if already enabled Avoids the 0x40000 cycles of warmup again if firmware has already used it --- @@ -1567,10 +1567,10 @@ index 574211a495491d9d6021dcaefe4274a63ed02055..e66c0fca8c6090e32f72796c0877a1cf err = hwrng_register(&bcm2835_rng_ops); if (err) { -From f642b0f244cd0393c458ca458de826f5b3820850 Mon Sep 17 00:00:00 2001 +From d917a5b2280fe48ef807f0c67b23fa8f55fb7687 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 24 Aug 2016 16:28:44 +0100 -Subject: [PATCH 028/195] kbuild: Ignore dtco targets when filtering symbols +Subject: [PATCH 028/218] kbuild: Ignore dtco targets when filtering symbols --- scripts/Kbuild.include | 2 +- @@ -1590,10 +1590,10 @@ index 179219845dfcdfbeb586d12c5ec1296095d9fbf4..e0743e44f84188667a0c322e8c3d36f1 esac | tr ";" "\n" | sed -rn 's/^.*=== __KSYM_(.*) ===.*$$/KSYM_\1/p' -From 33f4d99cb9cdac2ecf8cba4dd86c2402b2cf5e01 Mon Sep 17 00:00:00 2001 +From e668d477605548f3bda8ccaaa3d8cfde214ef748 Mon Sep 17 00:00:00 2001 From: Robert Tiemann Date: Mon, 20 Jul 2015 11:01:25 +0200 -Subject: [PATCH 029/195] BCM2835_DT: Fix I2S register map +Subject: [PATCH 029/218] BCM2835_DT: Fix I2S register map --- Documentation/devicetree/bindings/dma/brcm,bcm2835-dma.txt | 4 ++-- @@ -1631,10 +1631,10 @@ index 65783de0aedf3da79adc36fd077b7a89954ddb6b..a89fe4220fdc3f26f75ee66daf187554 dmas = <&dma 2>, <&dma 3>; -From 67b5bb9e5f63a8622f93227f385c6e414d65e39e Mon Sep 17 00:00:00 2001 +From 79b139ddbe668e2f2b05d54b3caa01ac837cc01f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 12 May 2013 12:24:19 +0100 -Subject: [PATCH 030/195] Main bcm2708/bcm2709 linux port +Subject: [PATCH 030/218] Main bcm2708/bcm2709 linux port MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -1841,10 +1841,10 @@ index cfb4b4496dd9f61362dea012176c146120fada07..d9c6c217c4d6a2408abe2665bf7f2700 MODULE_AUTHOR("Lubomir Rintel "); MODULE_DESCRIPTION("BCM2835 mailbox IPC driver"); -From 639d6dc9f3858e4dc64c23ca71027c2b8c3bdb25 Mon Sep 17 00:00:00 2001 +From 255056f5891a55df23e6bd9b6239022cb30c9806 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 19:46:17 +0100 -Subject: [PATCH 031/195] Add dwc_otg driver +Subject: [PATCH 031/218] Add dwc_otg driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -2546,7 +2546,7 @@ index 358ca8dd784fe43700ae070764fa783500a792fe..abaac7c7142d8887c1516957fc52162c return i; } diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c -index aef81a16e2c8534701b8583392400faf77971d23..4197a5b5fb7abae67bd4aa32c29cb84c1f2fe22e 100644 +index c28ccf1b5a1fe285044024fff3f70bf9ae7cc91f..0e65cb92d12eb9645ddc21b902cd8b141cafef47 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -5009,7 +5009,7 @@ static void port_event(struct usb_hub *hub, int port1) @@ -62901,10 +62901,10 @@ index 0000000000000000000000000000000000000000..cdc9963176e5a4a0d5250613b61e26c5 +test_main(); +0; -From 8136fe3b12d68099e1cd005dcdca8ef973f35f50 Mon Sep 17 00:00:00 2001 +From e4ae0eb3bfe63196bb9577dda90d44b377fff72b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 17:06:34 +0100 -Subject: [PATCH 032/195] bcm2708 framebuffer driver +Subject: [PATCH 032/218] bcm2708 framebuffer driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -66363,10 +66363,10 @@ index 3c14e43b82fefe1d32f591d1b2f61d2cd28d0fa8..7626beb6a5bb8df601ddf0f6e6909d1f +0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 +0 0 0 0 0 0 0 0 0 -From 8c7995c7f6303b0d9ed6953dd1803819eb64a459 Mon Sep 17 00:00:00 2001 +From 1c2a6d9e3cfab206f4a7f9498a30bb38d39eb3d1 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:22:53 +0100 -Subject: [PATCH 033/195] dmaengine: Add support for BCM2708 +Subject: [PATCH 033/218] dmaengine: Add support for BCM2708 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -66997,10 +66997,10 @@ index 0000000000000000000000000000000000000000..c5bfff2765be4606077e6c8af73040ec + +#endif /* _PLAT_BCM2708_DMA_H */ -From ba68e25029468180b5e87827607259d7218d08ab Mon Sep 17 00:00:00 2001 +From fdc5c1e17bb8cdaa612dde04bbd1b6b3f5636686 Mon Sep 17 00:00:00 2001 From: gellert Date: Fri, 15 Aug 2014 16:35:06 +0100 -Subject: [PATCH 034/195] MMC: added alternative MMC driver +Subject: [PATCH 034/218] MMC: added alternative MMC driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -68750,10 +68750,10 @@ index 0000000000000000000000000000000000000000..4fe8d1fe44578fbefcd48f8c327ba3d0 +MODULE_LICENSE("GPL v2"); +MODULE_AUTHOR("Gellert Weisz"); -From 406c03bca56cf29ce046ae5e164bfdc97082c985 Mon Sep 17 00:00:00 2001 +From e47f0fe40ec129cab52f07ad0c315d37a2d57fe2 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 25 Mar 2015 17:49:47 +0000 -Subject: [PATCH 035/195] Adding bcm2835-sdhost driver, and an overlay to +Subject: [PATCH 035/218] Adding bcm2835-sdhost driver, and an overlay to enable it BCM2835 has two SD card interfaces. This driver uses the other one. @@ -71158,10 +71158,10 @@ index 0000000000000000000000000000000000000000..a9bc79bfdbb71807819dfe2d8f165144 +MODULE_LICENSE("GPL v2"); +MODULE_AUTHOR("Phil Elwell"); -From 86a841552d7c68bfad1836ba634330da73abe62d Mon Sep 17 00:00:00 2001 +From 5fcecb8e60f05180c91e2a18b779d5c8461ab620 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 11 May 2016 12:50:33 +0100 -Subject: [PATCH 036/195] mmc: Add MMC_QUIRK_ERASE_BROKEN for some cards +Subject: [PATCH 036/218] mmc: Add MMC_QUIRK_ERASE_BROKEN for some cards Some SD cards have been found that corrupt data when small blocks are erased. Add a quirk to indicate that ERASE should not be used, @@ -71297,10 +71297,10 @@ index 73fad83acbcb6a157587180516f9ffe7c61eb7d7..e7c9d3098ac06e3c6554fa3373a311f9 unsigned int erase_shift; /* if erase unit is power 2 */ unsigned int pref_erase; /* in sectors */ -From df77e4ac03fa7eb5e0d67cde27d7b926a64ba9a4 Mon Sep 17 00:00:00 2001 +From f7c278edaa5dc994fb610ccf72ba33c340925972 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:31:47 +0100 -Subject: [PATCH 037/195] cma: Add vc_cma driver to enable use of CMA +Subject: [PATCH 037/218] cma: Add vc_cma driver to enable use of CMA MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -72636,10 +72636,10 @@ index 0000000000000000000000000000000000000000..be2819d5d41f9d5ed65daf8eedb94c9e + +#endif /* VC_CMA_H */ -From 682dc5f59a056c6b166f69bd38e2feb6c5228f37 Mon Sep 17 00:00:00 2001 +From a38618ea5e2cc3f84de75fa11b46725b178f1810 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 26 Mar 2012 22:15:50 +0100 -Subject: [PATCH 038/195] bcm2708: alsa sound driver +Subject: [PATCH 038/218] bcm2708: alsa sound driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -75374,10 +75374,10 @@ index 0000000000000000000000000000000000000000..af3e6eb690113fc32ce9e06bd2f0f294 + +#endif // _VC_AUDIO_DEFS_H_ -From ce01ad481ce41d539c7d5e0a110da8fe448f2295 Mon Sep 17 00:00:00 2001 +From cd2ed566ba3b675d81f8ba3cfd8bd4c116e391b7 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 28 Oct 2016 15:36:43 +0100 -Subject: [PATCH 039/195] vc_mem: Add vc_mem driver for querying firmware +Subject: [PATCH 039/218] vc_mem: Add vc_mem driver for querying firmware memory addresses MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -75901,10 +75901,10 @@ index 0000000000000000000000000000000000000000..20a475377eb3078ea1ecaef2b24efc35 + +#endif /* _VC_MEM_H */ -From 4ffc0167afeaab524c22ec970f5b63f9ae0d64b4 Mon Sep 17 00:00:00 2001 +From 3bca045578853ff455fa5aa9ce3cb6625a72da10 Mon Sep 17 00:00:00 2001 From: Tim Gover Date: Tue, 22 Jul 2014 15:41:04 +0100 -Subject: [PATCH 040/195] vcsm: VideoCore shared memory service for BCM2835 +Subject: [PATCH 040/218] vcsm: VideoCore shared memory service for BCM2835 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -80311,10 +80311,10 @@ index 0000000000000000000000000000000000000000..334f36d0d697b047df2922b5f2db67f3 + +#endif /* __VMCS_SM_IOCTL_H__INCLUDED__ */ -From 5f7747149f7804fed56ff23337fa58747e0083a4 Mon Sep 17 00:00:00 2001 +From 7e2f2a04538763e7af2b66b2ef6e301c9f402590 Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Fri, 21 Aug 2015 23:14:48 +0100 -Subject: [PATCH 041/195] Add /dev/gpiomem device for rootless user GPIO access +Subject: [PATCH 041/218] Add /dev/gpiomem device for rootless user GPIO access Signed-off-by: Luke Wren @@ -80625,10 +80625,10 @@ index 0000000000000000000000000000000000000000..911f5b7393ed48ceed8751f06967ae64 +MODULE_DESCRIPTION("gpiomem driver for accessing GPIO from userspace"); +MODULE_AUTHOR("Luke Wren "); -From a4cb9fa177e22de6e158d430ade3e04910052148 Mon Sep 17 00:00:00 2001 +From 372c91d3d0d0a137618fa4df8ad8d076bc7229f4 Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Sat, 5 Sep 2015 01:14:45 +0100 -Subject: [PATCH 042/195] Add SMI driver +Subject: [PATCH 042/218] Add SMI driver Signed-off-by: Luke Wren --- @@ -82579,10 +82579,10 @@ index 0000000000000000000000000000000000000000..ee3a75edfc033eeb0d90a687ffb68b10 + +#endif /* BCM2835_SMI_H */ -From 3a935cc738add5e6099185ac8b2ad4644476b072 Mon Sep 17 00:00:00 2001 +From f3f809a8023342dd2dd4bfb36c4a6b99e34aeb20 Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Tue, 26 Apr 2016 14:59:21 +0000 -Subject: [PATCH 043/195] MISC: bcm2835: smi: use clock manager and fix reload +Subject: [PATCH 043/218] MISC: bcm2835: smi: use clock manager and fix reload issues Use clock manager instead of self-made clockmanager. @@ -82752,10 +82752,10 @@ index 63a4ea08b9930a3a31a985f0a1d969b488ed49ec..1261540703127d1d63b9f3c87042c6e5 return 0; } -From 56f9fab0a1700699e77b81066864175519c5e782 Mon Sep 17 00:00:00 2001 +From f2bfd53319709e8d543eb7ae3dc4d59ae3908093 Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Sat, 5 Sep 2015 01:16:10 +0100 -Subject: [PATCH 044/195] Add SMI NAND driver +Subject: [PATCH 044/218] Add SMI NAND driver Signed-off-by: Luke Wren --- @@ -83120,10 +83120,10 @@ index 0000000000000000000000000000000000000000..02adda6da18bd0ba9ab19a104975b79d + ("Driver for NAND chips using Broadcom Secondary Memory Interface"); +MODULE_AUTHOR("Luke Wren "); -From 30ab3c9b68b20a445d65c3ae91ee1b645c9af208 Mon Sep 17 00:00:00 2001 +From 30a6c2c5267914444f95d7c70b56318deca21efb Mon Sep 17 00:00:00 2001 From: Aron Szabo Date: Sat, 16 Jun 2012 12:15:55 +0200 -Subject: [PATCH 045/195] lirc: added support for RaspberryPi GPIO +Subject: [PATCH 045/218] lirc: added support for RaspberryPi GPIO lirc_rpi: Use read_current_timer to determine transmitter delay. Thanks to jjmz and others See: https://github.com/raspberrypi/linux/issues/525 @@ -83986,10 +83986,10 @@ index 0000000000000000000000000000000000000000..fb69624ccef00ddbdccf8256d6baf1b1 + +#endif -From 0fec68ae4d97857def8e65ceb40e4b3025eebf3b Mon Sep 17 00:00:00 2001 +From b74ad641f8868ca5d3c3aef7baea0ae1f03ec341 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:49:20 +0100 -Subject: [PATCH 046/195] Add cpufreq driver +Subject: [PATCH 046/218] Add cpufreq driver Signed-off-by: popcornmix --- @@ -84256,10 +84256,10 @@ index 0000000000000000000000000000000000000000..414fbdc10dfbfc6e4bb47870a7af3fd5 +module_init(bcm2835_cpufreq_module_init); +module_exit(bcm2835_cpufreq_module_exit); -From bc5015b05f818e1b5dd6cae3fab09464cdea5cbf Mon Sep 17 00:00:00 2001 +From 20e4a967e3f3b88d63e3d7c46c8198afd6581bd2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 19:24:24 +0000 -Subject: [PATCH 047/195] Added hwmon/thermal driver for reporting core +Subject: [PATCH 047/218] Added hwmon/thermal driver for reporting core temperature. Thanks Dorian MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -84425,10 +84425,10 @@ index 0000000000000000000000000000000000000000..c63fb9f9d143e19612a18fe530c7b2b3 +MODULE_DESCRIPTION("Thermal driver for bcm2835 chip"); +MODULE_LICENSE("GPL"); -From bcf204224a61b8d5b66bee617c10670e9ebe1100 Mon Sep 17 00:00:00 2001 +From e485d7218d11ef86bf03a948c3df1dd6e2264683 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 15:44:08 +0100 -Subject: [PATCH 048/195] Add Chris Boot's i2c driver +Subject: [PATCH 048/218] Add Chris Boot's i2c driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -85093,10 +85093,10 @@ index 0000000000000000000000000000000000000000..962f2e5c7455d91bf32925d785f5f16b +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRV_NAME); -From e1dfd04ab149dbcbdbcfe3ebd4c9790d92ea9b32 Mon Sep 17 00:00:00 2001 +From a867b62a2fc6e866a52d3742894727045a15cc67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 26 Jun 2015 14:27:06 +0200 -Subject: [PATCH 049/195] char: broadcom: Add vcio module +Subject: [PATCH 049/218] char: broadcom: Add vcio module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -85322,10 +85322,10 @@ index 0000000000000000000000000000000000000000..c19bc2075c77879563ef5e59038b5a14 +MODULE_DESCRIPTION("Mailbox userspace access"); +MODULE_LICENSE("GPL"); -From 7b469a8a64b5727e2d562db73da676de75213e82 Mon Sep 17 00:00:00 2001 +From c3895f611eafd3c731d2964df1581f07fb2f9522 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 26 Jun 2015 14:25:01 +0200 -Subject: [PATCH 050/195] firmware: bcm2835: Support ARCH_BCM270x +Subject: [PATCH 050/218] firmware: bcm2835: Support ARCH_BCM270x MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -85408,10 +85408,10 @@ index dd506cd3a5b874f9e1acd07efb8cd151bb6145d1..3f070bd38a91511c986e3fb114b15bd4 MODULE_AUTHOR("Eric Anholt "); MODULE_DESCRIPTION("Raspberry Pi firmware driver"); -From 34995fae7d9bbcad176f1257bf5a57b873e3cca8 Mon Sep 17 00:00:00 2001 +From 0bd5079a80dd6bc9c593e13e52b8e64ef9b79da5 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 30 Jan 2013 12:45:18 +0000 -Subject: [PATCH 051/195] bcm2835: add v4l2 camera device +Subject: [PATCH 051/218] bcm2835: add v4l2 camera device - Supports raw YUV capture, preview, JPEG and H264. - Uses videobuf2 for data transfer, using dma_buf. @@ -93153,10 +93153,10 @@ index 0000000000000000000000000000000000000000..9d1d11e4a53e510c04a416d92d195a7d + +#endif /* MMAL_VCHIQ_H */ -From 67fe83cbd3e42c51f3d2e561272c1171b3743fc4 Mon Sep 17 00:00:00 2001 +From 201640f5760f1d84cf0b8a8a49d695809f78e365 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 11 May 2015 09:00:42 +0100 -Subject: [PATCH 052/195] scripts: Add mkknlimg and knlinfo scripts from tools +Subject: [PATCH 052/218] scripts: Add mkknlimg and knlinfo scripts from tools repo The Raspberry Pi firmware looks for a trailer on the kernel image to @@ -93676,10 +93676,10 @@ index 0000000000000000000000000000000000000000..60206de7fa9a49bd027c635306674a29 + return $trailer; +} -From 8e22e9449b95845c3fd4f0e36a5e4aeb8d828f66 Mon Sep 17 00:00:00 2001 +From 75eaa71803c4d693ae6a2c8e0b4e5510f036c1f2 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 10 Aug 2015 09:49:15 +0100 -Subject: [PATCH 053/195] scripts/dtc: Update to upstream version 1.4.1 +Subject: [PATCH 053/218] scripts/dtc: Update to upstream version 1.4.1 Includes the new localfixups format. @@ -96530,10 +96530,10 @@ index ad9b05ae698b0495ecbda42ffcf4743555313a27..2595dfda020fd9e03f0beff5006f229d -#define DTC_VERSION "DTC 1.4.1-g53bf130b" +#define DTC_VERSION "DTC 1.4.1-g25efc119" -From cbfcef0fdd2924747e975c45473502028eaed667 Mon Sep 17 00:00:00 2001 +From 7cea97bde2fb5a4958335b884aee20a5d5f03262 Mon Sep 17 00:00:00 2001 From: notro Date: Wed, 9 Jul 2014 14:46:08 +0200 -Subject: [PATCH 054/195] BCM2708: Add core Device Tree support +Subject: [PATCH 054/218] BCM2708: Add core Device Tree support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -106661,10 +106661,10 @@ index 0a07f9014944ed92a8e2e42983ae43be60b3e471..1967878a843461c3ff1f473b9a030eb0 # Bzip2 -From e44f5e5a40dd96280c8448757e0051a3a58c9b76 Mon Sep 17 00:00:00 2001 +From 2294dcf5e531118e721e9a4ff946aa7eaa1de06d Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 6 Feb 2015 13:50:57 +0000 -Subject: [PATCH 055/195] BCM270x_DT: Add pwr_led, and the required "input" +Subject: [PATCH 055/218] BCM270x_DT: Add pwr_led, and the required "input" trigger The "input" trigger makes the associated GPIO an input. This is to support @@ -106840,10 +106840,10 @@ index ddfcb2df3656cf0ab6aebd1fa3d624a6ec2e94e9..271563eb835f9018712e2076a88f341d /* Set LED brightness level * Must not sleep. Use brightness_set_blocking for drivers -From 45308705734decf5fecf256a237e39a59a87b1f9 Mon Sep 17 00:00:00 2001 +From 2ba877036465a3cd0848a8bf576650e01575571f Mon Sep 17 00:00:00 2001 From: Siarhei Siamashka Date: Mon, 17 Jun 2013 13:32:11 +0300 -Subject: [PATCH 056/195] fbdev: add FBIOCOPYAREA ioctl +Subject: [PATCH 056/218] fbdev: add FBIOCOPYAREA ioctl Based on the patch authored by Ali Gholami Rudi at https://lkml.org/lkml/2009/7/13/153 @@ -107095,10 +107095,10 @@ index fb795c3b3c178ad3cd7c9e9e4547ffd492bac181..703fa8a70574323abe2fb32599254582 __u32 dx; /* screen-relative */ __u32 dy; -From 7f13d10b4fd5d8c9263ecbad98b2b38afda539dd Mon Sep 17 00:00:00 2001 +From 051268acb9fcf7b4bbd5fa81a46af4989c419b27 Mon Sep 17 00:00:00 2001 From: Harm Hanemaaijer Date: Thu, 20 Jun 2013 20:21:39 +0200 -Subject: [PATCH 057/195] Speed up console framebuffer imageblit function +Subject: [PATCH 057/218] Speed up console framebuffer imageblit function Especially on platforms with a slower CPU but a relatively high framebuffer fill bandwidth, like current ARM devices, the existing @@ -107307,10 +107307,10 @@ index a2bb276a8b2463eee98eb237c4647bc00cd93601..436494fba15abecb400ef28688466faf start_index, pitch_index); } else -From 9aca0b5d406f18972ee006fb604c47214fefa073 Mon Sep 17 00:00:00 2001 +From aa6d09ed8941a36181549e9a273d5c2be4a3210e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 8 May 2013 11:46:50 +0100 -Subject: [PATCH 058/195] enabling the realtime clock 1-wire chip DS1307 and +Subject: [PATCH 058/218] enabling the realtime clock 1-wire chip DS1307 and 1-wire on GPIO4 (as a module) 1-wire: Add support for configuring pin for w1-gpio kernel module @@ -107560,10 +107560,10 @@ index d58594a3232492e33f1dd4babd3798b03e0f0203..feae94256256316fd9d850c3d83325af unsigned int ext_pullup_enable_pin; unsigned int pullup_duration; -From 60ec191c16e1911aae33101bd9a5cf19e5b52ab3 Mon Sep 17 00:00:00 2001 +From 4c53c26f2debff33c31c14abc1402edee7612551 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 18 Dec 2013 22:16:19 +0000 -Subject: [PATCH 059/195] config: Enable CONFIG_MEMCG, but leave it disabled +Subject: [PATCH 059/218] config: Enable CONFIG_MEMCG, but leave it disabled (due to memory cost). Enable with cgroup_enable=memory. --- @@ -107613,10 +107613,10 @@ index 4e2f3de0e40bff4caef5ee9c587ea19140d07f85..4b687fba53c58e744e04608a9510f9b8 * css_tryget_online_from_dir - get corresponding css from a cgroup dentry * @dentry: directory dentry of interest -From d04fbf878de58ed516a020fb112c9040829d4f77 Mon Sep 17 00:00:00 2001 +From a635f80a870e67a90449c8020caf161823570055 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 14 Jul 2014 22:02:09 +0100 -Subject: [PATCH 060/195] hid: Reduce default mouse polling interval to 60Hz +Subject: [PATCH 060/218] hid: Reduce default mouse polling interval to 60Hz Reduces overhead when using X --- @@ -107652,10 +107652,10 @@ index ae83af649a607f67239f1a64bf45dd4b5770cc7d..4a7af9d0b910f59d17421ce14138400d ret = -ENOMEM; if (usb_endpoint_dir_in(endpoint)) { -From 2c9be1a0b8e1f198ba662d2c3ccc34e28793c8d9 Mon Sep 17 00:00:00 2001 +From dda6011049f45177d51d4cffa8798751a1e88ea6 Mon Sep 17 00:00:00 2001 From: Gordon Hollingworth Date: Tue, 12 May 2015 14:47:56 +0100 -Subject: [PATCH 061/195] rpi-ft5406: Add touchscreen driver for pi LCD display +Subject: [PATCH 061/218] rpi-ft5406: Add touchscreen driver for pi LCD display Fix driver detection failure Check that the buffer response is non-zero meaning the touchscreen was detected @@ -108013,10 +108013,10 @@ index 227a107214a02deadcca3db202da265eba1fdd21..b0f6e33bd30c35664ceee057f4c3ad32 RPI_FIRMWARE_FRAMEBUFFER_SET_BACKLIGHT = 0x0004800f, -From d9edb140e6f70b4047bc230fba9410eb31bea047 Mon Sep 17 00:00:00 2001 +From e1be46efa290abbd5ceec146da1f4326028a4e83 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 28 Nov 2016 16:50:04 +0000 -Subject: [PATCH 062/195] Improve __copy_to_user and __copy_from_user +Subject: [PATCH 062/218] Improve __copy_to_user and __copy_from_user performance Provide a __copy_from_user that uses memcpy. On BCM2708, use @@ -109591,10 +109591,10 @@ index 333dc3c2e5ffbb2c5ab8fcfb6115b6162643cf20..46b787a6474ffa857da9b663948863ec bool "Broadcom BCM63xx DSL SoC" depends on ARCH_MULTI_V7 -From 08166a0d3381008dbacf6d7c6712e3e38249bce2 Mon Sep 17 00:00:00 2001 +From 3ad7c22da72db63a6167c33abf8240a17b218ab1 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 25 Jun 2015 12:16:11 +0100 -Subject: [PATCH 063/195] gpio-poweroff: Allow it to work on Raspberry Pi +Subject: [PATCH 063/218] gpio-poweroff: Allow it to work on Raspberry Pi The Raspberry Pi firmware manages the power-down and reboot process. To do this it installs a pm_power_off handler, causing @@ -109629,10 +109629,10 @@ index be3d81ff51cc3f510d85e4eed7a52960e51e7bc1..a030ae9fb1fca325061c093696e82186 "%s: pm_power_off function already registered", __func__); -From e305933993b90dcd79a369ad82eb784ba13976b7 Mon Sep 17 00:00:00 2001 +From dfe7f2d62dae24fe15574ac7e2f8366246f59659 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Jul 2015 14:32:47 +0100 -Subject: [PATCH 064/195] mfd: Add Raspberry Pi Sense HAT core driver +Subject: [PATCH 064/218] mfd: Add Raspberry Pi Sense HAT core driver --- drivers/input/joystick/Kconfig | 8 + @@ -110497,10 +110497,10 @@ index 0000000000000000000000000000000000000000..56196dc2af10e464a1e3f98b028dca1c + +#endif -From 39c16fd8cdfb643b6b1d25d325b69528dec1e557 Mon Sep 17 00:00:00 2001 +From 540cdcb47bdf4f5149c53e434bd78c221f55b1aa Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 19:19:08 +0100 -Subject: [PATCH 065/195] ASoC: Add support for HifiBerry DAC +Subject: [PATCH 065/218] ASoC: Add support for HifiBerry DAC This adds a machine driver for the HifiBerry DAC. It is a sound card that can @@ -110675,10 +110675,10 @@ index 0000000000000000000000000000000000000000..45f2b770ad9e67728ca599a7445d6ae9 +MODULE_DESCRIPTION("ASoC Driver for HifiBerry DAC"); +MODULE_LICENSE("GPL v2"); -From c6e16b91138a8839f351f817d7ec1d26f07bee88 Mon Sep 17 00:00:00 2001 +From 3e565e7da017d4f5e0d1bfaa276c897f4d8e21eb Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Mon, 25 Jan 2016 15:48:59 +0000 -Subject: [PATCH 066/195] ASoC: Add support for Rpi-DAC +Subject: [PATCH 066/218] ASoC: Add support for Rpi-DAC --- sound/soc/bcm/Kconfig | 7 +++ @@ -110962,10 +110962,10 @@ index 0000000000000000000000000000000000000000..afe1b419582aa40c4b2729d242bb13cd +MODULE_AUTHOR("Florian Meier "); +MODULE_LICENSE("GPL v2"); -From 769e1919a3117536b396e69abcbef6fd87f9898d Mon Sep 17 00:00:00 2001 +From 54ba948de55649b4311062b960ac598fd1e343de Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Wed, 15 Jan 2014 21:41:23 +0100 -Subject: [PATCH 067/195] ASoC: wm8804: Implement MCLK configuration options, +Subject: [PATCH 067/218] ASoC: wm8804: Implement MCLK configuration options, add 32bit support WM8804 can run with PLL frequencies of 256xfs and 128xfs for most sample rates. At 192kHz only 128xfs is supported. The existing driver selects 128xfs automatically for some lower samples rates. By using an @@ -111014,10 +111014,10 @@ index af95d648265b3e92e345101542b332aee35191d4..513f56ba132929662802d15cdc653af3 .component_driver = { .dapm_widgets = wm8804_dapm_widgets, -From 74f476bd0f05316509027c101c773d82a1069db8 Mon Sep 17 00:00:00 2001 +From 7701371e18ce44bb83097970736a7dd3da70223f Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Wed, 15 Jan 2014 21:42:08 +0100 -Subject: [PATCH 068/195] ASoC: BCM:Add support for HiFiBerry Digi. Driver is +Subject: [PATCH 068/218] ASoC: BCM:Add support for HiFiBerry Digi. Driver is based on the patched WM8804 driver. Signed-off-by: Daniel Matuschek @@ -111361,10 +111361,10 @@ index 0000000000000000000000000000000000000000..19dc953b7227ba86123fc7a2ba654499 +MODULE_DESCRIPTION("ASoC Driver for HifiBerry Digi"); +MODULE_LICENSE("GPL v2"); -From 7c151396e392d3e9bca76bb247f84401f8327867 Mon Sep 17 00:00:00 2001 +From aaa66213b6e0f98430d8d6371f8377d8ee56528f Mon Sep 17 00:00:00 2001 From: Gordon Garrity Date: Sat, 8 Mar 2014 16:56:57 +0000 -Subject: [PATCH 069/195] Add IQaudIO Sound Card support for Raspberry Pi +Subject: [PATCH 069/218] Add IQaudIO Sound Card support for Raspberry Pi Set a limit of 0dB on Digital Volume Control @@ -111694,10 +111694,10 @@ index 0000000000000000000000000000000000000000..4e8e6dec14bcf4a1ff286c43742d4097 +MODULE_DESCRIPTION("ASoC Driver for IQAudio DAC"); +MODULE_LICENSE("GPL v2"); -From 1e5cc1a1e1bb6a4203223b998524ad1a513eb20d Mon Sep 17 00:00:00 2001 +From 4d86db61c9eb9c5037d46078522416dde915999f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 25 Jul 2016 17:06:50 +0100 -Subject: [PATCH 070/195] iqaudio-dac: Compile fix - untested +Subject: [PATCH 070/218] iqaudio-dac: Compile fix - untested --- sound/soc/bcm/iqaudio-dac.c | 6 +++++- @@ -111721,10 +111721,10 @@ index 4e8e6dec14bcf4a1ff286c43742d4097249d6777..aa15bc4b49ca95edec905fddd8fd0a6d if (dapm->dev != codec_dai->dev) return 0; -From 0a636d84b00214c0da8e45362d6244bab46db3c8 Mon Sep 17 00:00:00 2001 +From df7a06f24a6a53798abb2a44a08ece3d390878b1 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Mon, 4 Aug 2014 10:06:56 +0200 -Subject: [PATCH 071/195] Added support for HiFiBerry DAC+ +Subject: [PATCH 071/218] Added support for HiFiBerry DAC+ The driver is based on the HiFiBerry DAC driver. However HiFiBerry DAC+ uses a different codec chip (PCM5122), therefore a new driver is necessary. @@ -112354,10 +112354,10 @@ index 72b19e62f6267698aea45d2410d616d91c1825cb..c6839ef6e16754ed9de2698507b8986a dev_err(dev, "No LRCLK?\n"); return -EINVAL; -From ab6aef1455d7af93189b0b251b1064e4b16b3545 Mon Sep 17 00:00:00 2001 +From 29decd4832a192d1e26d42ecbe6f2c6982f5c76c Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Mon, 4 Aug 2014 11:09:58 +0200 -Subject: [PATCH 072/195] Added driver for HiFiBerry Amp amplifier add-on board +Subject: [PATCH 072/218] Added driver for HiFiBerry Amp amplifier add-on board The driver contains a low-level hardware driver for the TAS5713 and the drivers for the Raspberry Pi I2S subsystem. @@ -113197,10 +113197,10 @@ index 0000000000000000000000000000000000000000..8f019e04898754d2f87e9630137be9e8 + +#endif /* _TAS5713_H */ -From baa874a48eb5a5ce3781d82d87c27195df5b3d38 Mon Sep 17 00:00:00 2001 +From ba33415ed5a3c32bc9559eecb7f8fa13d1b1c337 Mon Sep 17 00:00:00 2001 From: Ryan Coe Date: Sat, 31 Jan 2015 18:25:49 -0700 -Subject: [PATCH 073/195] Update ds1307 driver for device-tree support +Subject: [PATCH 073/218] Update ds1307 driver for device-tree support Signed-off-by: Ryan Coe --- @@ -113227,10 +113227,10 @@ index 4e31036ee2596dec93accd26f627c5b95591ae9f..b92044cf03e750afa521a93519500e9d .driver = { .name = "rtc-ds1307", -From de9149fddd927a93bfb8773a62d342fd4f67ae77 Mon Sep 17 00:00:00 2001 +From 7b813c571adfa61cbfa3fe3abb9a6a65d70c6ad6 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 25 Mar 2015 09:26:17 +0100 -Subject: [PATCH 074/195] Add driver for rpi-proto +Subject: [PATCH 074/218] Add driver for rpi-proto Forward port of 3.10.x driver from https://github.com/koalo We are using a custom board and would like to use rpi 3.18.x @@ -113446,10 +113446,10 @@ index 0000000000000000000000000000000000000000..9db678e885efd63d84d60a098a84ed67 +MODULE_DESCRIPTION("ASoC Driver for Raspberry Pi connected to PROTO board (WM8731)"); +MODULE_LICENSE("GPL"); -From ea17db7f586c076b7cbe74ce08b9073529d84a61 Mon Sep 17 00:00:00 2001 +From a0a0460bd27f5fc1103198760614f2e85b8d476c Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Mon, 24 Aug 2015 16:03:47 +0100 -Subject: [PATCH 075/195] RaspiDAC3 support +Subject: [PATCH 075/218] RaspiDAC3 support Signed-off-by: Jan Grulich @@ -113692,10 +113692,10 @@ index 0000000000000000000000000000000000000000..dd9eeea2af0382307f437e6db09d1546 +MODULE_DESCRIPTION("ASoC Driver for RaspiDAC Rev.3x"); +MODULE_LICENSE("GPL v2"); -From 1a9ea34f03d648405cfa78248d9c7fa06a2a778c Mon Sep 17 00:00:00 2001 +From c39d8e02d67e4e99078ac26f0137cfe92c4ecfb0 Mon Sep 17 00:00:00 2001 From: Aaron Shaw Date: Thu, 7 Apr 2016 21:26:21 +0100 -Subject: [PATCH 076/195] Add Support for JustBoom Audio boards +Subject: [PATCH 076/218] Add Support for JustBoom Audio boards justboom-dac: Adjust for ALSA API change @@ -114149,10 +114149,10 @@ index 0000000000000000000000000000000000000000..91acb666380faa3c0deb2230f8a0f8bb +MODULE_DESCRIPTION("ASoC Driver for JustBoom PI Digi HAT Sound Card"); +MODULE_LICENSE("GPL v2"); -From c9f42c05645277bc80d2d3f7f1545fd79fad240c Mon Sep 17 00:00:00 2001 +From 5f3f2da4ee3ea9c624e95e1e2252473417a5ac16 Mon Sep 17 00:00:00 2001 From: Andrey Grodzovsky Date: Tue, 3 May 2016 22:10:59 -0400 -Subject: [PATCH 077/195] ARM: adau1977-adc: Add basic machine driver for +Subject: [PATCH 077/218] ARM: adau1977-adc: Add basic machine driver for adau1977 codec driver. This commit adds basic support for the codec usage including: Device tree overlay, @@ -114334,10 +114334,10 @@ index 0000000000000000000000000000000000000000..6e2ee027926ee63c89222f75ceb89e3d +MODULE_DESCRIPTION("ASoC Driver for ADAU1977 ADC"); +MODULE_LICENSE("GPL v2"); -From 61a4cb778e449eb643be5f8e1d5399b5256cfa68 Mon Sep 17 00:00:00 2001 +From 74de3f54c5afb269c2fd54c4634eb3a4ba5f5970 Mon Sep 17 00:00:00 2001 From: Matt Flax Date: Mon, 16 May 2016 21:36:31 +1000 -Subject: [PATCH 078/195] New AudioInjector.net Pi soundcard with low jitter +Subject: [PATCH 078/218] New AudioInjector.net Pi soundcard with low jitter audio in and out. Contains the sound/soc/bcm ALSA machine driver and necessary alterations to the Kconfig and Makefile. @@ -114588,10 +114588,10 @@ index 0000000000000000000000000000000000000000..ef54e0f07ea03f59e9957b5d98f3e7fd +MODULE_ALIAS("platform:audioinjector-pi-soundcard"); + -From d30e5affce1120c75a2541ae3ba0419960e747d3 Mon Sep 17 00:00:00 2001 +From aafa67930ffb8b5894caa32b2b560a94a1cd755c Mon Sep 17 00:00:00 2001 From: DigitalDreamtime Date: Thu, 30 Jun 2016 18:38:42 +0100 -Subject: [PATCH 079/195] Add IQAudIO Digi WM8804 board support +Subject: [PATCH 079/218] Add IQAudIO Digi WM8804 board support Support IQAudIO Digi board with iqaudio_digi machine driver and iqaudio-digi-wm8804-audio overlay. @@ -114891,10 +114891,10 @@ index 0000000000000000000000000000000000000000..9b6e829bcb5b1762a853775e78163196 +MODULE_DESCRIPTION("ASoC Driver for IQAudIO WM8804 Digi"); +MODULE_LICENSE("GPL v2"); -From f8ee16577547400d84d47e0c8b55978dd6c33fac Mon Sep 17 00:00:00 2001 +From 4cff7d46d832bacdaa31fd7e1f94d4020bd7bf1d Mon Sep 17 00:00:00 2001 From: escalator2015 Date: Tue, 24 May 2016 16:20:09 +0100 -Subject: [PATCH 080/195] New driver for RRA DigiDAC1 soundcard using WM8741 + +Subject: [PATCH 080/218] New driver for RRA DigiDAC1 soundcard using WM8741 + WM8804 --- @@ -115367,10 +115367,10 @@ index 0000000000000000000000000000000000000000..446796e7e4c14a7d95b2f2a01211d9a0 +MODULE_DESCRIPTION("ASoC Driver for RRA DigiDAC1"); +MODULE_LICENSE("GPL v2"); -From ebb9e9e05bec1d8f38f77aeed5179e1a1f368d3a Mon Sep 17 00:00:00 2001 +From 709f7d5a16bfe63063b19bc21d3ca2f66aef0e87 Mon Sep 17 00:00:00 2001 From: DigitalDreamtime Date: Sat, 2 Jul 2016 16:26:19 +0100 -Subject: [PATCH 081/195] Add support for Dion Audio LOCO DAC-AMP HAT +Subject: [PATCH 081/218] Add support for Dion Audio LOCO DAC-AMP HAT Using dedicated machine driver and pcm5102a codec driver. @@ -115543,10 +115543,10 @@ index 0000000000000000000000000000000000000000..89e65317512bc774453ac8d0d5b0ff98 +MODULE_DESCRIPTION("ASoC Driver for DionAudio LOCO"); +MODULE_LICENSE("GPL v2"); -From 1248d649c9d73f61351422fddbca75d2f736ba2b Mon Sep 17 00:00:00 2001 +From fd3ceaaa95177a0cdd58552c6beded58cbfb3204 Mon Sep 17 00:00:00 2001 From: Clive Messer Date: Mon, 19 Sep 2016 14:01:04 +0100 -Subject: [PATCH 082/195] Allo Piano DAC boards: Initial 2 channel (stereo) +Subject: [PATCH 082/218] Allo Piano DAC boards: Initial 2 channel (stereo) support (#1645) Add initial 2 channel (stereo) support for Allo Piano DAC (2.0/2.1) boards, @@ -115753,10 +115753,10 @@ index 0000000000000000000000000000000000000000..8e8e62e5a36a279b425ed4655cfbac99 +MODULE_DESCRIPTION("ALSA ASoC Machine Driver for Allo Piano DAC"); +MODULE_LICENSE("GPL v2"); -From 40704006ff2a3ccfeefbe480fbcb884b4b225618 Mon Sep 17 00:00:00 2001 +From 9c37e3828cd45d0f2e7dc58446b1e0847426388f Mon Sep 17 00:00:00 2001 From: gtrainavicius Date: Sun, 23 Oct 2016 12:06:53 +0300 -Subject: [PATCH 083/195] Support for Blokas Labs pisound board +Subject: [PATCH 083/218] Support for Blokas Labs pisound board Pisound dynamic overlay (#1760) @@ -116933,10 +116933,10 @@ index 0000000000000000000000000000000000000000..4b8545487d06e4ea70073a5d063fb231 +MODULE_DESCRIPTION("ASoC Driver for pisound, http://blokas.io/pisound"); +MODULE_LICENSE("GPL v2"); -From c6cfce340c9e66d904de0c1a4ac4264c74dcd6c7 Mon Sep 17 00:00:00 2001 +From 2974944eb79031316bfc92affe59d5df954a33ed Mon Sep 17 00:00:00 2001 From: P33M Date: Wed, 21 Oct 2015 14:55:21 +0100 -Subject: [PATCH 084/195] rpi_display: add backlight driver and overlay +Subject: [PATCH 084/218] rpi_display: add backlight driver and overlay Add a mailbox-driven backlight controller for the Raspberry Pi DSI touchscreen display. Requires updated GPU firmware to recognise the @@ -117105,10 +117105,10 @@ index 0000000000000000000000000000000000000000..14a0d9b037395497c1fdae2961feccd5 +MODULE_DESCRIPTION("Raspberry Pi mailbox based Backlight Driver"); +MODULE_LICENSE("GPL"); -From ccdfe767d04450d7309f13a573a8aaf74adf8059 Mon Sep 17 00:00:00 2001 +From ce679e61bff1017cb514723e77e074bf4bc4b7df Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 23 Feb 2016 19:56:04 +0000 -Subject: [PATCH 085/195] bcm2835-virtgpio: Virtual GPIO driver +Subject: [PATCH 085/218] bcm2835-virtgpio: Virtual GPIO driver Add a virtual GPIO driver that uses the firmware mailbox interface to request that the VPU toggles LEDs. @@ -117382,10 +117382,10 @@ index b0f6e33bd30c35664ceee057f4c3ad32b914291d..e92278968b2b979db2a1f855f70e7aaf RPI_FIRMWARE_FRAMEBUFFER_SET_BACKLIGHT = 0x0004800f, -From 4264026d5a660c3a083ce7f69bcb1ced3b86c7c1 Mon Sep 17 00:00:00 2001 +From fa865f8ae8697b140fb9ed78e7e3ca7dfaa64a07 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 23 Feb 2016 17:26:48 +0000 -Subject: [PATCH 086/195] amba_pl011: Don't use DT aliases for numbering +Subject: [PATCH 086/218] amba_pl011: Don't use DT aliases for numbering The pl011 driver looks for DT aliases of the form "serial", and if found uses as the device ID. This can cause @@ -117414,10 +117414,10 @@ index e2c33b9528d82ed7a2c27d083d7b1d222da68178..5a11ff833e1fd112ba04df3a427cd94b uap->old_cr = 0; uap->port.dev = dev; -From 7a7f9524e467f9553bbd6b21c21de36b08a1ff8e Mon Sep 17 00:00:00 2001 +From 2b5ac1985a3751b464d3155a8bc8ac3b167a5ba3 Mon Sep 17 00:00:00 2001 From: Pantelis Antoniou Date: Wed, 3 Dec 2014 13:23:28 +0200 -Subject: [PATCH 087/195] OF: DT-Overlay configfs interface +Subject: [PATCH 087/218] OF: DT-Overlay configfs interface This is a port of Pantelis Antoniou's v3 port that makes use of the new upstreamed configfs support for binary attributes. @@ -117849,10 +117849,10 @@ index 0000000000000000000000000000000000000000..0037e6868a6cda8706c88194c6a4454b +} +late_initcall(of_cfs_init); -From a8ebf7daf7ec6ed7b0c69bf094afa072fa8d021f Mon Sep 17 00:00:00 2001 +From 50468f3194787eab674581c490b66cf5693cb060 Mon Sep 17 00:00:00 2001 From: Cheong2K Date: Fri, 26 Feb 2016 18:20:10 +0800 -Subject: [PATCH 088/195] brcm: adds support for BCM43341 wifi +Subject: [PATCH 088/218] brcm: adds support for BCM43341 wifi brcmfmac: Disable power management @@ -117983,7 +117983,7 @@ index 3e15d64c64813513bc22202dd9e468588699abb0..4051780f64f44a5ce522babe6c371a1b MODULE_PARM_DESC(roamoff, "Do not use internal roaming engine"); diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c -index b892dac70f4b02f76e01a7ccb580c6d8aed4bfe4..db5f8b70b407879f1c006ca4b7ab78d12974609d 100644 +index 2458e6e05276c3ff7cb067bdfa1edf34a1eec09b..d13826095c09f5b4037625371fe648900c9d670a 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c @@ -604,6 +604,7 @@ BRCMF_FW_NVRAM_DEF(4329, "brcmfmac4329-sdio.bin", "brcmfmac4329-sdio.txt"); @@ -118015,10 +118015,10 @@ index d0407d9ad7827cd756b6311410ffe2d9a7cacc78..f1fb8a3c7a3211e8429585861f2f42e0 #define BRCM_CC_4335_CHIP_ID 0x4335 #define BRCM_CC_4339_CHIP_ID 0x4339 -From 187a4873783f427e90afdc0712a8552581196465 Mon Sep 17 00:00:00 2001 +From 4a73ed11dfe1b97dc5e41a852fa89bac2f6985a0 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 17 Dec 2015 13:37:07 +0000 -Subject: [PATCH 089/195] hci_h5: Don't send conf_req when ACTIVE +Subject: [PATCH 089/218] hci_h5: Don't send conf_req when ACTIVE Without this patch, a modem and kernel can continuously bombard each other with conf_req and conf_rsp messages, in a demented game of tag. @@ -118041,10 +118041,10 @@ index 0879d64b1caf58afb6e5d494c07d9ab7e7cdf983..5161ab30fd533d50f516bb93d5b9f402 if (H5_HDR_LEN(hdr) > 2) h5->tx_win = (data[2] & 0x07); -From b934aa13b89512d92b7b16739c7aa1c8583320d2 Mon Sep 17 00:00:00 2001 +From 11b51311723815f63d7b9d8461721f8a972a78dc Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 13 Apr 2015 17:16:29 +0100 -Subject: [PATCH 090/195] config: Add default configs +Subject: [PATCH 090/218] config: Add default configs --- arch/arm/configs/bcm2709_defconfig | 1297 +++++++++++++++++++++++++++++++++++ @@ -120671,10 +120671,10 @@ index 0000000000000000000000000000000000000000..8acee9f31202ec14f2933d92dd70831c +CONFIG_CRC_ITU_T=y +CONFIG_LIBCRC32C=y -From 0f5daea12d673823d4db5c76fdd6ba565820730b Mon Sep 17 00:00:00 2001 +From 424977b72a54d3908735fd1ba26fc884b41c7472 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Wed, 24 Aug 2016 03:35:56 -0700 -Subject: [PATCH 091/195] Add arm64 configuration and device tree differences. +Subject: [PATCH 091/218] Add arm64 configuration and device tree differences. Disable MMC_BCM2835_SDHOST and MMC_BCM2835 since these drivers are crashing at the moment. @@ -122089,10 +122089,10 @@ index 0000000000000000000000000000000000000000..d7406f5a4620151044b8f716b4d10bb8 +CONFIG_LIBCRC32C=y +CONFIG_BCM2708_VCHIQ=n -From 7fa960ca92313064fbff20339d0d78780aa56e71 Mon Sep 17 00:00:00 2001 +From 04a4a31a812a46493fa4a47731ade757bbc1167f Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 7 Mar 2016 15:05:11 +0000 -Subject: [PATCH 092/195] vchiq_arm: Tweak the logging output +Subject: [PATCH 092/218] vchiq_arm: Tweak the logging output Signed-off-by: Phil Elwell --- @@ -122167,10 +122167,10 @@ index 2c98da4307dff994a00dc246574ef0aaee05d5da..160db24aeea33a8296923501009c1f02 switch (type) { -From d66e132c23099fcfdd723516415ecefea4942a02 Mon Sep 17 00:00:00 2001 +From dc49d8e344521a27ef12aeeda2a91d5e3b2d5ec9 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 23 Mar 2016 14:16:25 +0000 -Subject: [PATCH 093/195] vchiq_arm: Access the dequeue_pending flag locked +Subject: [PATCH 093/218] vchiq_arm: Access the dequeue_pending flag locked Reading through this code looking for another problem (now found in userland) the use of dequeue_pending outside a lock didn't seem safe. @@ -122228,10 +122228,10 @@ index 7b6cd4d80621e38ff6d47fcd87b45fbe9cd4259b..d8669fa7f39b077877eca1829ba9538b return add_completion(instance, reason, header, user_service, -From 5ae56ab06076aa6754197e167fb0e9a40d667332 Mon Sep 17 00:00:00 2001 +From 05274c0b04073c8eaba6fed99ebb4b2d3c9bc441 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 23 Mar 2016 20:53:47 +0000 -Subject: [PATCH 094/195] vchiq_arm: Service callbacks must not fail +Subject: [PATCH 094/218] vchiq_arm: Service callbacks must not fail Service callbacks are not allowed to return an error. The internal callback that delivers events and messages to user tasks does not enqueue them if @@ -122257,10 +122257,10 @@ index d8669fa7f39b077877eca1829ba9538bf2e21a82..54552c6ce54f413c9781ba279b936f98 DEBUG_TRACE(SERVICE_CALLBACK_LINE); } -From bd4af8e5bcdc6f1151627932fa34008676e40314 Mon Sep 17 00:00:00 2001 +From ef469b76c3f6a3310e5f86cf4aef487ad812fcb1 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 21 Apr 2016 13:49:32 +0100 -Subject: [PATCH 095/195] vchiq_arm: Add completion records under the mutex +Subject: [PATCH 095/218] vchiq_arm: Add completion records under the mutex An issue was observed when flushing openmax components which generate a large number of messages returning @@ -122323,10 +122323,10 @@ index 54552c6ce54f413c9781ba279b936f98be4f47b0..bde8955b7d8505d73579b77b5b392154 return VCHIQ_SUCCESS; -From 3d1b86af5ee432a855f431eb9e64ba5822cb4f35 Mon Sep 17 00:00:00 2001 +From 9652d5940973327a07df78f03b8702cca86c448c Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 20 Jun 2016 13:51:44 +0100 -Subject: [PATCH 096/195] vchiq_arm: Avoid use of mutex in add_completion +Subject: [PATCH 096/218] vchiq_arm: Avoid use of mutex in add_completion Claiming the completion_mutex within add_completion did prevent some messages appearing twice, but provokes a deadlock caused by vcsm using @@ -122520,10 +122520,10 @@ index 160db24aeea33a8296923501009c1f02bc41e599..71a3bedc55314f3b22dbff40c05dedf0 up(&state->slot_available_event); } -From 3be21930df531cedf33eab0cbc18190da728cc5b Mon Sep 17 00:00:00 2001 +From f87b3c8d50da44368da15bad05fe27e8288a37fd Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 3 Oct 2016 10:14:10 -0700 -Subject: [PATCH 097/195] staging/vchi: Convert to current get_user_pages() +Subject: [PATCH 097/218] staging/vchi: Convert to current get_user_pages() arguments. Signed-off-by: Eric Anholt @@ -122560,10 +122560,10 @@ index e5cdda12c7e5c35c69eb96991cfdb8326def167f..085d37588c59198b4e5f00b9249bb842 num_pages, /* len */ 0, /* gup_flags */ -From 5a19fb1bf33a7eda64ea20072904b7ac2154111a Mon Sep 17 00:00:00 2001 +From 413d0c8e605ebe7764382cdfa68621e4404ef129 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 3 Oct 2016 10:16:03 -0700 -Subject: [PATCH 098/195] staging/vchi: Update for rename of +Subject: [PATCH 098/218] staging/vchi: Update for rename of page_cache_release() to put_page(). Signed-off-by: Eric Anholt @@ -122608,10 +122608,10 @@ index 085d37588c59198b4e5f00b9249bb8421695854f..5a2b8fb459ebe086ec229f37b6381bdb kfree(pages); } -From 11ddfb1cdc823b389a88d10c157b0b0978558be4 Mon Sep 17 00:00:00 2001 +From d8437d9b2ebfb647dce38a2c6123a3efab47982b Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 3 Oct 2016 10:21:17 -0700 -Subject: [PATCH 099/195] drivers/vchi: Remove dependency on CONFIG_BROKEN. +Subject: [PATCH 099/218] drivers/vchi: Remove dependency on CONFIG_BROKEN. The driver builds now. @@ -122633,10 +122633,10 @@ index 9676fb29075a457109e4d4235f086987aec74868..db8e1beb89f9f8c48ea5964016c8285e help Kernel to VideoCore communication interface for the -From 4634b593be96a6a8334e1e8ce454b43faf3f9ada Mon Sep 17 00:00:00 2001 +From 5f8a862d2f906dc4c2cca5ae6f1e4ba6a0c9a3b5 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 14 Sep 2016 09:16:19 +0100 -Subject: [PATCH 100/195] raspberrypi-firmware: Export the general transaction +Subject: [PATCH 100/218] raspberrypi-firmware: Export the general transaction function. The vc4-firmware-kms module is going to be doing the MBOX FB call. @@ -122680,10 +122680,10 @@ index e92278968b2b979db2a1f855f70e7aafb224fa98..09e3d871d110eb0762ebdb5ea3293537 #endif /* __SOC_RASPBERRY_FIRMWARE_H__ */ -From 0287716933dc2e9c903098b9d92b83a9df4cd1e8 Mon Sep 17 00:00:00 2001 +From 0bcc5c96d2d2968c08b415cd4cae06436c0bffa2 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 14 Sep 2016 09:18:09 +0100 -Subject: [PATCH 101/195] raspberrypi-firmware: Define the MBOX channel in the +Subject: [PATCH 101/218] raspberrypi-firmware: Define the MBOX channel in the header. Signed-off-by: Eric Anholt @@ -122705,10 +122705,10 @@ index 09e3d871d110eb0762ebdb5ea329353738d58661..2859db09e25bb945251e85edb39bc434 enum rpi_firmware_property_status { -From 503c31b4182d2829f5f15fd212efc826a716d120 Mon Sep 17 00:00:00 2001 +From 642a5b8183dad8854807a49143df68b2a1f2e777 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 14 Sep 2016 08:39:33 +0100 -Subject: [PATCH 102/195] drm/vc4: Add a mode for using the closed firmware for +Subject: [PATCH 102/218] drm/vc4: Add a mode for using the closed firmware for display. Signed-off-by: Eric Anholt @@ -122734,10 +122734,10 @@ index fb77db755e0a29d8589860da82186c7a1f394c72..c6dd06cca9830018c39b3b16afe4045e vc4_gem.o \ vc4_hdmi.o \ diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c -index d544ff9b0d4609aae945960bf82e8aeee6bc94a8..13212788eef0e4b77c1e92e6bf3a56c817c50322 100644 +index 7aadce1f7e7a0e56b302bded53ad8c0d5977cc22..bdf32c572fc2c46932daca934dfb002d05493883 100644 --- a/drivers/gpu/drm/vc4/vc4_crtc.c +++ b/drivers/gpu/drm/vc4/vc4_crtc.c -@@ -163,6 +163,9 @@ int vc4_crtc_get_scanoutpos(struct drm_device *dev, unsigned int crtc_id, +@@ -162,6 +162,9 @@ int vc4_crtc_get_scanoutpos(struct drm_device *dev, unsigned int crtc_id, int vblank_lines; int ret = 0; @@ -122747,7 +122747,7 @@ index d544ff9b0d4609aae945960bf82e8aeee6bc94a8..13212788eef0e4b77c1e92e6bf3a56c8 /* preempt_disable_rt() should go right here in PREEMPT_RT patchset. */ /* Get optional system timestamp before query. */ -@@ -656,6 +659,11 @@ int vc4_enable_vblank(struct drm_device *dev, unsigned int crtc_id) +@@ -655,6 +658,11 @@ int vc4_enable_vblank(struct drm_device *dev, unsigned int crtc_id) struct vc4_dev *vc4 = to_vc4_dev(dev); struct vc4_crtc *vc4_crtc = vc4->crtc[crtc_id]; @@ -122759,7 +122759,7 @@ index d544ff9b0d4609aae945960bf82e8aeee6bc94a8..13212788eef0e4b77c1e92e6bf3a56c8 CRTC_WRITE(PV_INTEN, PV_INT_VFP_START); return 0; -@@ -666,6 +674,11 @@ void vc4_disable_vblank(struct drm_device *dev, unsigned int crtc_id) +@@ -665,6 +673,11 @@ void vc4_disable_vblank(struct drm_device *dev, unsigned int crtc_id) struct vc4_dev *vc4 = to_vc4_dev(dev); struct vc4_crtc *vc4_crtc = vc4->crtc[crtc_id]; @@ -122772,10 +122772,10 @@ index d544ff9b0d4609aae945960bf82e8aeee6bc94a8..13212788eef0e4b77c1e92e6bf3a56c8 } diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c -index 8703f56b794774ac4130a7b487472e293ebe7cdf..6c4a4fbc86d0a30a6977b2081bca4372e693b817 100644 +index 246d1aea87bc91eb09378dda54dd23e22c47ca8f..e0b4c4d475ad72682e2119fc2983afb91ac6fb02 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c -@@ -292,6 +292,7 @@ static struct platform_driver *const component_drivers[] = { +@@ -295,6 +295,7 @@ static struct platform_driver *const component_drivers[] = { &vc4_dpi_driver, &vc4_hvs_driver, &vc4_crtc_driver, @@ -122784,7 +122784,7 @@ index 8703f56b794774ac4130a7b487472e293ebe7cdf..6c4a4fbc86d0a30a6977b2081bca4372 }; diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h -index 7c1e4d97486fb57d9ce7002c30a23138519761ae..e1f6ab747f36dd412e00a1e7ea772f13c2fc32d5 100644 +index 50a55ef999d6f669542306aa71e56ce47cb12951..b9169550bf15504f1ff3d8b31a3710e9b4c42e88 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.h +++ b/drivers/gpu/drm/vc4/vc4_drv.h @@ -12,6 +12,9 @@ @@ -122797,7 +122797,7 @@ index 7c1e4d97486fb57d9ce7002c30a23138519761ae..e1f6ab747f36dd412e00a1e7ea772f13 struct vc4_hdmi *hdmi; struct vc4_hvs *hvs; struct vc4_crtc *crtc[3]; -@@ -460,6 +463,10 @@ void __iomem *vc4_ioremap_regs(struct platform_device *dev, int index); +@@ -462,6 +465,10 @@ void __iomem *vc4_ioremap_regs(struct platform_device *dev, int index); extern struct platform_driver vc4_dpi_driver; int vc4_dpi_debugfs_regs(struct seq_file *m, void *unused); @@ -123475,10 +123475,10 @@ index 0000000000000000000000000000000000000000..d18a1dae51a2275846c9826b5bf1ba57 + }, +}; -From 3d453cda638ea3a152f1de6138e9513f0f94daeb Mon Sep 17 00:00:00 2001 +From b675ada7f1a84f52793a390c51b305fb13ede51f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Sat, 17 Sep 2016 15:07:10 +0200 -Subject: [PATCH 103/195] i2c: bcm2835: Fix hang for writing messages larger +Subject: [PATCH 103/218] i2c: bcm2835: Fix hang for writing messages larger than 16 bytes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -123568,10 +123568,10 @@ index d4f3239b56865919e1b781b20a7c5ebcd76b4eb9..f283b714aa79e2e4685ed95b04b6b289 i2c_dev->msg_buf_remaining = msg->len; reinit_completion(&i2c_dev->completion); -From 0330bcd32b9a41ef4a8db70c8c9d2190ddcd55fe Mon Sep 17 00:00:00 2001 +From fd4534326a4b6a706b81b76e18410fe91615da11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 23 Sep 2016 18:24:38 +0200 -Subject: [PATCH 104/195] i2c: bcm2835: Protect against unexpected TXW/RXR +Subject: [PATCH 104/218] i2c: bcm2835: Protect against unexpected TXW/RXR interrupts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -123696,10 +123696,10 @@ index f283b714aa79e2e4685ed95b04b6b289f7e9eee7..d2ba1a4de36af512e8e3c97251bd3537 return -ETIMEDOUT; } -From 7af5f0b0c52cc280acab000e67068e57ba3dd161 Mon Sep 17 00:00:00 2001 +From dfce104be6d350929d1c93da8ce194d5e4b8bbd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Mon, 19 Sep 2016 17:19:41 +0200 -Subject: [PATCH 105/195] i2c: bcm2835: Use dev_dbg logging on transfer errors +Subject: [PATCH 105/218] i2c: bcm2835: Use dev_dbg logging on transfer errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -123731,10 +123731,10 @@ index d2ba1a4de36af512e8e3c97251bd3537ae61591a..54d510abd46a117c9238fc6d7edec840 if (i2c_dev->msg_err & BCM2835_I2C_S_ERR) return -EREMOTEIO; -From 6e2adc26f61ad18adedd24d0e4f8e3fab02619e3 Mon Sep 17 00:00:00 2001 +From f41a248b33e2432839f40f52a09e1d4d8cbc81ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Thu, 22 Sep 2016 22:05:50 +0200 -Subject: [PATCH 106/195] i2c: bcm2835: Can't support I2C_M_IGNORE_NAK +Subject: [PATCH 106/218] i2c: bcm2835: Can't support I2C_M_IGNORE_NAK MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -123778,10 +123778,10 @@ index 54d510abd46a117c9238fc6d7edec84019d1f60d..565ef69ce61423544dc0558c85ef318b if (i2c_dev->msg_err & BCM2835_I2C_S_ERR) -From 62fe714dbc4d4f24dc6c99e1c2c3204ff6521532 Mon Sep 17 00:00:00 2001 +From d6d13ab633948cee059f172e72b0e85f745ca97c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 23 Sep 2016 04:54:27 +0200 -Subject: [PATCH 107/195] i2c: bcm2835: Add support for Repeated Start +Subject: [PATCH 107/218] i2c: bcm2835: Add support for Repeated Start Condition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -123963,10 +123963,10 @@ index 565ef69ce61423544dc0558c85ef318b0ae9c324..241e08ae7c27cec23fad3c1bf3ebad3a static u32 bcm2835_i2c_func(struct i2c_adapter *adap) -From 0605626412fb91762d08c82e2f9974fa4dc2db40 Mon Sep 17 00:00:00 2001 +From 5739991f3a5b79a86800059e33046b8cb0dda64b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 23 Sep 2016 04:57:17 +0200 -Subject: [PATCH 108/195] i2c: bcm2835: Support i2c-dev ioctl I2C_TIMEOUT +Subject: [PATCH 108/218] i2c: bcm2835: Support i2c-dev ioctl I2C_TIMEOUT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -124003,10 +124003,10 @@ index 241e08ae7c27cec23fad3c1bf3ebad3a4d2a8e6f..d2085dd3742eabebc537621968088261 bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_C, BCM2835_I2C_C_CLEAR); -From c50169d545289bc8b801fd4f71a19b501e010f1b Mon Sep 17 00:00:00 2001 +From 078f32a8780445ba5e09f0ba1313d971f8188410 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Tue, 27 Sep 2016 01:00:08 +0200 -Subject: [PATCH 109/195] i2c: bcm2835: Add support for dynamic clock +Subject: [PATCH 109/218] i2c: bcm2835: Add support for dynamic clock MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -124122,10 +124122,10 @@ index d2085dd3742eabebc537621968088261f8dc7ea8..c3436f627028477f7e21b47e079fd5ab irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); if (!irq) { -From a38a28c20aab9fabad173747b16af305fdc26c6b Mon Sep 17 00:00:00 2001 +From 88d0ab8911f2fadda12dabb76b1d093de592a483 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Tue, 1 Nov 2016 15:15:41 +0100 -Subject: [PATCH 110/195] i2c: bcm2835: Add debug support +Subject: [PATCH 110/218] i2c: bcm2835: Add debug support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -124314,10 +124314,10 @@ index c3436f627028477f7e21b47e079fd5ab06ec188a..8642f580ce41803bd22c76a0fa80d083 if (i2c_dev->msg_err & BCM2835_I2C_S_ERR) return -EREMOTEIO; -From 18ba3147166a0262f9ac8079b799c2b0e9be0be7 Mon Sep 17 00:00:00 2001 +From d4bb48eaa6e4e3ec73de8bd558c7cb8359569ae3 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sat, 31 Dec 2016 14:15:50 +0000 -Subject: [PATCH 111/195] arm64: Add CONFIG_ARCH_BCM2835 +Subject: [PATCH 111/218] arm64: Add CONFIG_ARCH_BCM2835 --- arch/arm64/configs/bcmrpi3_defconfig | 1 + @@ -124333,10 +124333,10 @@ index d7406f5a4620151044b8f716b4d10bb818648e06..53da5c7a33e5898a66e549fb0c39fe3d CONFIG_BCM2708_VCHIQ=n +CONFIG_ARCH_BCM2835=y -From 399bbbda9c86b465662ab8947d6e5cae85fbefb3 Mon Sep 17 00:00:00 2001 +From 1386cfc60c00bc2b60c1f74843bfe028b605f92c Mon Sep 17 00:00:00 2001 From: Alex Tucker Date: Tue, 13 Dec 2016 19:50:18 +0000 -Subject: [PATCH 112/195] Add support for Silicon Labs Si7013/20/21 +Subject: [PATCH 112/218] Add support for Silicon Labs Si7013/20/21 humidity/temperature sensor. --- @@ -124411,10 +124411,10 @@ index f6d134c095af2398fc55ae7d2b0e86456c30627c..31bda8da4cb6a56bfe493a81b9189009 }; }; -From a161376aa66655e0f84ed571c245ee28618dff74 Mon Sep 17 00:00:00 2001 +From d124669153b18e6282437fa4d1a2730c55c6c46a Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 3 Jan 2017 21:27:46 +0000 -Subject: [PATCH 113/195] Document the si7020 option +Subject: [PATCH 113/218] Document the si7020 option --- arch/arm/boot/dts/overlays/README | 3 +++ @@ -124435,10 +124435,10 @@ index 81d991803be335e5a1bc3bb0a8c7a2c9f5c392bd..e8fa4ccb44c34a20485c4e6155467af9 Name: i2c0-bcm2708 Info: Enable the i2c_bcm2708 driver for the i2c0 bus. Not all pin combinations -From ba601d323d66f07d5633b6e2ac172f955c73a9d3 Mon Sep 17 00:00:00 2001 +From 248e068023e8046d04d3108a20d96244abd555c2 Mon Sep 17 00:00:00 2001 From: Giedrius Trainavicius Date: Thu, 5 Jan 2017 02:38:16 +0200 -Subject: [PATCH 114/195] pisound improvements: +Subject: [PATCH 114/218] pisound improvements: * Added a writable sysfs object to enable scripts / user space software to blink MIDI activity LEDs for variable duration. @@ -124732,10 +124732,10 @@ index 4b8545487d06e4ea70073a5d063fb2310b3b94d0..ba70734b89e61a11201657406223f0b3 }; -From a7c9cb11108b471f0e8b8968c25a98d2648f8481 Mon Sep 17 00:00:00 2001 +From ec0a70fef448bca0c206850ec27ed5b5c938d94c Mon Sep 17 00:00:00 2001 From: Aaron Shaw Date: Tue, 10 Jan 2017 16:05:41 +0000 -Subject: [PATCH 115/195] Add driver_name property +Subject: [PATCH 115/218] Add driver_name property Add driver name property for use with 5.1 passthrough audio in LibreElec and other Kodi based OSs --- @@ -124755,10 +124755,10 @@ index 8fd50dbe681508a2cfe8fdde1c9fedbe9a507fa7..05a224ec712d06b8b7587ab6b8bb562d .dai_link = snd_rpi_justboom_dac_dai, .num_links = ARRAY_SIZE(snd_rpi_justboom_dac_dai), -From f279ff78af42028bfa11c3cf54db5b5b2e6b643e Mon Sep 17 00:00:00 2001 +From 0f65d151948e178a58561c6af317d6696896cbe1 Mon Sep 17 00:00:00 2001 From: Aaron Shaw Date: Tue, 10 Jan 2017 16:11:04 +0000 -Subject: [PATCH 116/195] Add driver_name paramater +Subject: [PATCH 116/218] Add driver_name paramater Add driver_name parameter for use with 5.1 passthrough audio in LibreElec and other Kodi OSs --- @@ -124778,10 +124778,10 @@ index 91acb666380faa3c0deb2230f8a0f8bbec59417b..abfdc5c4dd5811e6847bddda4921abe3 .dai_link = snd_rpi_justboom_digi_dai, .num_links = ARRAY_SIZE(snd_rpi_justboom_digi_dai), -From 702cad8fa0743fcddf9f24679595f2dbb0836db2 Mon Sep 17 00:00:00 2001 +From 1dedf795357bed02eed703c14a34bd830d66bc34 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 11 Jan 2017 13:01:21 +0000 -Subject: [PATCH 117/195] BCM270X_DT: Add pi3-disable-wifi overlay +Subject: [PATCH 117/218] BCM270X_DT: Add pi3-disable-wifi overlay pi3-disable-wifi is a minimal overlay to disable the onboard WiFi. @@ -124842,10 +124842,10 @@ index 0000000000000000000000000000000000000000..017199554bf2f4e381efcc7bb71e750c + }; +}; -From 71b3bd8f27a2d216056c42fb3a2e4bae83214913 Mon Sep 17 00:00:00 2001 +From 31a305729808ac1107b0118320c2a114cd749782 Mon Sep 17 00:00:00 2001 From: Electron752 Date: Thu, 12 Jan 2017 07:07:08 -0800 -Subject: [PATCH 118/195] ARM64: Make it work again on 4.9 (#1790) +Subject: [PATCH 118/218] ARM64: Make it work again on 4.9 (#1790) * Invoke the dtc compiler with the same options used in arm mode. * ARM64 now uses the bcm2835 platform just like ARM32. @@ -125250,10 +125250,10 @@ index 53da5c7a33e5898a66e549fb0c39fe3da555ca87..c7e891d72969a388d9b135a36dbfc9c9 -CONFIG_BCM2708_VCHIQ=n -CONFIG_ARCH_BCM2835=y -From 22a9a07af1c1645942a73264572c1d78790a3ca1 Mon Sep 17 00:00:00 2001 +From 88dff1f7b3fec7d118fd1f36f0ffa3514b8a20db Mon Sep 17 00:00:00 2001 From: Electron752 Date: Sat, 14 Jan 2017 02:54:26 -0800 -Subject: [PATCH 119/195] ARM64: Enable Kernel Address Space Randomization +Subject: [PATCH 119/218] ARM64: Enable Kernel Address Space Randomization (#1792) Randomization allows the mapping between virtual addresses and physical @@ -125285,10 +125285,10 @@ index c7e891d72969a388d9b135a36dbfc9c9cb609bf8..974d8889c0cf695eb88b57bbef11bc5a CONFIG_BINFMT_MISC=y CONFIG_COMPAT=y -From 0bfc172d0141c9ee1b52e26b804d038c307abf48 Mon Sep 17 00:00:00 2001 +From b88294adf9f3dfbf4faecbdbd20aaf87aa755bfb Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Sun, 15 Jan 2017 07:31:59 -0800 -Subject: [PATCH 120/195] ARM64: Enable RTL8187/RTL8192CU wifi in build config +Subject: [PATCH 120/218] ARM64: Enable RTL8187/RTL8192CU wifi in build config These drivers build now, so they can be enabled back in the build configuration just like they are for @@ -125313,10 +125313,10 @@ index 974d8889c0cf695eb88b57bbef11bc5aa556b635..4670a490dfb1e582ec24a3b39a3cb9b2 CONFIG_ZD1211RW=m CONFIG_MAC80211_HWSIM=m -From e4a98369f273ef0d908a3c401c58250516743fe4 Mon Sep 17 00:00:00 2001 +From eda69e6370e8a1311cfdcc9a3523a2e3709e7739 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 16 Jan 2017 14:53:12 +0000 -Subject: [PATCH 121/195] BCM270X_DT: Add spi0-cs overlay +Subject: [PATCH 121/218] BCM270X_DT: Add spi0-cs overlay The spi0-cs overlay allows the software chip selectts to be modified using the cs0_pin and cs1_pin parameters. @@ -125404,10 +125404,10 @@ index 0000000000000000000000000000000000000000..7f79029d043c04d7496c7c3480450c69 + }; +}; -From 032f49b76a74e8a3e008500b57b4110b76074367 Mon Sep 17 00:00:00 2001 +From 6aaafe29b7b5a592b8a8f0254fe57987ce880b27 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 1 Jul 2016 22:09:24 +0100 -Subject: [PATCH 122/195] spi-bcm2835: Disable forced software CS +Subject: [PATCH 122/218] spi-bcm2835: Disable forced software CS Select software CS in bcm2708_common.dtsi, and disable the automatic conversion in the driver to allow hardware CS to be re-enabled with an @@ -125433,10 +125433,10 @@ index 74dd21b7373c7564ede01d84a4f63b93a6d52fa7..51cdefbf5eb265f49bd05e0aa91dfbee i2c0: i2c@7e205000 { -From 2c6ee3579798e711652f11090564c85b8dd0a61f Mon Sep 17 00:00:00 2001 +From b67d9f2ea6c8d6bf9a8ad87a57e12a4e161bf3e2 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 16 Jan 2017 16:33:54 +0000 -Subject: [PATCH 123/195] config: Add CONFIG_TCP_CONG_BBR See: +Subject: [PATCH 123/218] config: Add CONFIG_TCP_CONG_BBR See: https://github.com/raspberrypi/linux/issues/1784 --- @@ -125471,10 +125471,10 @@ index 8acee9f31202ec14f2933d92dd70831cda8d7b51..219f67051a2542329449b0099165ae28 CONFIG_IPV6_ROUTER_PREF=y CONFIG_INET6_AH=m -From f1e2e9949f9c263d2b71f5a22a68dc82f4f75e0c Mon Sep 17 00:00:00 2001 +From 1a44615824d1aaba38e052ffea812cf7930d90fa Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 17 Jan 2017 11:34:58 +0000 -Subject: [PATCH 124/195] BCM270X_DT: Enable UART0 on CM3 +Subject: [PATCH 124/218] BCM270X_DT: Enable UART0 on CM3 Signed-off-by: Phil Elwell --- @@ -125497,10 +125497,10 @@ index 41874c25a84226c0e4af92ec4059e0a571fe6123..3ba6e621856c288ae4694f758604619f sdhost_pins: sdhost_pins { brcm,pins = <48 49 50 51 52 53>; -From 2bed88ae6fc96caf74d309f8eb2fd0cb898a0508 Mon Sep 17 00:00:00 2001 +From 18d58c55cf842151c11e5ca7cb255b4e971e6666 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 17 Jan 2017 14:39:39 +0000 -Subject: [PATCH 125/195] config: Add CONFIG_MD_M25P80 and CONFIG_MD_SPI_NOR +Subject: [PATCH 125/218] config: Add CONFIG_MD_M25P80 and CONFIG_MD_SPI_NOR See: https://github.com/raspberrypi/linux/issues/1781 @@ -125539,10 +125539,10 @@ index 219f67051a2542329449b0099165ae2885022bec..c4898d63d74718097ec3a1d1fe60b230 CONFIG_OF_CONFIGFS=y CONFIG_ZRAM=m -From 888b72560efaae991babc6bcb8247d99a8843e9f Mon Sep 17 00:00:00 2001 +From 5cb56ddf89dd8d731900dee3433084578f253699 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Sat, 14 Jan 2017 21:33:51 -0800 -Subject: [PATCH 126/195] ARM64/DWC_OTG: Port dwc_otg driver to ARM64 +Subject: [PATCH 126/218] ARM64/DWC_OTG: Port dwc_otg driver to ARM64 In ARM64, the FIQ mechanism used by this driver is not current implemented. As a workaround, reqular IRQ is used instead @@ -125885,10 +125885,10 @@ index 6b2c7d0c93f36a63863ff4b0ecc1f3eab77e058b..d7b700ff17821ad1944e36721fe6b2db /** The OS page size */ #define DWC_OS_PAGE_SIZE PAGE_SIZE -From 075caeb57400b65595ca25348c032c46abba0935 Mon Sep 17 00:00:00 2001 +From fe4e88fb41f8582463cc014387434ff7b97e1174 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Sat, 14 Jan 2017 21:43:57 -0800 -Subject: [PATCH 127/195] ARM64: Round-Robin dispatch IRQs between CPUs. +Subject: [PATCH 127/218] ARM64: Round-Robin dispatch IRQs between CPUs. IRQ-CPU mapping is round robined on ARM64 to increase concurrency and allow multiple interrupts to be serviced @@ -125962,10 +125962,10 @@ index 93e3f7660c4230c9f1dd3b195958cb498949b0ca..486bcbfb32305ee417f6b3be7e91a3ff .name = "bcm2836-gpu", .irq_mask = bcm2836_arm_irqchip_mask_gpu_irq, -From 898c8c584d1d9041e6b5b55f0d8c39a2e8732586 Mon Sep 17 00:00:00 2001 +From 025f93db9d7e9651c81bd30415a5d6658a1fd094 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Sat, 14 Jan 2017 21:45:03 -0800 -Subject: [PATCH 128/195] ARM64: Enable DWC_OTG Driver In ARM64 Build +Subject: [PATCH 128/218] ARM64: Enable DWC_OTG Driver In ARM64 Build Config(bcmrpi3_defconfig) Signed-off-by: Michael Zoran @@ -125986,10 +125986,10 @@ index 4670a490dfb1e582ec24a3b39a3cb9b2488b1864..8c4392344eb4495689c220d5d176ee8c CONFIG_USB_STORAGE=y CONFIG_USB_STORAGE_REALTEK=m -From b59f70d582069ddda3d06663492f323a778afc54 Mon Sep 17 00:00:00 2001 +From c4f0a0230b8c4a6c8334803a4f4a647fa12e13c5 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Sat, 14 Jan 2017 21:46:04 -0800 -Subject: [PATCH 129/195] ARM64: Use dwc_otg driver by default for USB. +Subject: [PATCH 129/218] ARM64: Use dwc_otg driver by default for USB. If it breaks on anybody, they can use the standard device tree overlays to switch back to the dwc2 driver. @@ -126015,10 +126015,10 @@ index f6def5d7e5d622cf09e8f87332c7374fe28da08b..3e134a1208610b90e2d0fc22f03c6e9f -}; -#endif -From 0e13f224e97732c81a0db37befa57fd32a2de356 Mon Sep 17 00:00:00 2001 +From a51fb6ad83f1b928156479c1a137374c3a7abad8 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 23 Jan 2017 17:36:50 +0000 -Subject: [PATCH 130/195] BCM270X_DT: Add reference to audio_pins to CM dtb +Subject: [PATCH 130/218] BCM270X_DT: Add reference to audio_pins to CM dtb The CM1 dtb contains an empty audio_pins node, but no reference to it. Adding the usual pinctrl reference from the audio node enables the @@ -126046,10 +126046,10 @@ index eb8662f0d222b4c0a9a2bcb8bccb13e86a0006b3..10be69972bd1440f574e35d515f3d6a0 hpd-gpios = <&gpio 46 GPIO_ACTIVE_HIGH>; }; -From add004c65e337c5f2eb1ab1b427bcf7b5a0ca5ee Mon Sep 17 00:00:00 2001 +From dafff07055e0ecb9ddd1c774861f81ac6ad2d5f3 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 25 Jan 2017 11:30:38 +0000 -Subject: [PATCH 131/195] config: Add additional network scheduling modules +Subject: [PATCH 131/218] config: Add additional network scheduling modules --- arch/arm/configs/bcm2709_defconfig | 4 ++++ @@ -126101,10 +126101,10 @@ index c4898d63d74718097ec3a1d1fe60b2307a6a3140..b448eaa866c200f48351819072c7fefc CONFIG_NET_SCH_PLUG=m CONFIG_NET_CLS_BASIC=m -From 14ed05f6ff4efff01f8beaf104b335e8d6196e01 Mon Sep 17 00:00:00 2001 +From eb0d950c048777a39a3918ec15a2136277711032 Mon Sep 17 00:00:00 2001 From: chris johnson Date: Sun, 22 Jan 2017 03:27:31 +0000 -Subject: [PATCH 132/195] ASoC: A simple-card overlay for ADAU7002 +Subject: [PATCH 132/218] ASoC: A simple-card overlay for ADAU7002 Usage: `dtoverlay=adau7002-simple` --- @@ -126202,10 +126202,10 @@ index 0000000000000000000000000000000000000000..e67e6625d7967abc92cf00cb604d4c12 + }; +}; -From b3c252f18abe76a6c2baf3d96ae4f564ee9e63fd Mon Sep 17 00:00:00 2001 +From e820b06e082ddbda6202a2cb5ec443282a9ebed3 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 25 Jan 2017 21:17:23 +0000 -Subject: [PATCH 133/195] config: Add SND_SOC_ADAU7002 codec module +Subject: [PATCH 133/218] config: Add SND_SOC_ADAU7002 codec module As there is now an overlay requiring it, build the codec module. @@ -126240,10 +126240,10 @@ index b448eaa866c200f48351819072c7fefcd8ad8132..5105a592c9bcfee1cc6a8b50fd1c6c32 CONFIG_SND_SOC_WM8804_I2C=m CONFIG_SND_SIMPLE_CARD=m -From cc1e75399cd79c8b5f04553d7c8b82b096e2cb6d Mon Sep 17 00:00:00 2001 +From f42ef958d534020a993b31dfe9225a8b2163b989 Mon Sep 17 00:00:00 2001 From: Scott Ellis Date: Fri, 27 Jan 2017 06:42:42 -0500 -Subject: [PATCH 134/195] Add overlay for mcp3008 adc (#1818) +Subject: [PATCH 134/218] Add overlay for mcp3008 adc (#1818) Some example usage: @@ -126529,10 +126529,10 @@ index 0000000000000000000000000000000000000000..06bf4264959c380d8a9f90f74e780397 + }; +}; -From 4f1552628778bb536c31f9995cfd850b4a50b755 Mon Sep 17 00:00:00 2001 +From e2e5b2ef3ce3b81858ed6fc081b3ed223100ad93 Mon Sep 17 00:00:00 2001 From: ED6E0F17 Date: Fri, 3 Feb 2017 14:52:42 +0000 -Subject: [PATCH 135/195] usb: dwc2: Avoid suspending if we're in gadget mode +Subject: [PATCH 135/218] usb: dwc2: Avoid suspending if we're in gadget mode (#1825) I've found when booting HiKey with the usb gadget cable attached @@ -126584,10 +126584,10 @@ index df5a065780054f21841ca9f08b8ab118922c530b..619ccfe1eafc4643b16970f8a1129ff9 goto skip_power_saving; -From fd8dbe634fba3e38ea71b092d17c566de422861a Mon Sep 17 00:00:00 2001 +From 908307c07112826b9ece740aa55a2d766212f7c0 Mon Sep 17 00:00:00 2001 From: JamesH65 Date: Mon, 6 Feb 2017 15:24:47 +0000 -Subject: [PATCH 136/195] gpio_mem: Remove unnecessary dev_info output (#1830) +Subject: [PATCH 136/218] gpio_mem: Remove unnecessary dev_info output (#1830) The open function was spamming syslog every time called, so have removed call completely. @@ -126609,10 +126609,10 @@ index 911f5b7393ed48ceed8751f06967ae6463453f9c..f5e7f1ba8fb6f18dee77fad06a17480c dev_err(inst->dev, "Unknown minor device: %d", dev); ret = -ENXIO; -From 3d27ab746b042751f2cbe5f20d1769c8b7670bf2 Mon Sep 17 00:00:00 2001 +From 96dd997613adaefb3cf1846fc741aeeb742e930e Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 22 Jan 2017 12:49:36 +0100 -Subject: [PATCH 137/195] config: Enable regulator support +Subject: [PATCH 137/218] config: Enable regulator support Signed-off-by: Matthias Reichl --- @@ -126647,10 +126647,10 @@ index 5105a592c9bcfee1cc6a8b50fd1c6c32f1381158..74bc0d81bcb4d7f6676368926cdcc10e CONFIG_MEDIA_CAMERA_SUPPORT=y CONFIG_MEDIA_ANALOG_TV_SUPPORT=y -From 8ce37c230a68d716ce8ef52b3a8046b3581db2ea Mon Sep 17 00:00:00 2001 +From 0d6de3a0127a8b76e055808eff2dbb709a0b4c65 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 22 Jan 2017 12:49:36 +0100 -Subject: [PATCH 138/195] BCM270x DT: expose 3.3V and 5V system rails +Subject: [PATCH 138/218] BCM270x DT: expose 3.3V and 5V system rails Signed-off-by: Matthias Reichl --- @@ -126683,10 +126683,10 @@ index a46cb4a8b1419edd95e0e07c18b0f373222dc2bf..36d853715f2379e1952ce3d3be58dd67 + }; }; -From 88b83646f91255d69f5b28dca315e203fd166d01 Mon Sep 17 00:00:00 2001 +From 745cdc4867eab7075d4b1cc819aaee9bae59f9cf Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 22 Jan 2017 12:49:36 +0100 -Subject: [PATCH 139/195] BCM270x DT: Consolidate audio card overlays +Subject: [PATCH 139/218] BCM270x DT: Consolidate audio card overlays Reference 3.3V / 5V system rails instead of instantiating local regulators. @@ -126981,10 +126981,10 @@ index 16b1247bfa618ff85936ddf78c3aea58075eaa67..f8d48233e28c7c18509b4a95692f6aff __overlay__ { compatible = "rra,digidac1-soundcard"; -From 7a921dc6dec1cb87b9d80f82bf0257dc1f832db2 Mon Sep 17 00:00:00 2001 +From cb155e93545951acbcaed6eec03e602dbbeb833e Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 22 Jan 2017 12:49:37 +0100 -Subject: [PATCH 140/195] ASoC: Add driver for Cirrus Logic Audio Card +Subject: [PATCH 140/218] ASoC: Add driver for Cirrus Logic Audio Card Note: due to problems with deferred probing of regulators the following softdep should be added to a modprobe.d file @@ -128234,10 +128234,10 @@ index 0000000000000000000000000000000000000000..ac8651ddff7bd3701dffe22c7fb88352 +MODULE_DESCRIPTION("ASoC driver for Cirrus Logic Audio Card"); +MODULE_LICENSE("GPL"); -From b138db8e20b22b49eae437f5e09f9dbdd426d361 Mon Sep 17 00:00:00 2001 +From d5feddd3f0d334a54f6c644d3a31040b6aa23952 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 22 Jan 2017 12:49:37 +0100 -Subject: [PATCH 141/195] config: enable Cirrus Logic Audio Card +Subject: [PATCH 141/218] config: enable Cirrus Logic Audio Card Signed-off-by: Matthias Reichl --- @@ -128286,10 +128286,10 @@ index 74bc0d81bcb4d7f6676368926cdcc10e581fbcae..f0b87d15e959d88eb26e5a11244365da CONFIG_SND_BCM2708_SOC_RPI_PROTO=m CONFIG_SND_BCM2708_SOC_JUSTBOOM_DAC=m -From 8b4fcafdcd5751d4de17efc73613753e81a2356b Mon Sep 17 00:00:00 2001 +From 049a844e099f1f4521b20123289ffe7ab6e4a08a Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 9 Feb 2017 14:33:30 +0000 -Subject: [PATCH 142/195] irq-bcm2836: Avoid "Invalid trigger warning" +Subject: [PATCH 142/218] irq-bcm2836: Avoid "Invalid trigger warning" Initialise the level for each IRQ to avoid a warning from the arm arch timer code. @@ -128313,10 +128313,10 @@ index 486bcbfb32305ee417f6b3be7e91a3ff069a586c..e10597c1a1e51e5e27aa574b6a26d871 static void -From ac97c5241d99a5959c0006f8a93ec56475314fd6 Mon Sep 17 00:00:00 2001 +From 2ed2f273135dc7e29b6d08f6c5f45feacacaeaa7 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 9 Feb 2017 14:36:44 +0000 -Subject: [PATCH 143/195] sound: Demote deferral errors to INFO level +Subject: [PATCH 143/218] sound: Demote deferral errors to INFO level At present there is no mechanism to specify driver load order, which can lead to deferrals and repeated retries until successful. @@ -128351,10 +128351,10 @@ index c0bbcd9032613a78aef551ce697cabc792880bad..a2504d8c83d74d7227e65be142a26cc9 goto _err_defer; } -From 857babba12f76cc0bd003b97e205ca20dc757b3c Mon Sep 17 00:00:00 2001 +From 81a8b36c123ec7d16218e53151fb74902a09ad81 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 9 Feb 2017 14:40:33 +0000 -Subject: [PATCH 144/195] sound: Suppress error message about deferrals +Subject: [PATCH 144/218] sound: Suppress error message about deferrals Since driver load deferrals are expected and will already have resulted in a kernel message, suppress an essentially @@ -128601,10 +128601,10 @@ index 9db678e885efd63d84d60a098a84ed6772b19a2d..fadbfade100228aaafabb0d3bdf35c01 return ret; } -From d64e4501e476bed45f42a626fb77065e0e617275 Mon Sep 17 00:00:00 2001 +From dbdf3251a32c1d9a40b4633d6eb11ab1fd3e83b0 Mon Sep 17 00:00:00 2001 From: Claggy3 Date: Sat, 11 Feb 2017 14:00:30 +0000 -Subject: [PATCH 145/195] Update vfpmodule.c +Subject: [PATCH 145/218] Update vfpmodule.c Christopher Alexander Tobias Schulze - May 2, 2015, 11:57 a.m. This patch fixes a problem with VFP state save and restore related @@ -128741,10 +128741,10 @@ index da0b33deba6d3c2906eef271f253ab7a30a92680..c6f1d6da808cda78a58f184e19e83522 /* * Save the userland NEON/VFP state. Under UP, -From 68f6f36131885058c316ba8d903024243f6b3f4c Mon Sep 17 00:00:00 2001 +From d10a95c9287f613e1bf8e37acd5a1d32a2dcfc07 Mon Sep 17 00:00:00 2001 From: Martin Cerveny Date: Mon, 13 Feb 2017 17:23:47 +0100 -Subject: [PATCH 146/195] dwc_otg: fix summarize urb->actual_length for +Subject: [PATCH 146/218] dwc_otg: fix summarize urb->actual_length for isochronous transfers Kernel does not copy input data of ISO transfers to userspace @@ -128772,40 +128772,10 @@ index 162a656501988e56c9d780b7793d365fde09f801..992269d61ecf48126379a38e528f7190 dwc_otg_hcd_urb_get_iso_desc_status(dwc_otg_urb, i); } -From 5c11c2cd056fdd8cb62112a83f105d9eab2df488 Mon Sep 17 00:00:00 2001 -From: Boris Brezillon -Date: Tue, 22 Nov 2016 12:45:28 -0800 -Subject: [PATCH 147/195] clk: bcm2835: Fix ->fixed_divider of pllh_aux - -There is no fixed divider on pllh_aux. - -Signed-off-by: Boris Brezillon -Signed-off-by: Eric Anholt -Reviewed-by: Eric Anholt -Signed-off-by: Stephen Boyd -(cherry picked from commit f2a46926aba1f0c33944901d2420a6a887455ddc) ---- - drivers/clk/bcm/clk-bcm2835.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c -index 21e2a538ff0d0ab4e63adff9b93705f3d45fa15d..a99ccf9f056d3a3e7c482339e08483f3701ebc04 100644 ---- a/drivers/clk/bcm/clk-bcm2835.c -+++ b/drivers/clk/bcm/clk-bcm2835.c -@@ -1607,7 +1607,7 @@ static const struct bcm2835_clk_desc clk_desc_array[] = { - .a2w_reg = A2W_PLLH_AUX, - .load_mask = CM_PLLH_LOADAUX, - .hold_mask = 0, -- .fixed_divider = 10), -+ .fixed_divider = 1), - [BCM2835_PLLH_PIX] = REGISTER_PLL_DIV( - .name = "pllh_pix", - .source_pll = "pllh", - -From a0e60768d469d045ae5a32bc3001c6aa30633048 Mon Sep 17 00:00:00 2001 +From 8aac032b8b5fe007500cb0d578d1f7d46fe916a1 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Thu, 1 Dec 2016 22:00:19 +0100 -Subject: [PATCH 148/195] clk: bcm: Support rate change propagation on bcm2835 +Subject: [PATCH 147/218] clk: bcm: Support rate change propagation on bcm2835 clocks Some peripheral clocks, like the VEC (Video EnCoder) clock need to be set @@ -128930,10 +128900,10 @@ index a99ccf9f056d3a3e7c482339e08483f3701ebc04..dafaa6b22724ab41dac1327cfa81de09 init.ops = &bcm2835_vpu_clock_clk_ops; } else { -From 148fe8b1be92f88936e222b90274d7b8244f20c5 Mon Sep 17 00:00:00 2001 +From 138df49cf6713d64c46ca979a33a96d822658f04 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Thu, 1 Dec 2016 22:00:20 +0100 -Subject: [PATCH 149/195] clk: bcm: Allow rate change propagation to PLLH_AUX +Subject: [PATCH 148/218] clk: bcm: Allow rate change propagation to PLLH_AUX on VEC clock The VEC clock requires needs to be set at exactly 108MHz. Allow rate @@ -128968,10 +128938,10 @@ index dafaa6b22724ab41dac1327cfa81de09908a4dfd..0453d7c6a63923370e4191db2c4d083b /* dsi clocks */ [BCM2835_CLOCK_DSI0E] = REGISTER_PER_CLK( -From a84418aae025fc009e72bc20add783d6a5ba7ead Mon Sep 17 00:00:00 2001 +From cc1c5da4b0a00421bf287b06054eedf882258441 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Mon, 12 Dec 2016 09:00:53 +0100 -Subject: [PATCH 150/195] clk: bcm: Fix 'maybe-uninitialized' warning in +Subject: [PATCH 149/218] clk: bcm: Fix 'maybe-uninitialized' warning in bcm2835_clock_choose_div_and_prate() best_rate is reported as potentially uninitialized by gcc. @@ -129000,10 +128970,10 @@ index 0453d7c6a63923370e4191db2c4d083b893b3b47..9d895726ebb24bc78a2014870dbdd7c7 struct clk_hw *parent; -From 9f1f17f2e9b2c6c6b568dc663eff127b6a8d1718 Mon Sep 17 00:00:00 2001 +From 4f0cdf8310486a36db36bffe964122c2875790ff Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 18 Jan 2017 07:31:55 +1100 -Subject: [PATCH 151/195] clk: bcm2835: Don't rate change PLLs on behalf of DSI +Subject: [PATCH 150/218] clk: bcm2835: Don't rate change PLLs on behalf of DSI PLL dividers. Our core PLLs are intended to be configured once and left alone. With @@ -129175,10 +129145,10 @@ index 9d895726ebb24bc78a2014870dbdd7c779cd1cdf..b58cff2756581ba7e0be8a818cdbdf72 /* the clocks */ -From b68b2350e3e14e8963f44866a85f6e2d9ce0d422 Mon Sep 17 00:00:00 2001 +From d50780c95869187d0f04ef1b65cb2696daaad878 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 18 Jan 2017 07:31:56 +1100 -Subject: [PATCH 152/195] clk: bcm2835: Register the DSI0/DSI1 pixel clocks. +Subject: [PATCH 151/218] clk: bcm2835: Register the DSI0/DSI1 pixel clocks. The DSI pixel clocks are muxed from clocks generated in the analog phy by the DSI driver. In order to set them as parents, we need to do the @@ -129420,10 +129390,10 @@ index 360e00cefd35679b49890234b5c369fb52b89e20..a0c812b0fa391d149b4f546db39bdc4b +#define BCM2835_CLOCK_DSI0P 49 +#define BCM2835_CLOCK_DSI1P 50 -From 2b912be3c58959d40624f3bee571126e6b268f46 Mon Sep 17 00:00:00 2001 +From 4dbb3ef89cc4595f1c4a9f3939bb70b81bdb0571 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 18 Jan 2017 07:31:57 +1100 -Subject: [PATCH 153/195] clk: bcm2835: Add leaf clock measurement support, +Subject: [PATCH 152/218] clk: bcm2835: Add leaf clock measurement support, disabled by default This proved incredibly useful during debugging of the DSI driver, to @@ -129769,10 +129739,10 @@ index b2c277b378ee799a4f8e05ad076d1253e85cb392..136e5d28f9eaeaa10d45382a0f31da9f /* the gates */ -From 9b5c73bc0b05620d7a1c8536a1350ecdc020b23b Mon Sep 17 00:00:00 2001 +From 0a450af8446c6d0ae16a1c0f1669afbd780c6080 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 26 Apr 2016 13:46:13 -0700 -Subject: [PATCH 154/195] drm/panel: Add support for the Raspberry Pi 7" +Subject: [PATCH 153/218] drm/panel: Add support for the Raspberry Pi 7" Touchscreen. This driver communicates with the Atmel microcontroller for sequencing @@ -130353,10 +130323,10 @@ index 0000000000000000000000000000000000000000..1a536fe4d040f5fafe324baee110a622 +MODULE_DESCRIPTION("Raspberry Pi 7-inch touchscreen driver"); +MODULE_LICENSE("GPL v2"); -From 86221ad5d2b62257d847f3b1be58612f0e56612d Mon Sep 17 00:00:00 2001 +From 68ad470a6a0fa45c2fe9813c6ccf7d1ff8c54621 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 2 Jun 2016 12:29:45 -0700 -Subject: [PATCH 155/195] BCM270X: Add the DSI panel to the defconfig. +Subject: [PATCH 154/218] BCM270X: Add the DSI panel to the defconfig. Signed-off-by: Eric Anholt --- @@ -130405,10 +130375,10 @@ index 8c4392344eb4495689c220d5d176ee8c189079fd..301611d2283f5f8800339271cea59aed CONFIG_DRM_VC4=m CONFIG_FB=y -From 9814e81fe220bb35761c6b48600e17bad7273eb9 Mon Sep 17 00:00:00 2001 +From 8c49f029d59d7425bc4c39ad217ef77210942119 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 13 Dec 2016 15:15:10 -0800 -Subject: [PATCH 156/195] ARM: bcm2835: dt: Add the DSI module nodes and +Subject: [PATCH 155/218] ARM: bcm2835: dt: Add the DSI module nodes and clocks. The modules stay disabled by default, and if you want to enable DSI @@ -130512,10 +130482,10 @@ index 51cdefbf5eb265f49bd05e0aa91dfbeee3fbfdcc..41776b97b4b6b1c053d07fd357fac4ba compatible = "brcm,bcm2835-i2c"; reg = <0x7e804000 0x1000>; -From 3c42b1205a9242f8eb95a9c5516952bcb4e37282 Mon Sep 17 00:00:00 2001 +From 5fef33687c275637fcfb98547ce79aa9af7271f2 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 2 Jun 2016 15:09:35 -0700 -Subject: [PATCH 157/195] BCM270X: Enable the DSI panel node in the VC4 +Subject: [PATCH 156/218] BCM270X: Enable the DSI panel node in the VC4 overlay. Signed-off-by: Eric Anholt @@ -130666,81 +130636,10 @@ index 4f1cc20f90dc6780f74e08ebee00e5a1a6062c85..f25cd9a3936861920b0d518ff2d773ee cma-256 = <0>,"+0-1-2-3-4"; cma-192 = <0>,"-0+1-2-3-4"; -From ce35752cbd46113a1eb785ed3b48020b141d90ff Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Thu, 20 Oct 2016 16:48:12 -0700 -Subject: [PATCH 158/195] drm/vc4: Fix termination of the initial scan for - branch targets. - -The loop is scanning until the original max_ip (size of the BO), but -we want to not examine any code after the PROG_END's delay slots. -There was a block trying to do that, except that we had some early -continue statements if the signal wasn't a PROG_END or a BRANCH. - -The failure mode would be that a valid shader is rejected because some -undefined memory after the PROG_END slots is parsed as a branch and -the rest of its setup is illegal. I haven't seen this in the wild, -but valgrind was complaining when about this up in the userland -simulator mode. - -Signed-off-by: Eric Anholt -(cherry picked from commit 457e67a728696c4f8e6423c64e93def50530db9a) ---- - drivers/gpu/drm/vc4/vc4_validate_shaders.c | 19 ++++++++----------- - 1 file changed, 8 insertions(+), 11 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_validate_shaders.c b/drivers/gpu/drm/vc4/vc4_validate_shaders.c -index 2543cf5b8b51869d51b72a5db5017dded38761be..917321ce832ffda9d3e8ca20d987437eea9a1765 100644 ---- a/drivers/gpu/drm/vc4/vc4_validate_shaders.c -+++ b/drivers/gpu/drm/vc4/vc4_validate_shaders.c -@@ -608,9 +608,7 @@ static bool - vc4_validate_branches(struct vc4_shader_validation_state *validation_state) - { - uint32_t max_branch_target = 0; -- bool found_shader_end = false; - int ip; -- int shader_end_ip = 0; - int last_branch = -2; - - for (ip = 0; ip < validation_state->max_ip; ip++) { -@@ -621,8 +619,13 @@ vc4_validate_branches(struct vc4_shader_validation_state *validation_state) - uint32_t branch_target_ip; - - if (sig == QPU_SIG_PROG_END) { -- shader_end_ip = ip; -- found_shader_end = true; -+ /* There are two delay slots after program end is -+ * signaled that are still executed, then we're -+ * finished. validation_state->max_ip is the -+ * instruction after the last valid instruction in the -+ * program. -+ */ -+ validation_state->max_ip = ip + 3; - continue; - } - -@@ -676,15 +679,9 @@ vc4_validate_branches(struct vc4_shader_validation_state *validation_state) - } - set_bit(after_delay_ip, validation_state->branch_targets); - max_branch_target = max(max_branch_target, after_delay_ip); -- -- /* There are two delay slots after program end is signaled -- * that are still executed, then we're finished. -- */ -- if (found_shader_end && ip == shader_end_ip + 2) -- break; - } - -- if (max_branch_target > shader_end_ip) { -+ if (max_branch_target > validation_state->max_ip - 3) { - DRM_ERROR("Branch landed after QPU_SIG_PROG_END"); - return false; - } - -From c8e9761cf8c76c3a502a9757396b8df3faf62fa0 Mon Sep 17 00:00:00 2001 +From 71d626cb9216d9f47efe9c4750489cd49747c76f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 3 Nov 2016 18:53:10 -0700 -Subject: [PATCH 159/195] drm/vc4: Add support for rendering with ETC1 +Subject: [PATCH 157/218] drm/vc4: Add support for rendering with ETC1 textures. The validation for it ends up being quite simple, but I hadn't got @@ -130758,11 +130657,11 @@ Signed-off-by: Eric Anholt 3 files changed, 9 insertions(+) diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c -index 6c4a4fbc86d0a30a6977b2081bca4372e693b817..157e08ab27771854ffbad101f61ce81e27001e1a 100644 +index e0b4c4d475ad72682e2119fc2983afb91ac6fb02..8302bd788be470fd61a7382b8c3ef16e26f6861d 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c -@@ -78,6 +78,7 @@ static int vc4_get_param_ioctl(struct drm_device *dev, void *data, - pm_runtime_put(&vc4->v3d->pdev->dev); +@@ -81,6 +81,7 @@ static int vc4_get_param_ioctl(struct drm_device *dev, void *data, + pm_runtime_put_autosuspend(&vc4->v3d->pdev->dev); break; case DRM_VC4_PARAM_SUPPORTS_BRANCHES: + case DRM_VC4_PARAM_SUPPORTS_ETC1: @@ -130800,95 +130699,10 @@ index ad7edc3edf7ca1d653a0bc025a5eda6692b74370..69caa21f0cb23c9439238f6239c0041b struct drm_vc4_get_param { __u32 param; -From b721f42b657eede423dacac026fdfe43fac28bf6 Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Fri, 4 Nov 2016 15:58:38 -0700 -Subject: [PATCH 160/195] drm/vc4: Use runtime autosuspend to avoid thrashing - V3D power state. - -The pm_runtime_put() we were using immediately released power on the -device, which meant that we were generally turning the device off and -on once per frame. In many profiles I've looked at, that added up to -about 1% of CPU time, but this could get worse in the case of frequent -rendering and readback (as may happen in X rendering). By keeping the -device on until we've been idle for a couple of frames, we drop the -overhead of runtime PM down to sub-.1%. - -Signed-off-by: Eric Anholt -(cherry picked from commit 3a62234680d86efa0239665ed8a0e908f1aef147) ---- - drivers/gpu/drm/vc4/vc4_drv.c | 9 ++++++--- - drivers/gpu/drm/vc4/vc4_gem.c | 6 ++++-- - drivers/gpu/drm/vc4/vc4_v3d.c | 2 ++ - 3 files changed, 12 insertions(+), 5 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c -index 157e08ab27771854ffbad101f61ce81e27001e1a..8302bd788be470fd61a7382b8c3ef16e26f6861d 100644 ---- a/drivers/gpu/drm/vc4/vc4_drv.c -+++ b/drivers/gpu/drm/vc4/vc4_drv.c -@@ -61,21 +61,24 @@ static int vc4_get_param_ioctl(struct drm_device *dev, void *data, - if (ret < 0) - return ret; - args->value = V3D_READ(V3D_IDENT0); -- pm_runtime_put(&vc4->v3d->pdev->dev); -+ pm_runtime_mark_last_busy(&vc4->v3d->pdev->dev); -+ pm_runtime_put_autosuspend(&vc4->v3d->pdev->dev); - break; - case DRM_VC4_PARAM_V3D_IDENT1: - ret = pm_runtime_get_sync(&vc4->v3d->pdev->dev); - if (ret < 0) - return ret; - args->value = V3D_READ(V3D_IDENT1); -- pm_runtime_put(&vc4->v3d->pdev->dev); -+ pm_runtime_mark_last_busy(&vc4->v3d->pdev->dev); -+ pm_runtime_put_autosuspend(&vc4->v3d->pdev->dev); - break; - case DRM_VC4_PARAM_V3D_IDENT2: - ret = pm_runtime_get_sync(&vc4->v3d->pdev->dev); - if (ret < 0) - return ret; - args->value = V3D_READ(V3D_IDENT2); -- pm_runtime_put(&vc4->v3d->pdev->dev); -+ pm_runtime_mark_last_busy(&vc4->v3d->pdev->dev); -+ pm_runtime_put_autosuspend(&vc4->v3d->pdev->dev); - break; - case DRM_VC4_PARAM_SUPPORTS_BRANCHES: - case DRM_VC4_PARAM_SUPPORTS_ETC1: -diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c -index 18e37171e9c8e2f0729ca1c582af98ccb4647e06..ab3016982466c3ca35ba479050ee107d26eb50ac 100644 ---- a/drivers/gpu/drm/vc4/vc4_gem.c -+++ b/drivers/gpu/drm/vc4/vc4_gem.c -@@ -711,8 +711,10 @@ vc4_complete_exec(struct drm_device *dev, struct vc4_exec_info *exec) - } - - mutex_lock(&vc4->power_lock); -- if (--vc4->power_refcount == 0) -- pm_runtime_put(&vc4->v3d->pdev->dev); -+ if (--vc4->power_refcount == 0) { -+ pm_runtime_mark_last_busy(&vc4->v3d->pdev->dev); -+ pm_runtime_put_autosuspend(&vc4->v3d->pdev->dev); -+ } - mutex_unlock(&vc4->power_lock); - - kfree(exec); -diff --git a/drivers/gpu/drm/vc4/vc4_v3d.c b/drivers/gpu/drm/vc4/vc4_v3d.c -index e6d3c6028341e447df293cab525713ac10d8ee5e..7cc346ad9b0baed63701d1fae8f0306aa7713129 100644 ---- a/drivers/gpu/drm/vc4/vc4_v3d.c -+++ b/drivers/gpu/drm/vc4/vc4_v3d.c -@@ -222,6 +222,8 @@ static int vc4_v3d_bind(struct device *dev, struct device *master, void *data) - return ret; - } - -+ pm_runtime_use_autosuspend(dev); -+ pm_runtime_set_autosuspend_delay(dev, 40); /* a little over 2 frames. */ - pm_runtime_enable(dev); - - return 0; - -From 3783d21d38812216cb53aecfd309e84a5ab57ec5 Mon Sep 17 00:00:00 2001 +From f4cc4a7f8d6c05d8f98c3ce5a9cde9919e2a2d6f Mon Sep 17 00:00:00 2001 From: Jonas Pfeil Date: Tue, 8 Nov 2016 00:18:39 +0100 -Subject: [PATCH 161/195] drm/vc4: Add fragment shader threading support +Subject: [PATCH 158/218] drm/vc4: Add fragment shader threading support FS threading brings performance improvements of 0-20% in glmark2. @@ -130927,10 +130741,10 @@ index 8302bd788be470fd61a7382b8c3ef16e26f6861d..3abaa0f85da194016c65f46509d4c64f break; default: diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h -index e1f6ab747f36dd412e00a1e7ea772f13c2fc32d5..e15eb37ca6191e0eae3d4947751437d2646c996d 100644 +index b9169550bf15504f1ff3d8b31a3710e9b4c42e88..6d0688056aa2c75cc6b5bf9a6c50cc62e1b398e2 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.h +++ b/drivers/gpu/drm/vc4/vc4_drv.h -@@ -384,6 +384,8 @@ struct vc4_validated_shader_info { +@@ -385,6 +385,8 @@ struct vc4_validated_shader_info { uint32_t num_uniform_addr_offsets; uint32_t *uniform_addr_offsets; @@ -131124,232 +130938,10 @@ index 69caa21f0cb23c9439238f6239c0041b178d5669..f07a090167261131076438960c1dec17 struct drm_vc4_get_param { __u32 param; -From d69d5d660a5fce80bfac187b24952247355bc46e Mon Sep 17 00:00:00 2001 -From: Derek Foreman -Date: Thu, 24 Nov 2016 12:11:55 -0600 -Subject: [PATCH 162/195] drm/vc4: Fix race between page flip completion event - and clean-up - -There was a small window where a userspace program could submit -a pageflip after receiving a pageflip completion event yet still -receive EBUSY. - -Signed-off-by: Derek Foreman -Signed-off-by: Eric Anholt -Reviewed-by: Eric Anholt -Reviewed-by: Daniel Stone -(cherry picked from commit 26fc78f6fef39b9d7a15def5e7e9826ff68303f4) ---- - drivers/gpu/drm/vc4/vc4_crtc.c | 8 ++++++++ - drivers/gpu/drm/vc4/vc4_drv.h | 1 + - drivers/gpu/drm/vc4/vc4_kms.c | 33 +++++++++++++++++++++++++-------- - 3 files changed, 34 insertions(+), 8 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c -index 13212788eef0e4b77c1e92e6bf3a56c817c50322..61d64c9c4b0cd1aafc6451b0838cb203c1374a5a 100644 ---- a/drivers/gpu/drm/vc4/vc4_crtc.c -+++ b/drivers/gpu/drm/vc4/vc4_crtc.c -@@ -682,6 +682,14 @@ void vc4_disable_vblank(struct drm_device *dev, unsigned int crtc_id) - CRTC_WRITE(PV_INTEN, 0); - } - -+/* Must be called with the event lock held */ -+bool vc4_event_pending(struct drm_crtc *crtc) -+{ -+ struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); -+ -+ return !!vc4_crtc->event; -+} -+ - static void vc4_crtc_handle_page_flip(struct vc4_crtc *vc4_crtc) - { - struct drm_crtc *crtc = &vc4_crtc->base; -diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h -index e15eb37ca6191e0eae3d4947751437d2646c996d..47fa2987909642b244615ff6c642adb278bcd784 100644 ---- a/drivers/gpu/drm/vc4/vc4_drv.h -+++ b/drivers/gpu/drm/vc4/vc4_drv.h -@@ -445,6 +445,7 @@ int vc4_bo_stats_debugfs(struct seq_file *m, void *arg); - extern struct platform_driver vc4_crtc_driver; - int vc4_enable_vblank(struct drm_device *dev, unsigned int crtc_id); - void vc4_disable_vblank(struct drm_device *dev, unsigned int crtc_id); -+bool vc4_event_pending(struct drm_crtc *crtc); - int vc4_crtc_debugfs_regs(struct seq_file *m, void *arg); - int vc4_crtc_get_scanoutpos(struct drm_device *dev, unsigned int crtc_id, - unsigned int flags, int *vpos, int *hpos, -diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c -index c1f65c6c8e601e9331768ca040a5609cad686b2e..67af2af70af091bf4b13ac03eb1078f867bc6cea 100644 ---- a/drivers/gpu/drm/vc4/vc4_kms.c -+++ b/drivers/gpu/drm/vc4/vc4_kms.c -@@ -119,17 +119,34 @@ static int vc4_atomic_commit(struct drm_device *dev, - - /* Make sure that any outstanding modesets have finished. */ - if (nonblock) { -- ret = down_trylock(&vc4->async_modeset); -- if (ret) { -+ struct drm_crtc *crtc; -+ struct drm_crtc_state *crtc_state; -+ unsigned long flags; -+ bool busy = false; -+ -+ /* -+ * If there's an undispatched event to send then we're -+ * obviously still busy. If there isn't, then we can -+ * unconditionally wait for the semaphore because it -+ * shouldn't be contended (for long). -+ * -+ * This is to prevent a race where queuing a new flip -+ * from userspace immediately on receipt of an event -+ * beats our clean-up and returns EBUSY. -+ */ -+ spin_lock_irqsave(&dev->event_lock, flags); -+ for_each_crtc_in_state(state, crtc, crtc_state, i) -+ busy |= vc4_event_pending(crtc); -+ spin_unlock_irqrestore(&dev->event_lock, flags); -+ if (busy) { - kfree(c); - return -EBUSY; - } -- } else { -- ret = down_interruptible(&vc4->async_modeset); -- if (ret) { -- kfree(c); -- return ret; -- } -+ } -+ ret = down_interruptible(&vc4->async_modeset); -+ if (ret) { -+ kfree(c); -+ return ret; - } - - ret = drm_atomic_helper_prepare_planes(dev, state); - -From 6da3042305d4f2def52ea196c3fe93da6700acce Mon Sep 17 00:00:00 2001 -From: Boris Brezillon -Date: Fri, 2 Dec 2016 14:48:07 +0100 -Subject: [PATCH 163/195] drm/vc4: Fix ->clock_select setting for the VEC - encoder - -PV_CONTROL_CLK_SELECT_VEC is actually 2 and not 0. Fix the definition and -rework the vc4_set_crtc_possible_masks() to cover the full range of the -PV_CONTROL_CLK_SELECT field. - -Signed-off-by: Boris Brezillon -Signed-off-by: Eric Anholt -(cherry picked from commit ab8df60e3a3b68420d0d4477c5f07c00fbfb078b) ---- - drivers/gpu/drm/vc4/vc4_crtc.c | 38 +++++++++++++++++++++++--------------- - drivers/gpu/drm/vc4/vc4_drv.h | 1 + - drivers/gpu/drm/vc4/vc4_regs.h | 3 ++- - 3 files changed, 26 insertions(+), 16 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c -index 61d64c9c4b0cd1aafc6451b0838cb203c1374a5a..bdf32c572fc2c46932daca934dfb002d05493883 100644 ---- a/drivers/gpu/drm/vc4/vc4_crtc.c -+++ b/drivers/gpu/drm/vc4/vc4_crtc.c -@@ -83,8 +83,7 @@ struct vc4_crtc_data { - /* Which channel of the HVS this pixelvalve sources from. */ - int hvs_channel; - -- enum vc4_encoder_type encoder0_type; -- enum vc4_encoder_type encoder1_type; -+ enum vc4_encoder_type encoder_types[4]; - }; - - #define CRTC_WRITE(offset, val) writel(val, vc4_crtc->regs + (offset)) -@@ -880,20 +879,26 @@ static const struct drm_crtc_helper_funcs vc4_crtc_helper_funcs = { - - static const struct vc4_crtc_data pv0_data = { - .hvs_channel = 0, -- .encoder0_type = VC4_ENCODER_TYPE_DSI0, -- .encoder1_type = VC4_ENCODER_TYPE_DPI, -+ .encoder_types = { -+ [PV_CONTROL_CLK_SELECT_DSI] = VC4_ENCODER_TYPE_DSI0, -+ [PV_CONTROL_CLK_SELECT_DPI_SMI_HDMI] = VC4_ENCODER_TYPE_DPI, -+ }, - }; - - static const struct vc4_crtc_data pv1_data = { - .hvs_channel = 2, -- .encoder0_type = VC4_ENCODER_TYPE_DSI1, -- .encoder1_type = VC4_ENCODER_TYPE_SMI, -+ .encoder_types = { -+ [PV_CONTROL_CLK_SELECT_DSI] = VC4_ENCODER_TYPE_DSI1, -+ [PV_CONTROL_CLK_SELECT_DPI_SMI_HDMI] = VC4_ENCODER_TYPE_SMI, -+ }, - }; - - static const struct vc4_crtc_data pv2_data = { - .hvs_channel = 1, -- .encoder0_type = VC4_ENCODER_TYPE_VEC, -- .encoder1_type = VC4_ENCODER_TYPE_HDMI, -+ .encoder_types = { -+ [PV_CONTROL_CLK_SELECT_DPI_SMI_HDMI] = VC4_ENCODER_TYPE_HDMI, -+ [PV_CONTROL_CLK_SELECT_VEC] = VC4_ENCODER_TYPE_VEC, -+ }, - }; - - static const struct of_device_id vc4_crtc_dt_match[] = { -@@ -907,17 +912,20 @@ static void vc4_set_crtc_possible_masks(struct drm_device *drm, - struct drm_crtc *crtc) - { - struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); -+ const struct vc4_crtc_data *crtc_data = vc4_crtc->data; -+ const enum vc4_encoder_type *encoder_types = crtc_data->encoder_types; - struct drm_encoder *encoder; - - drm_for_each_encoder(encoder, drm) { - struct vc4_encoder *vc4_encoder = to_vc4_encoder(encoder); -- -- if (vc4_encoder->type == vc4_crtc->data->encoder0_type) { -- vc4_encoder->clock_select = 0; -- encoder->possible_crtcs |= drm_crtc_mask(crtc); -- } else if (vc4_encoder->type == vc4_crtc->data->encoder1_type) { -- vc4_encoder->clock_select = 1; -- encoder->possible_crtcs |= drm_crtc_mask(crtc); -+ int i; -+ -+ for (i = 0; i < ARRAY_SIZE(crtc_data->encoder_types); i++) { -+ if (vc4_encoder->type == encoder_types[i]) { -+ vc4_encoder->clock_select = i; -+ encoder->possible_crtcs |= drm_crtc_mask(crtc); -+ break; -+ } - } - } - } -diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h -index 47fa2987909642b244615ff6c642adb278bcd784..6d0688056aa2c75cc6b5bf9a6c50cc62e1b398e2 100644 ---- a/drivers/gpu/drm/vc4/vc4_drv.h -+++ b/drivers/gpu/drm/vc4/vc4_drv.h -@@ -197,6 +197,7 @@ to_vc4_plane(struct drm_plane *plane) - } - - enum vc4_encoder_type { -+ VC4_ENCODER_TYPE_NONE, - VC4_ENCODER_TYPE_HDMI, - VC4_ENCODER_TYPE_VEC, - VC4_ENCODER_TYPE_DSI0, -diff --git a/drivers/gpu/drm/vc4/vc4_regs.h b/drivers/gpu/drm/vc4/vc4_regs.h -index 1aa44c2db5565ba126d2ceb65495a6c98c555860..39f6886b24100c43b590e47e0c7bc44846721d65 100644 ---- a/drivers/gpu/drm/vc4/vc4_regs.h -+++ b/drivers/gpu/drm/vc4/vc4_regs.h -@@ -177,8 +177,9 @@ - # define PV_CONTROL_WAIT_HSTART BIT(12) - # define PV_CONTROL_PIXEL_REP_MASK VC4_MASK(5, 4) - # define PV_CONTROL_PIXEL_REP_SHIFT 4 --# define PV_CONTROL_CLK_SELECT_DSI_VEC 0 -+# define PV_CONTROL_CLK_SELECT_DSI 0 - # define PV_CONTROL_CLK_SELECT_DPI_SMI_HDMI 1 -+# define PV_CONTROL_CLK_SELECT_VEC 2 - # define PV_CONTROL_CLK_SELECT_MASK VC4_MASK(3, 2) - # define PV_CONTROL_CLK_SELECT_SHIFT 2 - # define PV_CONTROL_FIFO_CLR BIT(1) - -From 98102d34c119b933dee35696e22cfbf3cb33936f Mon Sep 17 00:00:00 2001 +From 94beea77934da0bfa6601c18370b8018adc30cb2 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Fri, 2 Dec 2016 14:48:09 +0100 -Subject: [PATCH 164/195] drm: Add TV connector states to drm_connector_state +Subject: [PATCH 159/218] drm: Add TV connector states to drm_connector_state Some generic TV connector properties are exposed in drm_mode_config, but they are currently handled independently in each DRM encoder driver. @@ -131499,10 +131091,10 @@ index ac9d7d8e0e43a807e9fc9a0b66de5f26b49d3348..2645e803857253ff98eb94aa1bacc825 /** -From 2b3bdd6f81c507b021b3ed7585ba222f6faeb767 Mon Sep 17 00:00:00 2001 +From 6ec14651c0f7ba3b19e8a25a8c7f8c9b2352967e Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Fri, 2 Dec 2016 14:48:08 +0100 -Subject: [PATCH 165/195] drm: Turn DRM_MODE_SUBCONNECTOR_xx definitions into +Subject: [PATCH 160/218] drm: Turn DRM_MODE_SUBCONNECTOR_xx definitions into an enum List of values like the DRM_MODE_SUBCONNECTOR_xx ones are better @@ -131549,10 +131141,10 @@ index df0e3504c349a950bf41540fbcd6cd944cf11d2f..970bfc0d7107451e5bc4e29c524a764c #define DRM_MODE_CONNECTOR_Unknown 0 #define DRM_MODE_CONNECTOR_VGA 1 -From 03bc5629b29ba16d297f296ab44e6b77d4571d8c Mon Sep 17 00:00:00 2001 +From 362d9990d12718179a0efa23e6fe71f88200de17 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Fri, 2 Dec 2016 14:48:10 +0100 -Subject: [PATCH 166/195] drm/vc4: Add support for the VEC (Video Encoder) IP +Subject: [PATCH 161/218] drm/vc4: Add support for the VEC (Video Encoder) IP The VEC IP is a TV DAC, providing support for PAL and NTSC standards. @@ -132291,10 +131883,10 @@ index 0000000000000000000000000000000000000000..32bb8ef985fbc6f39f9e5f459846bb77 + }, +}; -From 435f3dcae47307842558d06e26d8295122e21b20 Mon Sep 17 00:00:00 2001 +From ffa23fa3e1787d148bb891a660f2fb8187483c99 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 15 Sep 2016 15:25:23 +0100 -Subject: [PATCH 167/195] drm/vc4: Set up SCALER_DISPCTRL at boot. +Subject: [PATCH 162/218] drm/vc4: Set up SCALER_DISPCTRL at boot. We want the HVS on, obviously, and we also want DSP3 (PV1's source) to be muxed from HVS channel 2 like we expect in vc4_crtc.c. The @@ -132354,10 +131946,10 @@ index 39f6886b24100c43b590e47e0c7bc44846721d65..b3b297fba7097bc495fa8916292c5479 * SCALER_DISPSTAT_IRQDISP0. Note that short frame contributions are * always enabled. -From 4915837b5ce9737be412e1071862006cb66b996c Mon Sep 17 00:00:00 2001 +From da0e334fe3c7e1ae350b1507669f247544f98beb Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 10 Feb 2016 16:17:29 -0800 -Subject: [PATCH 168/195] drm/vc4: Add support for feeding DSI encoders from +Subject: [PATCH 163/218] drm/vc4: Add support for feeding DSI encoders from the pixel valve. We have to set a different pixel format, which tells the hardware to @@ -132472,10 +132064,10 @@ index b3b297fba7097bc495fa8916292c547925720199..385405a2df05eb3dd86d4f687aa82053 # define PV_VCONTROL_VIDEN BIT(0) -From 05d2a7c2ea96d89ec7515b245d34887b63bcee3f Mon Sep 17 00:00:00 2001 +From 5093a9fdd8ee3ff152c9eaa1845cb03c2b5668c5 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 10 Feb 2016 11:42:32 -0800 -Subject: [PATCH 169/195] drm/vc4: Add DSI driver +Subject: [PATCH 164/218] drm/vc4: Add DSI driver The DSI0 and DSI1 blocks on the 2835 are related hardware blocks. Some registers move around, and the featureset is slightly different, @@ -134303,10 +133895,10 @@ index 0000000000000000000000000000000000000000..17fcac381dbb37cd9a5ff210ad8578f4 + }, +}; -From a86e36c3c6dc4ad21645482070fcebed639b960b Mon Sep 17 00:00:00 2001 +From 23eadb6954ad34997665d5a5ab1a93eb6fecc855 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Fri, 2 Dec 2016 14:48:12 +0100 -Subject: [PATCH 170/195] ARM: dts: bcm283x: Add VEC node in bcm283x.dtsi +Subject: [PATCH 165/218] ARM: dts: bcm283x: Add VEC node in bcm283x.dtsi Add the VEC (Video EnCoder) node definition in bcm283x.dtsi. @@ -134337,10 +133929,10 @@ index 41776b97b4b6b1c053d07fd357fac4ba4787ac53..d3cc586661f903e67a840189c0446aa8 compatible = "brcm,bcm2835-pixelvalve2"; reg = <0x7e807000 0x100>; -From aec2720328f43c781f4dbf539049e8461d53dca6 Mon Sep 17 00:00:00 2001 +From 0db6696cdaf3a83d0a6f586b5935afe671279ead Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Fri, 2 Dec 2016 14:48:13 +0100 -Subject: [PATCH 171/195] ARM: dts: bcm283x: Enable the VEC IP on all +Subject: [PATCH 166/218] ARM: dts: bcm283x: Enable the VEC IP on all RaspberryPi boards Enable the VEC IP on all RaspberryPi boards. @@ -134366,10 +133958,10 @@ index 365648898f3acc4f82dc6cb58e4bbebbe249be94..d4577a51e678cb600b475d3d3395ca4e + status = "okay"; +}; -From 05189a9cd8f5e929e9467936fe90d6616c5cb9ee Mon Sep 17 00:00:00 2001 +From 646b6754fd1f61dc821a917208acd3cc01daa4e6 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 23 Jan 2017 11:41:54 -0800 -Subject: [PATCH 172/195] BCM270X: Disable VEC unless vc4-kms-v3d is present. +Subject: [PATCH 167/218] BCM270X: Disable VEC unless vc4-kms-v3d is present. Signed-off-by: Eric Anholt --- @@ -134408,10 +134000,10 @@ index f25cd9a3936861920b0d518ff2d773ee467e2f49..a8ef8c9051668a7477dea30aa262568c cma-256 = <0>,"+0-1-2-3-4"; cma-192 = <0>,"-0+1-2-3-4"; -From 28fc24072721e7ed48889ff06f436074d9305c2e Mon Sep 17 00:00:00 2001 +From 26a18c73446816f7ded718368f97f7174ff25a9d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 1 Feb 2017 17:09:18 -0800 -Subject: [PATCH 173/195] drm/vc4: Name the primary and cursor planes in fkms. +Subject: [PATCH 168/218] drm/vc4: Name the primary and cursor planes in fkms. This makes debugging nicer, compared to trying to remember what the IDs are. @@ -134435,10 +134027,10 @@ index d18a1dae51a2275846c9826b5bf1ba57ae97b55c..e49ce68b607a7ffc2329e3235362f3bc if (type == DRM_PLANE_TYPE_PRIMARY) { vc4_plane->fbinfo = -From aabe0c5eb75ec20103dcd7d6df513c892f0b05f6 Mon Sep 17 00:00:00 2001 +From bf9baeecc9af7013b87a0137d3e7dc010f562412 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 1 Feb 2017 17:10:09 -0800 -Subject: [PATCH 174/195] drm/vc4: Add DRM_DEBUG_ATOMIC for the insides of +Subject: [PATCH 169/218] drm/vc4: Add DRM_DEBUG_ATOMIC for the insides of fkms. Trying to debug weston on fkms involved figuring out what calls I was @@ -134508,10 +134100,10 @@ index e49ce68b607a7ffc2329e3235362f3bc21ed5cbb..dbf065677202fbebf8e3a0cffbe880aa RPI_FIRMWARE_SET_CURSOR_STATE, &packet_state, -From 5481ee135033439ce05568844ab35d48f819d294 Mon Sep 17 00:00:00 2001 +From 4294b2aabc48eab45858da32e694cc556a2fea1f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 2 Feb 2017 09:42:18 -0800 -Subject: [PATCH 175/195] drm/vc4: Fix sending of page flip completion events +Subject: [PATCH 170/218] drm/vc4: Fix sending of page flip completion events in FKMS mode. In the rewrite of vc4_crtc.c for fkms, I dropped the part of the @@ -134553,10 +134145,10 @@ index dbf065677202fbebf8e3a0cffbe880aa42daef3f..da818a207bfa639b8cea48d94bcf4566 static void vc4_crtc_handle_page_flip(struct vc4_crtc *vc4_crtc) -From d81d5972aa6a81c3f5a6b7023b52a1d95faaea30 Mon Sep 17 00:00:00 2001 +From d1796f515b6a16a89eebc8268fc83fcab1bbf357 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 8 Feb 2017 15:00:54 -0800 -Subject: [PATCH 176/195] drm/vc4: Fulfill user BO creation requests from the +Subject: [PATCH 171/218] drm/vc4: Fulfill user BO creation requests from the kernel BO cache. The from_cache flag was actually "the BO is invisible to userspace", @@ -134609,10 +134201,10 @@ index 3f6704cf6608d7be47637c6aa585de087b7f74ee..5ec14f25625dde6fd61e10415092fa25 cma_obj = drm_gem_cma_create(dev, size); -From 47986e99a73f3ecd19b1513787c8ca3e412d4dfa Mon Sep 17 00:00:00 2001 +From ada9aaf19d32c109ec9189b5d2a6a399b828bdde Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 9 Feb 2017 09:23:34 -0800 -Subject: [PATCH 177/195] drm/vc4: Fix OOPSes from trying to cache a partially +Subject: [PATCH 172/218] drm/vc4: Fix OOPSes from trying to cache a partially constructed BO. If a CMA allocation failed, the partially constructed BO would be @@ -134646,10 +134238,10 @@ index 5ec14f25625dde6fd61e10415092fa25527cc151..fd83a28076564b9ea5cf0f2ba29b884e if (!cache_list) { vc4_bo_destroy(bo); -From 2314ac77fd01030c3e7f2b6a4239ce4abf9ab67f Mon Sep 17 00:00:00 2001 +From 81f86f488ee8641576f235bca9db229d15ad3643 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 12 Oct 2015 08:58:08 -0700 -Subject: [PATCH 178/195] drm/vc4: Verify at boot that CMA doesn't cross a +Subject: [PATCH 173/218] drm/vc4: Verify at boot that CMA doesn't cross a 256MB boundary. I've seen lots of users cranking CMA up higher, so throw an error if @@ -134732,10 +134324,10 @@ index c960459eda7e640ea55be1d4ed80c6a9125a8877..b50245282a18bc790da0f901944c2e67 static unsigned long cma_bitmap_aligned_mask(const struct cma *cma, int align_order) -From 0c1283c0888883799af200fa010764c5c8b8727d Mon Sep 17 00:00:00 2001 +From fed165663396b4062279ea05dcf9337332148bb7 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 17 Feb 2017 09:47:11 +0000 -Subject: [PATCH 179/195] BCM270X_DT: Add SMSC ethernet controller to DT +Subject: [PATCH 174/218] BCM270X_DT: Add SMSC ethernet controller to DT With an ethernet node in the DT, a suitable firmware can populate the local-mac-address property, removing the need for a downstream patch @@ -134798,10 +134390,10 @@ index d29ba72de727fe26b5a586e0bd0a41181c68ae04..78101849441679baf3624cf67a0ff7a2 / { model = "Raspberry Pi 3 Model B"; -From 6ee690b766306baaded14f6423e8312bafd00b95 Mon Sep 17 00:00:00 2001 +From 437862ae39c750054a658137eae12602862bfa58 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 17 Feb 2017 15:26:13 +0000 -Subject: [PATCH 180/195] brcmfmac: Mute expected startup 'errors' +Subject: [PATCH 175/218] brcmfmac: Mute expected startup 'errors' The brcmfmac WiFi driver always complains about the '00' country code and the firmware version is reported as an error. Modify the driver to @@ -134840,10 +134432,10 @@ index 4051780f64f44a5ce522babe6c371a1beb79a824..b081673abcb4aa72d70d8e0834b608f6 /* locate firmware version number for ethtool */ ptr = strrchr(buf, ' ') + 1; -From 07a3382430eed7494c4a1ade05461f4c03edf484 Mon Sep 17 00:00:00 2001 +From d71c77cec184e2af2e76b1695eb65bd2e4eacac3 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Feb 2017 17:20:08 +0000 -Subject: [PATCH 181/195] clk-bcm2835: Mark used PLLs and dividers CRITICAL +Subject: [PATCH 176/218] clk-bcm2835: Mark used PLLs and dividers CRITICAL The VPU configures and relies on several PLLs and dividers. Mark all enabled dividers and their PLLs as CRITICAL to prevent the kernel from @@ -134871,10 +134463,10 @@ index 136e5d28f9eaeaa10d45382a0f31da9f4adb91ef..4192863778c8009aacfc9a49ee38ad1c divider->data = data; -From 0316a7b83aa51325f6ce0a344df1c7ed4fe11174 Mon Sep 17 00:00:00 2001 +From 31fcaf0d440fa76fde996e425d4dc828685467a2 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Feb 2017 17:20:08 +0000 -Subject: [PATCH 182/195] clk-bcm2835: Add claim-clocks property +Subject: [PATCH 177/218] clk-bcm2835: Add claim-clocks property The claim-clocks property can be used to prevent PLLs and dividers from being marked as critical. It contains a vector of clock IDs, @@ -135009,10 +134601,10 @@ index 4192863778c8009aacfc9a49ee38ad1ca62a01e4..6b245357e4e93c19a839eee92a82f95a sizeof(cprman_parent_names)); of_clk_parent_fill(dev->of_node, cprman->real_parent_names, -From 60a6aec97b9c6117313e14d34bc5b3bd8e4a090b Mon Sep 17 00:00:00 2001 +From 256ed4e5d4b393a81392b3c02b3949a1558b2f54 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Mon, 20 Feb 2017 20:01:16 +0100 -Subject: [PATCH 183/195] dmaengine: bcm2835: Fix cyclic DMA period splitting +Subject: [PATCH 178/218] dmaengine: bcm2835: Fix cyclic DMA period splitting The code responsible for splitting periods into chunks that can be handled by the DMA controller missed to update total_len, @@ -135051,10 +134643,10 @@ index 80d35f760b4a4a51e60c355a84d538bac3892a4d..599c218dc8a73172dd4bd4a058fc8f95 /* calculate the length that remains to reach period_length */ control_block->length = period_len - *total_len; -From e4dbb0d219dd203607df119752cd962ffc3295b3 Mon Sep 17 00:00:00 2001 +From c22ba62ab46ea8c480ba1a289434a06c244a74a5 Mon Sep 17 00:00:00 2001 From: Scott Ellis Date: Thu, 23 Feb 2017 11:56:20 -0500 -Subject: [PATCH 184/195] Add ads1015 driver to config +Subject: [PATCH 179/218] Add ads1015 driver to config --- arch/arm/configs/bcm2709_defconfig | 3 ++- @@ -135108,10 +134700,10 @@ index 9a9cd1cdcb2f76d4408568681ec80885293bae48..554fed3a4fbfd1940422b808046c6d2b CONFIG_FB=y CONFIG_FB_BCM2708=y -From ea1570c63ba1cecaee28ccb906218ac35cf07a51 Mon Sep 17 00:00:00 2001 +From 701f346e4b72bfb0a14993e285156cbc694f6d2b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 27 Jan 2017 18:49:30 +0000 -Subject: [PATCH 185/195] config: add slcan kernel module +Subject: [PATCH 180/218] config: add slcan kernel module See: https://github.com/raspberrypi/linux/issues/1819 --- @@ -135144,10 +134736,10 @@ index 554fed3a4fbfd1940422b808046c6d2b1f508394..99888182259b280790a7506b248a8130 CONFIG_IRDA=m CONFIG_IRLAN=m -From d57767416218047cebc0d14ca7c106d9eb11c467 Mon Sep 17 00:00:00 2001 +From 9d46aee2a376c09c66527e7d9893ee6a91e40f6b Mon Sep 17 00:00:00 2001 From: Miquel Date: Fri, 24 Feb 2017 20:51:06 +0100 -Subject: [PATCH 186/195] sound: Support for Dion Audio LOCO-V2 DAC-AMP HAT +Subject: [PATCH 181/218] sound: Support for Dion Audio LOCO-V2 DAC-AMP HAT Signed-off-by: Miquel Blauw --- @@ -135411,10 +135003,10 @@ index 0000000000000000000000000000000000000000..a009c49477972a9832175d86f201b035 +MODULE_DESCRIPTION("ASoC Driver for DionAudio LOCO-V2"); +MODULE_LICENSE("GPL v2"); -From 220cffc498b4935cedd712667c61d566753ca2b5 Mon Sep 17 00:00:00 2001 +From 35ce1097bb1bbde15f3b66a4c5c2ba4c5279d909 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Sun, 26 Feb 2017 01:13:02 +0000 -Subject: [PATCH 187/195] SQUASH: Add LOCO-V2 overlay from last commit +Subject: [PATCH 182/218] SQUASH: Add LOCO-V2 overlay from last commit --- .../dts/overlays/dionaudio-loco-v2-overlay.dts | 49 ++++++++++++++++++++++ @@ -135477,10 +135069,10 @@ index 0000000000000000000000000000000000000000..a1af93de30119734e8d14cbd454589d3 + }; +}; -From 5521afdc20ba69bf5b9089e37125b5d41555f1e0 Mon Sep 17 00:00:00 2001 +From 75a2eae30f3a8de1ae9338f82bfdf60658f6f5ce Mon Sep 17 00:00:00 2001 From: Fe-Pi Date: Wed, 1 Mar 2017 04:42:43 -0700 -Subject: [PATCH 188/195] Add support for Fe-Pi audio sound card. (#1867) +Subject: [PATCH 183/218] Add support for Fe-Pi audio sound card. (#1867) Fe-Pi Audio Sound Card is based on NXP SGTL5000 codec. Mechanical specification of the board is the same the Raspberry Pi Zero. @@ -135829,10 +135421,10 @@ index 0000000000000000000000000000000000000000..015b56fd73cc36be5b5eecd17548fd03 +MODULE_DESCRIPTION("ASoC Driver for Fe-Pi Audio"); +MODULE_LICENSE("GPL v2"); -From 42f098f58abf9231da313bbdeb65f1f73a9c6393 Mon Sep 17 00:00:00 2001 +From 4dae1738ce8223ba7ec26816acc9ca9b75d8dd6b Mon Sep 17 00:00:00 2001 From: Scott Ellis Date: Wed, 1 Mar 2017 07:22:24 -0500 -Subject: [PATCH 189/195] Add overlay for ads1115 ADCs (#1864) +Subject: [PATCH 184/218] Add overlay for ads1115 ADCs (#1864) --- arch/arm/boot/dts/overlays/Makefile | 1 + @@ -135996,10 +135588,10 @@ index 0000000000000000000000000000000000000000..7c16a1af3172d14e1a976b1776b9f167 + }; +}; -From a9c6f2f8142e6667eb6b0187d014d8992f48d9b7 Mon Sep 17 00:00:00 2001 +From a9c3d0bc656e1f8125faef0f11415066d1ee3254 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 1 Mar 2017 16:06:53 +0000 -Subject: [PATCH 190/195] clk-bcm2835: Correct the prediv logic +Subject: [PATCH 185/218] clk-bcm2835: Correct the prediv logic If a clock has the prediv flag set, both the integer and fractional parts must be scaled when calculating the resulting frequency. @@ -136026,10 +135618,10 @@ index 6b245357e4e93c19a839eee92a82f95aec996e4e..8ea29fbc8dc451b9cff502bc1a918ae6 return bcm2835_pll_rate_from_divisors(parent_rate, ndiv, fdiv, pdiv); } -From 5a558d984d72ae8e37189ccd252e7c22fce36352 Mon Sep 17 00:00:00 2001 +From 51b3d8a66950691617045bba56fbea1be972f69a Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 1 Mar 2017 16:07:39 +0000 -Subject: [PATCH 191/195] amba_pl011: Round input clock up +Subject: [PATCH 186/218] amba_pl011: Round input clock up The UART clock is initialised to be as close to the requested frequency as possible without exceeding it. Now that there is a @@ -136115,10 +135707,10 @@ index 5a11ff833e1fd112ba04df3a427cd94bf6793ec5..003a5b0c30295dbbcb94a28d0c64d124 /* unregisters the driver also if no more ports are left */ static void pl011_unregister_port(struct uart_amba_port *uap) -From 859658183b0da8397fbed8b1aca10e1e1c545598 Mon Sep 17 00:00:00 2001 +From 8a45acd82cdc740f9e8251c9f1ce9b018ae5276e Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 13 Feb 2017 11:10:50 +0000 -Subject: [PATCH 192/195] BCM2835-V4L2: Ensure H264 header bytes get a sensible +Subject: [PATCH 187/218] BCM2835-V4L2: Ensure H264 header bytes get a sensible timestamp H264 header come off VC with 0 timestamps, which means they get a @@ -136207,10 +135799,10 @@ index e6aeb7e7e381de65d6c6586205069a4c5cd33274..7f8a68916a67001bc9241bce2928519a struct vchiq_mmal_port *port; /* port being used for capture */ /* camera port being used for capture */ -From 21b2f76504187e2a5fe2043de2db00a642163df1 Mon Sep 17 00:00:00 2001 +From 524fea578957cbe473b9614946db30e80ecc5730 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 13 Feb 2017 13:11:41 +0000 -Subject: [PATCH 193/195] BCM2835-V4L2: Correctly denote key frames in encoded +Subject: [PATCH 188/218] BCM2835-V4L2: Correctly denote key frames in encoded data Forward MMAL key frame flags to the V4L2 buffers. @@ -136235,10 +135827,10 @@ index e69731320f4e59249933bc21843913deab4a1209..6bdec0806126044cf7146d53326e4da5 "Buffer has ts %llu", dev->capture.last_timestamp); -From 42d2dabcd8aa8e74ccea82e9e3203b5ea7545aa8 Mon Sep 17 00:00:00 2001 +From ea252e584634a2717ea90318e2cd29684819f790 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 20 Feb 2017 17:01:21 +0000 -Subject: [PATCH 194/195] bcm2835-gpio-exp: Driver for GPIO expander via +Subject: [PATCH 189/218] bcm2835-gpio-exp: Driver for GPIO expander via mailbox service Pi3 and Compute Module 3 have a GPIO expander that the @@ -136656,10 +136248,10 @@ index 2859db09e25bb945251e85edb39bc43430857168..56b3f0fe1ea3d22fcf207e6df90b640e /* Dispmanx TAGS */ RPI_FIRMWARE_FRAMEBUFFER_ALLOCATE = 0x00040001, -From 7cea35f5b206a17ae0ee91d809f59d37678f27b0 Mon Sep 17 00:00:00 2001 +From b22ef9fc6c2ea6c6d7f3bb79d5c8cad10da1df71 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 24 May 2016 16:30:05 +0100 -Subject: [PATCH 195/195] BCM270X_DT: Add bcm2708-rpi-0-w.dts +Subject: [PATCH 190/218] BCM270X_DT: Add bcm2708-rpi-0-w.dts Add DT support for the Pi Zero W. N.B. It will not be loaded automatically without a corresponding change to the firmware. @@ -136886,3 +136478,5108 @@ index 0000000000000000000000000000000000000000..db0f99ddf2f46e83827d56e21c4846dd + sd_debug = <&sdhost>,"brcm,debug"; + }; +}; + +From c2d958c910600df334f245b20feb9d06e0c8dd28 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Mon, 6 Mar 2017 09:06:18 +0000 +Subject: [PATCH 191/218] clk-bcm2835: Read max core clock from firmware + +The VPU is responsible for managing the core clock, usually under +direction from the bcm2835-cpufreq driver but not via the clk-bcm2835 +driver. Since the core frequency can change without warning, it is +safer to report the maximum clock rate to users of the core clock - +I2C, SPI and the mini UART - to err on the safe side when calculating +clock divisors. + +If the DT node for the clock driver includes a reference to the +firmware node, use the firmware API to query the maximum core clock +instead of reading the divider registers. + +Prior to this patch, a "100KHz" I2C bus was sometimes clocked at about +160KHz. In particular, switching to the 4.9 kernel was likely to break +SenseHAT usage on a Pi3. + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/bcm2708-rpi.dtsi | 4 ++++ + drivers/clk/bcm/clk-bcm2835.c | 39 +++++++++++++++++++++++++++++++++++++- + 2 files changed, 42 insertions(+), 1 deletion(-) + +diff --git a/arch/arm/boot/dts/bcm2708-rpi.dtsi b/arch/arm/boot/dts/bcm2708-rpi.dtsi +index 1f5f40b9c7cbd574f12a42d8c3fa5344138d155e..72ab7fc673cef529c501026964284009b7cd401e 100644 +--- a/arch/arm/boot/dts/bcm2708-rpi.dtsi ++++ b/arch/arm/boot/dts/bcm2708-rpi.dtsi +@@ -111,3 +111,7 @@ + &vec { + status = "disabled"; + }; ++ ++&clocks { ++ firmware = <&firmware>; ++}; +diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c +index 8ea29fbc8dc451b9cff502bc1a918ae65fb1b306..fe3298b54cdfb96bd90fb4f39e13921d2e1d4356 100644 +--- a/drivers/clk/bcm/clk-bcm2835.c ++++ b/drivers/clk/bcm/clk-bcm2835.c +@@ -45,6 +45,7 @@ + #include + #include + #include ++#include + + #define CM_PASSWORD 0x5a000000 + +@@ -299,6 +300,8 @@ + #define LOCK_TIMEOUT_NS 100000000 + #define BCM2835_MAX_FB_RATE 1750000000u + ++#define VCMSG_ID_CORE_CLOCK 4 ++ + /* + * Names of clocks used within the driver that need to be replaced + * with an external parent's name. This array is in the order that +@@ -317,6 +320,7 @@ static const char *const cprman_parent_names[] = { + struct bcm2835_cprman { + struct device *dev; + void __iomem *regs; ++ struct rpi_firmware *fw; + spinlock_t regs_lock; /* spinlock for all clocks */ + + /* +@@ -1025,6 +1029,30 @@ static unsigned long bcm2835_clock_get_rate(struct clk_hw *hw, + return bcm2835_clock_rate_from_divisor(clock, parent_rate, div); + } + ++static unsigned long bcm2835_clock_get_rate_vpu(struct clk_hw *hw, ++ unsigned long parent_rate) ++{ ++ struct bcm2835_clock *clock = bcm2835_clock_from_hw(hw); ++ struct bcm2835_cprman *cprman = clock->cprman; ++ ++ if (cprman->fw) { ++ struct { ++ u32 id; ++ u32 val; ++ } packet; ++ ++ packet.id = VCMSG_ID_CORE_CLOCK; ++ packet.val = 0; ++ ++ if (!rpi_firmware_property(cprman->fw, ++ RPI_FIRMWARE_GET_MAX_CLOCK_RATE, ++ &packet, sizeof(packet))) ++ return packet.val; ++ } ++ ++ return bcm2835_clock_get_rate(hw, parent_rate); ++} ++ + static void bcm2835_clock_wait_busy(struct bcm2835_clock *clock) + { + struct bcm2835_cprman *cprman = clock->cprman; +@@ -1292,7 +1320,7 @@ static int bcm2835_vpu_clock_is_on(struct clk_hw *hw) + */ + static const struct clk_ops bcm2835_vpu_clock_clk_ops = { + .is_prepared = bcm2835_vpu_clock_is_on, +- .recalc_rate = bcm2835_clock_get_rate, ++ .recalc_rate = bcm2835_clock_get_rate_vpu, + .set_rate = bcm2835_clock_set_rate, + .determine_rate = bcm2835_clock_determine_rate, + .set_parent = bcm2835_clock_set_parent, +@@ -2155,6 +2183,7 @@ static int bcm2835_clk_probe(struct platform_device *pdev) + struct resource *res; + const struct bcm2835_clk_desc *desc; + const size_t asize = ARRAY_SIZE(clk_desc_array); ++ struct device_node *fw_node; + size_t i; + u32 clk_id; + int ret; +@@ -2172,6 +2201,14 @@ static int bcm2835_clk_probe(struct platform_device *pdev) + if (IS_ERR(cprman->regs)) + return PTR_ERR(cprman->regs); + ++ fw_node = of_parse_phandle(dev->of_node, "firmware", 0); ++ if (fw_node) { ++ struct rpi_firmware *fw = rpi_firmware_get(NULL); ++ if (!fw) ++ return -EPROBE_DEFER; ++ cprman->fw = fw; ++ } ++ + memset(bcm2835_clk_claimed, 0, sizeof(bcm2835_clk_claimed)); + for (i = 0; + !of_property_read_u32_index(pdev->dev.of_node, "claim-clocks", + +From 40ebee7ae82db7700a022addf75473132b1f4960 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 7 Mar 2017 19:48:23 +0000 +Subject: [PATCH 192/218] config: Add CONFIG_CRYPTO_LZ4 + +Enabling this options allows LZ4 memory compression. + +Fixes: https://github.com/raspberrypi/linux/issues/1875 + +Signed-off-by: Phil Elwell +--- + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 0173885ecbbfb98a27323a418d256841965412a1..ac50cc68f3a32ca897077d6fb70d8d2a7ec8cef2 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -1308,6 +1308,7 @@ CONFIG_CRYPTO_TGR192=m + CONFIG_CRYPTO_WP512=m + CONFIG_CRYPTO_CAST5=m + CONFIG_CRYPTO_DES=y ++CONFIG_CRYPTO_LZ4=m + CONFIG_CRYPTO_USER_API_SKCIPHER=m + # CONFIG_CRYPTO_HW is not set + CONFIG_ARM_CRYPTO=y +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 2c124bbfa343bf2c160250d055e1509678a80850..1748fcb84bdc3853ffccba93a41cd2dc0472d9fd 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -1318,6 +1318,7 @@ CONFIG_CRYPTO_TGR192=m + CONFIG_CRYPTO_WP512=m + CONFIG_CRYPTO_CAST5=m + CONFIG_CRYPTO_DES=y ++CONFIG_CRYPTO_LZ4=m + CONFIG_CRYPTO_USER_API_SKCIPHER=m + # CONFIG_CRYPTO_HW is not set + CONFIG_ARM_CRYPTO=y + +From b2dc4b0da8d4da904c2d6352df456f3fa35414fc Mon Sep 17 00:00:00 2001 +From: Michael Zoran +Date: Thu, 23 Feb 2017 17:54:31 -0800 +Subject: [PATCH 193/218] drm/vc4: Don't wait for vblank when updating the + cursor + +Commonly used desktop environments such as xfce4 and gnome +on debian sid can flood the graphics drivers with cursor +updates. Because the current implementation is waiting +for a vblank between cursor updates, this will cause the +display to hang for a long time since a typical refresh +rate is only 60Hz. + +This is unnecessary and unexpected by user mode software, +so simply swap out the cursor frame buffer without waiting. + +Signed-off-by: Michael Zoran +Reviewed-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_plane.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c +index 881bf489478b01b34e9e4df6013fe608c42215ee..14d69bb4967dedcd3bbc475639a8c27e38662fb3 100644 +--- a/drivers/gpu/drm/vc4/vc4_plane.c ++++ b/drivers/gpu/drm/vc4/vc4_plane.c +@@ -20,6 +20,7 @@ + + #include "vc4_drv.h" + #include "vc4_regs.h" ++#include "drm_atomic.h" + #include "drm_atomic_helper.h" + #include "drm_fb_cma_helper.h" + #include "drm_plane_helper.h" +@@ -769,12 +770,6 @@ vc4_update_plane(struct drm_plane *plane, + if (!plane_state) + goto out; + +- /* If we're changing the cursor contents, do that in the +- * normal vblank-synced atomic path. +- */ +- if (fb != plane_state->fb) +- goto out; +- + /* No configuring new scaling in the fast path. */ + if (crtc_w != plane_state->crtc_w || + crtc_h != plane_state->crtc_h || +@@ -783,6 +778,11 @@ vc4_update_plane(struct drm_plane *plane, + goto out; + } + ++ if (fb != plane_state->fb) { ++ drm_atomic_set_fb_for_plane(plane->state, fb); ++ vc4_plane_async_set_fb(plane, fb); ++ } ++ + /* Set the cursor's position on the screen. This is the + * expected change from the drm_mode_cursor_universal() + * helper. + +From c85d1b5d89cf13fa731bad864bc7c03c90e82dc5 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Mon, 6 Mar 2017 12:17:16 -0800 +Subject: [PATCH 194/218] panel-raspberrypi-touchscreen: Round up clk rate to + fix DSI panel. + +Commit 488f9bc8e3def93e0baef53cee2026c2cb0d8956 slightly increased the +reported rate of PLLD, so the clk driver decided that PLLD/3/8 was now +higher than our requested pixel clock rate and rejected it in favor of +PLLD/4/8, which then ran the pixel clock way out of spec. + +By bumping the requested clock rate just slightly, we get back to +PLLD/3/8 like we wanted and the panel displays content again. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c +index 1a536fe4d040f5fafe324baee110a6225dd0be08..7f315f04b109621ca7f3861fdd8acf956e752629 100644 +--- a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c ++++ b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c +@@ -220,7 +220,12 @@ static const struct drm_display_mode rpi_touchscreen_modes[] = { + #define HBP 46 + #define HFP ((PIXEL_CLOCK / (VTOTAL * VREFRESH)) - (HACT + HSW + HBP)) + +- .clock = PIXEL_CLOCK / 1000, ++ /* Round up the pixel clock a bit (10khz), so that the ++ * "don't run things faster than the requested clock ++ * rate" rule of the clk driver doesn't reject the ++ * divide-by-3 mode due to rounding error. ++ */ ++ .clock = PIXEL_CLOCK / 1000 + 10, + .hdisplay = HACT, + .hsync_start = HACT + HFP, + .hsync_end = HACT + HFP + HSW, + +From 6bd2872f819fa8c91c3addb12c6160507c586ab4 Mon Sep 17 00:00:00 2001 +From: Matt Flax +Date: Wed, 8 Mar 2017 20:04:13 +1100 +Subject: [PATCH 195/218] Add support for the AudioInjector.net Octo sound card + +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 6 + + .../dts/overlays/audioinjector-addons-overlay.dts | 50 ++++ + arch/arm/configs/bcm2709_defconfig | 2 + + arch/arm/configs/bcmrpi_defconfig | 2 + + sound/soc/bcm/Kconfig | 7 + + sound/soc/bcm/Makefile | 2 + + sound/soc/bcm/audioinjector-octo-soundcard.c | 286 +++++++++++++++++++++ + 8 files changed, 356 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/audioinjector-addons-overlay.dts + create mode 100644 sound/soc/bcm/audioinjector-octo-soundcard.c + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index c890e5ddb0e2eec982597a851023b539d318d6ce..0f7340799fb465ba1fb5aaa1e970cbf6295d75c4 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -9,6 +9,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + akkordion-iqdacplus.dtbo \ + allo-piano-dac-pcm512x-audio.dtbo \ + at86rf233.dtbo \ ++ audioinjector-addons.dtbo \ + audioinjector-wm8731-audio.dtbo \ + audremap.dtbo \ + bmp085_i2c-sensor.dtbo \ +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 970c9c9b5c74467a3014a77039fa765d8f8c4e6f..c1883bba938290f03826026651c764cfd4ac278b 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -295,6 +295,12 @@ Params: interrupt GPIO used for INT (default 23) + arrays (0=+0pF, 15=+4.5pF, default 15) + + ++Name: audioinjector-addons ++Info: Configures the audioinjector.net audio add on soundcards ++Load: dtoverlay=audioinjector-addons ++Params: ++ ++ + Name: audioinjector-wm8731-audio + Info: Configures the audioinjector.net audio add on soundcard + Load: dtoverlay=audioinjector-wm8731-audio +diff --git a/arch/arm/boot/dts/overlays/audioinjector-addons-overlay.dts b/arch/arm/boot/dts/overlays/audioinjector-addons-overlay.dts +new file mode 100644 +index 0000000000000000000000000000000000000000..dbf2f3cacc2e6bf5b7116fbadd97f2781580a79c +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/audioinjector-addons-overlay.dts +@@ -0,0 +1,50 @@ ++// Definitions for audioinjector.net audio add on soundcard ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target = <&i2s>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&i2c1>; ++ __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ cs42448: cs42448@48 { ++ #sound-dai-cells = <0>; ++ compatible = "cirrus,cs42448"; ++ reg = <0x48>; ++ clocks = <&cs42448_mclk>; ++ clock-names = "mclk"; ++ status = "okay"; ++ }; ++ ++ cs42448_mclk: codec-mclk { ++ compatible = "fixed-clock"; ++ #clock-cells = <0>; ++ clock-frequency = <49152000>; ++ }; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&sound>; ++ __overlay__ { ++ compatible = "ai,audioinjector-octo-soundcard"; ++ mult-gpios = <&gpio 27 0>, <&gpio 22 0>, <&gpio 23 0>, ++ <&gpio 24 0>; ++ i2s-controller = <&i2s>; ++ codec = <&cs42448>; ++ status = "okay"; ++ }; ++ }; ++}; +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index ac50cc68f3a32ca897077d6fb70d8d2a7ec8cef2..802ba0f149c571c215e556711367298d80409d71 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -888,6 +888,7 @@ CONFIG_SND_BCM2708_SOC_IQAUDIO_DIGI=m + CONFIG_SND_BCM2708_SOC_RASPIDAC3=m + CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m + CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m ++CONFIG_SND_AUDIOINJECTOR_OCTO_SOUNDCARD=m + CONFIG_SND_DIGIDAC1_SOUNDCARD=m + CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO=m + CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO_V2=m +@@ -897,6 +898,7 @@ CONFIG_SND_PISOUND=m + CONFIG_SND_SOC_ADAU1701=m + CONFIG_SND_SOC_ADAU7002=m + CONFIG_SND_SOC_AK4554=m ++CONFIG_SND_SOC_CS42XX8_I2C=m + CONFIG_SND_SOC_WM8804_I2C=m + CONFIG_SND_SIMPLE_CARD=m + CONFIG_SOUND_PRIME=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 1748fcb84bdc3853ffccba93a41cd2dc0472d9fd..bf52db66afb2aa18d6f6f9fb9b64dcbd97e24521 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -881,6 +881,7 @@ CONFIG_SND_BCM2708_SOC_IQAUDIO_DIGI=m + CONFIG_SND_BCM2708_SOC_RASPIDAC3=m + CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m + CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m ++CONFIG_SND_AUDIOINJECTOR_OCTO_SOUNDCARD=m + CONFIG_SND_DIGIDAC1_SOUNDCARD=m + CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO=m + CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO_V2=m +@@ -890,6 +891,7 @@ CONFIG_SND_PISOUND=m + CONFIG_SND_SOC_ADAU1701=m + CONFIG_SND_SOC_ADAU7002=m + CONFIG_SND_SOC_AK4554=m ++CONFIG_SND_SOC_CS42XX8_I2C=m + CONFIG_SND_SOC_WM8804_I2C=m + CONFIG_SND_SIMPLE_CARD=m + CONFIG_SOUND_PRIME=m +diff --git a/sound/soc/bcm/Kconfig b/sound/soc/bcm/Kconfig +index e626da6007a232e3e39660d7712ef1f4a5c30e8d..58d03b97f53363ed18df8fb10b4b3477a59e4ca3 100644 +--- a/sound/soc/bcm/Kconfig ++++ b/sound/soc/bcm/Kconfig +@@ -118,6 +118,13 @@ config SND_AUDIOINJECTOR_PI_SOUNDCARD + help + Say Y or M if you want to add support for audioinjector.net Pi Hat + ++config SND_AUDIOINJECTOR_OCTO_SOUNDCARD ++ tristate "Support for audioinjector.net Octo channel (Hat) soundcard" ++ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S ++ select SND_SOC_CS42XX8_I2C ++ help ++ Say Y or M if you want to add support for audioinjector.net octo add on ++ + config SND_DIGIDAC1_SOUNDCARD + tristate "Support for Red Rocks Audio DigiDAC1" + depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S +diff --git a/sound/soc/bcm/Makefile b/sound/soc/bcm/Makefile +index 8d2d2073dc2cede9fbd9eb8b49083650ba0a8172..d448aa517bf994fc0a41580c91b5d87deec9e1b0 100644 +--- a/sound/soc/bcm/Makefile ++++ b/sound/soc/bcm/Makefile +@@ -23,6 +23,7 @@ snd-soc-iqaudio-dac-objs := iqaudio-dac.o + snd-soc-iqaudio-digi-objs := iqaudio_digi.o + snd-soc-raspidac3-objs := raspidac3.o + snd-soc-audioinjector-pi-soundcard-objs := audioinjector-pi-soundcard.o ++snd-soc-audioinjector-octo-soundcard-objs := audioinjector-octo-soundcard.o + snd-soc-digidac1-soundcard-objs := digidac1-soundcard.o + snd-soc-dionaudio-loco-objs := dionaudio_loco.o + snd-soc-dionaudio-loco-v2-objs := dionaudio_loco-v2.o +@@ -44,6 +45,7 @@ obj-$(CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC) += snd-soc-iqaudio-dac.o + obj-$(CONFIG_SND_BCM2708_SOC_IQAUDIO_DIGI) += snd-soc-iqaudio-digi.o + obj-$(CONFIG_SND_BCM2708_SOC_RASPIDAC3) += snd-soc-raspidac3.o + obj-$(CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD) += snd-soc-audioinjector-pi-soundcard.o ++obj-$(CONFIG_SND_AUDIOINJECTOR_OCTO_SOUNDCARD) += snd-soc-audioinjector-octo-soundcard.o + obj-$(CONFIG_SND_DIGIDAC1_SOUNDCARD) += snd-soc-digidac1-soundcard.o + obj-$(CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO) += snd-soc-dionaudio-loco.o + obj-$(CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO_V2) += snd-soc-dionaudio-loco-v2.o +diff --git a/sound/soc/bcm/audioinjector-octo-soundcard.c b/sound/soc/bcm/audioinjector-octo-soundcard.c +new file mode 100644 +index 0000000000000000000000000000000000000000..9effea725798640887755dfa688da45338718afc +--- /dev/null ++++ b/sound/soc/bcm/audioinjector-octo-soundcard.c +@@ -0,0 +1,286 @@ ++/* ++ * ASoC Driver for AudioInjector Pi octo channel soundcard (hat) ++ * ++ * Created on: 27-October-2016 ++ * Author: flatmax@flatmax.org ++ * based on audioinjector-pi-soundcard.c ++ * ++ * Copyright (C) 2016 Flatmax Pty. Ltd. ++ * ++ * 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. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ */ ++ ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++ ++static struct gpio_descs *mult_gpios; ++static unsigned int audioinjector_octo_rate; ++ ++static int audioinjector_octo_dai_init(struct snd_soc_pcm_runtime *rtd) ++{ ++ return snd_soc_dai_set_bclk_ratio(rtd->cpu_dai, 64); ++} ++ ++static int audioinjector_octo_startup(struct snd_pcm_substream *substream) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ rtd->cpu_dai->driver->playback.channels_min = 8; ++ rtd->cpu_dai->driver->playback.channels_max = 8; ++ rtd->cpu_dai->driver->capture.channels_min = 8; ++ rtd->cpu_dai->driver->capture.channels_max = 8; ++ rtd->codec_dai->driver->capture.channels_max = 8; ++ return 0; ++} ++ ++static void audioinjector_octo_shutdown(struct snd_pcm_substream *substream) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ rtd->cpu_dai->driver->playback.channels_min = 2; ++ rtd->cpu_dai->driver->playback.channels_max = 2; ++ rtd->cpu_dai->driver->capture.channels_min = 2; ++ rtd->cpu_dai->driver->capture.channels_max = 2; ++ rtd->codec_dai->driver->capture.channels_max = 6; ++} ++ ++static int audioinjector_octo_hw_params(struct snd_pcm_substream *substream, ++ struct snd_pcm_hw_params *params) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ ++ // set codec DAI configuration ++ int ret = snd_soc_dai_set_fmt(rtd->codec_dai, ++ SND_SOC_DAIFMT_CBS_CFS|SND_SOC_DAIFMT_DSP_A| ++ SND_SOC_DAIFMT_NB_NF); ++ if (ret < 0) ++ return ret; ++ ++ // set cpu DAI configuration ++ ret = snd_soc_dai_set_fmt(rtd->cpu_dai, ++ SND_SOC_DAIFMT_CBM_CFM|SND_SOC_DAIFMT_I2S| ++ SND_SOC_DAIFMT_NB_NF); ++ if (ret < 0) ++ return ret; ++ ++ audioinjector_octo_rate = params_rate(params); ++ ++ return 0; ++} ++ ++static int audioinjector_octo_trigger(struct snd_pcm_substream *substream, ++ int cmd){ ++ int mult[4]; ++ mult[0] = 0; ++ mult[1] = 0; ++ mult[2] = 0; ++ mult[3] = 0; ++ ++ switch (cmd) { ++ case SNDRV_PCM_TRIGGER_START: ++ case SNDRV_PCM_TRIGGER_RESUME: ++ case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: ++ switch (audioinjector_octo_rate) { ++ case 192000: ++ mult[3] = 1; ++ case 176640: ++ mult[0] = 1; ++ mult[1] = 1; ++ mult[2] = 1; ++ break; ++ case 96000: ++ mult[3] = 1; ++ case 88200: ++ mult[1] = 1; ++ mult[2] = 1; ++ break; ++ case 64000: ++ mult[3] = 1; ++ case 58800: ++ mult[0] = 1; ++ mult[2] = 1; ++ break; ++ case 48000: ++ mult[3] = 1; ++ case 44100: ++ mult[2] = 1; ++ break; ++ case 32000: ++ mult[3] = 1; ++ case 29400: ++ mult[0] = 1; ++ mult[1] = 1; ++ break; ++ case 24000: ++ mult[3] = 1; ++ case 22050: ++ mult[1] = 1; ++ break; ++ case 16000: ++ mult[3] = 1; ++ case 14700: ++ mult[0] = 1; ++ break; ++ case 8000: ++ mult[3] = 1; ++ break; ++ default: ++ return -EINVAL; ++ } ++ break; ++ case SNDRV_PCM_TRIGGER_STOP: ++ case SNDRV_PCM_TRIGGER_SUSPEND: ++ case SNDRV_PCM_TRIGGER_PAUSE_PUSH: ++ break; ++ default: ++ return -EINVAL; ++ } ++ gpiod_set_array_value_cansleep(mult_gpios->ndescs, mult_gpios->desc, ++ mult); ++ ++ return 0; ++} ++ ++static struct snd_soc_ops audioinjector_octo_ops = { ++ .startup = audioinjector_octo_startup, ++ .shutdown = audioinjector_octo_shutdown, ++ .hw_params = audioinjector_octo_hw_params, ++ .trigger = audioinjector_octo_trigger, ++}; ++ ++static struct snd_soc_dai_link audioinjector_octo_dai[] = { ++ { ++ .name = "AudioInjector Octo", ++ .stream_name = "AudioInject-HIFI", ++ .codec_dai_name = "cs42448", ++ .ops = &audioinjector_octo_ops, ++ .init = audioinjector_octo_dai_init, ++ }, ++}; ++ ++static const struct snd_soc_dapm_widget audioinjector_octo_widgets[] = { ++ SND_SOC_DAPM_OUTPUT("OUTPUTS0"), ++ SND_SOC_DAPM_OUTPUT("OUTPUTS1"), ++ SND_SOC_DAPM_OUTPUT("OUTPUTS2"), ++ SND_SOC_DAPM_OUTPUT("OUTPUTS3"), ++ SND_SOC_DAPM_INPUT("INPUTS0"), ++ SND_SOC_DAPM_INPUT("INPUTS1"), ++ SND_SOC_DAPM_INPUT("INPUTS2"), ++}; ++ ++static const struct snd_soc_dapm_route audioinjector_octo_route[] = { ++ /* Balanced outputs */ ++ {"OUTPUTS0", NULL, "AOUT1L"}, ++ {"OUTPUTS0", NULL, "AOUT1R"}, ++ {"OUTPUTS1", NULL, "AOUT2L"}, ++ {"OUTPUTS1", NULL, "AOUT2R"}, ++ {"OUTPUTS2", NULL, "AOUT3L"}, ++ {"OUTPUTS2", NULL, "AOUT3R"}, ++ {"OUTPUTS3", NULL, "AOUT4L"}, ++ {"OUTPUTS3", NULL, "AOUT4R"}, ++ ++ /* Balanced inputs */ ++ {"AIN1L", NULL, "INPUTS0"}, ++ {"AIN1R", NULL, "INPUTS0"}, ++ {"AIN2L", NULL, "INPUTS1"}, ++ {"AIN2R", NULL, "INPUTS1"}, ++ {"AIN3L", NULL, "INPUTS2"}, ++ {"AIN3R", NULL, "INPUTS2"}, ++}; ++ ++static struct snd_soc_card snd_soc_audioinjector_octo = { ++ .name = "audioinjector-octo-soundcard", ++ .dai_link = audioinjector_octo_dai, ++ .num_links = ARRAY_SIZE(audioinjector_octo_dai), ++ ++ .dapm_widgets = audioinjector_octo_widgets, ++ .num_dapm_widgets = ARRAY_SIZE(audioinjector_octo_widgets), ++ .dapm_routes = audioinjector_octo_route, ++ .num_dapm_routes = ARRAY_SIZE(audioinjector_octo_route), ++}; ++ ++static int audioinjector_octo_probe(struct platform_device *pdev) ++{ ++ struct snd_soc_card *card = &snd_soc_audioinjector_octo; ++ int ret; ++ ++ card->dev = &pdev->dev; ++ ++ if (pdev->dev.of_node) { ++ struct snd_soc_dai_link *dai = &audioinjector_octo_dai[0]; ++ struct device_node *i2s_node = ++ of_parse_phandle(pdev->dev.of_node, ++ "i2s-controller", 0); ++ struct device_node *codec_node = ++ of_parse_phandle(pdev->dev.of_node, ++ "codec", 0); ++ ++ mult_gpios = devm_gpiod_get_array_optional(&pdev->dev, "mult", ++ GPIOD_OUT_LOW); ++ if (IS_ERR(mult_gpios)) ++ return PTR_ERR(mult_gpios); ++ ++ if (i2s_node && codec_node) { ++ dai->cpu_dai_name = NULL; ++ dai->cpu_of_node = i2s_node; ++ dai->platform_name = NULL; ++ dai->platform_of_node = i2s_node; ++ dai->codec_name = NULL; ++ dai->codec_of_node = codec_node; ++ } else ++ if (!dai->cpu_of_node) { ++ dev_err(&pdev->dev, ++ "i2s-controller missing or invalid in DT\n"); ++ return -EINVAL; ++ } else { ++ dev_err(&pdev->dev, ++ "Property 'codec' missing or invalid\n"); ++ return -EINVAL; ++ } ++ } ++ ++ ret = snd_soc_register_card(card); ++ if (ret != 0) ++ dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret); ++ return ret; ++} ++ ++static int audioinjector_octo_remove(struct platform_device *pdev) ++{ ++ struct snd_soc_card *card = platform_get_drvdata(pdev); ++ ++ return snd_soc_unregister_card(card); ++} ++ ++static const struct of_device_id audioinjector_octo_of_match[] = { ++ { .compatible = "ai,audioinjector-octo-soundcard", }, ++ {}, ++}; ++MODULE_DEVICE_TABLE(of, audioinjector_octo_of_match); ++ ++static struct platform_driver audioinjector_octo_driver = { ++ .driver = { ++ .name = "audioinjector-audio", ++ .owner = THIS_MODULE, ++ .of_match_table = audioinjector_octo_of_match, ++ }, ++ .probe = audioinjector_octo_probe, ++ .remove = audioinjector_octo_remove, ++}; ++ ++module_platform_driver(audioinjector_octo_driver); ++MODULE_AUTHOR("Matt Flax "); ++MODULE_DESCRIPTION("AudioInjector.net octo Soundcard"); ++MODULE_LICENSE("GPL v2"); ++MODULE_ALIAS("platform:audioinjector-octo-soundcard"); + +From b473b0188ccd8e6ef301295980b28f4293e95011 Mon Sep 17 00:00:00 2001 +From: Matt Flax +Date: Wed, 8 Mar 2017 21:13:24 +1100 +Subject: [PATCH 196/218] ASoC: bcm2835_i2s.c: relax the ch2 register setting + for 8 channels + +This patch allows ch2 registers to be set for 8 channels of audio. +--- + sound/soc/bcm/bcm2835-i2s.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/sound/soc/bcm/bcm2835-i2s.c b/sound/soc/bcm/bcm2835-i2s.c +index 6ba20498202ed36906b52096893a88867a79269f..c8dd065aea8414b47aa2ea4fc04168b5e29002ad 100644 +--- a/sound/soc/bcm/bcm2835-i2s.c ++++ b/sound/soc/bcm/bcm2835-i2s.c +@@ -239,6 +239,7 @@ static int bcm2835_i2s_hw_params(struct snd_pcm_substream *substream, + unsigned int ch1pos, ch2pos, mode, format; + uint32_t csreg; + ++ + /* + * If a stream is already enabled, + * the registers are already set properly. +@@ -312,6 +313,7 @@ static int bcm2835_i2s_hw_params(struct snd_pcm_substream *substream, + + switch (params_channels(params)) { + case 2: ++ case 8: + format = BCM2835_I2S_CH1(format) | BCM2835_I2S_CH2(format); + format |= BCM2835_I2S_CH1(BCM2835_I2S_CHPOS(ch1pos)); + format |= BCM2835_I2S_CH2(BCM2835_I2S_CHPOS(ch2pos)); + +From fc3ffd9c20046441b2e1fd8c1fec4a82320a3675 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Fri, 10 Mar 2017 14:43:15 +0000 +Subject: [PATCH 197/218] bcm2835-v4l2: Fix buffer overflow problem + +https://github.com/raspberrypi/linux/issues/1447 +port_parameter_get() failed to account for the header +(u32 id and u32 size) in the size before memcpying +the response into the response buffer, so overrunning +the provided buffer by 8 bytes. + +Account for those bytes, and also a belt-and-braces +check to ensure we never copy more than *value_size +bytes into value. + +Signed-off-by: Dave Stevenson +--- + drivers/media/platform/bcm2835/mmal-vchiq.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/drivers/media/platform/bcm2835/mmal-vchiq.c b/drivers/media/platform/bcm2835/mmal-vchiq.c +index 781322542d5a8295f3d7d5a3eaaf0cac29930c30..e4b243b33f58913f3d2952c97d2a2e3fbbbd0ae8 100644 +--- a/drivers/media/platform/bcm2835/mmal-vchiq.c ++++ b/drivers/media/platform/bcm2835/mmal-vchiq.c +@@ -1315,7 +1315,12 @@ static int port_parameter_get(struct vchiq_mmal_instance *instance, + } + + ret = -rmsg->u.port_parameter_get_reply.status; +- if (ret) { ++ /* port_parameter_get_reply.size includes the header, ++ * whilst *value_size doesn't. ++ */ ++ rmsg->u.port_parameter_get_reply.size -= (2 * sizeof(u32)); ++ ++ if (ret || rmsg->u.port_parameter_get_reply.size > *value_size) { + /* Copy only as much as we have space for + * but report true size of parameter + */ + +From 00c5b24eaf0de50b8773c228bd6f257eaf046c63 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 10 Feb 2017 17:57:08 -0800 +Subject: [PATCH 198/218] build/arm64: Add rules for .dtbo files for dts + overlays + +We now create overlays as .dtbo files. + +Signed-off-by: Khem Raj +--- + arch/arm64/Makefile | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile +index 3635b8662724569d3338ebb620d603c644fe38b7..822fefeb1cd0aa2dc8398f885cf28e9bfd5a2637 100644 +--- a/arch/arm64/Makefile ++++ b/arch/arm64/Makefile +@@ -113,6 +113,9 @@ zinstall install: + %.dtb: scripts + $(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@ + ++%.dtbo: | scripts ++ $(Q)$(MAKE) $(build)=$(boot)/dts MACHINE=$(MACHINE) $(boot)/dts/$@ ++ + PHONY += dtbs dtbs_install + + dtbs: prepare scripts + +From 7adee42b6c209dcbcc23ad7ade54aabfd230b5d0 Mon Sep 17 00:00:00 2001 +From: John Greb +Date: Wed, 8 Mar 2017 15:12:29 +0000 +Subject: [PATCH 199/218] Match dwc2 device-tree fifo sizes to the hardware + values. + +Since commit aa381a7259c3f53727bcaa8c5f9359e940a0e3fd was reverted with 3fa9538539ac737096c81f3315a14670b1609092 the g-tx-fifo-size array in the device-tree needs to match the preset values in the bcm2835. + +Resolves https://github.com/raspberrypi/linux/issues/1876 +--- + arch/arm/boot/dts/overlays/dwc2-overlay.dts | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/arch/arm/boot/dts/overlays/dwc2-overlay.dts b/arch/arm/boot/dts/overlays/dwc2-overlay.dts +index 527abc9f0ddf71f4dc7d58336d87684c931cc2f3..265a16bab008453edba198cf2366c423509d60d6 100644 +--- a/arch/arm/boot/dts/overlays/dwc2-overlay.dts ++++ b/arch/arm/boot/dts/overlays/dwc2-overlay.dts +@@ -15,7 +15,7 @@ + dr_mode = "otg"; + g-np-tx-fifo-size = <32>; + g-rx-fifo-size = <256>; +- g-tx-fifo-size = <256 128 128 64 64 64 32>; ++ g-tx-fifo-size = <512 512 512 512 512 768>; + status = "okay"; + }; + }; +@@ -24,6 +24,5 @@ + dr_mode = <&dwc2_usb>, "dr_mode"; + g-np-tx-fifo-size = <&dwc2_usb>,"g-np-tx-fifo-size:0"; + g-rx-fifo-size = <&dwc2_usb>,"g-rx-fifo-size:0"; +- g-tx-fifo-size = <&dwc2_usb>,"g-tx-fifo-size:0"; + }; + }; + +From de86d38d29608e26b8c69636afe9ff1e9983aa77 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Sun, 5 Mar 2017 11:46:41 +0000 +Subject: [PATCH 200/218] config: Add RTL8XXXU wifi module + +--- + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 802ba0f149c571c215e556711367298d80409d71..5f5f19f0e277e3f5e7bf12eedb2d42cb7220ae39 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -543,6 +543,7 @@ CONFIG_RT2800USB_RT55XX=y + CONFIG_RT2800USB_UNKNOWN=y + CONFIG_RTL8187=m + CONFIG_RTL8192CU=m ++CONFIG_RTL8XXXU=m + CONFIG_USB_ZD1201=m + CONFIG_ZD1211RW=m + CONFIG_MAC80211_HWSIM=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index bf52db66afb2aa18d6f6f9fb9b64dcbd97e24521..4bc0f8b52b7f39f99d650cb9c4cdfdba6fac59dd 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -539,6 +539,7 @@ CONFIG_RT2800USB_RT55XX=y + CONFIG_RT2800USB_UNKNOWN=y + CONFIG_RTL8187=m + CONFIG_RTL8192CU=m ++CONFIG_RTL8XXXU=m + CONFIG_USB_ZD1201=m + CONFIG_ZD1211RW=m + CONFIG_MAC80211_HWSIM=m + +From f3435e811e4cf3977192be51d694c5016fdd0372 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Tue, 7 Mar 2017 12:18:20 +0000 +Subject: [PATCH 201/218] BCM270X_DT: Invert Pi3 power LED to match fw change + +Firmware expgpio driver reworked due to complaint over +hotplug detect. +Requires power LED to change sense as firmware is no longer +inverting the read value. + +Signed-off-by: Dave Stevenson +--- + arch/arm/boot/dts/bcm2710-rpi-3-b.dts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm/boot/dts/bcm2710-rpi-3-b.dts b/arch/arm/boot/dts/bcm2710-rpi-3-b.dts +index 173103aaca503833b5e29530ed94e14c7cab0444..b21d2866d204adc533b46d581028f290e5c34a3d 100644 +--- a/arch/arm/boot/dts/bcm2710-rpi-3-b.dts ++++ b/arch/arm/boot/dts/bcm2710-rpi-3-b.dts +@@ -175,7 +175,7 @@ + pwr_led: pwr { + label = "led1"; + linux,default-trigger = "input"; +- gpios = <&expgpio 7 GPIO_ACTIVE_LOW>; ++ gpios = <&expgpio 7 0>; + }; + }; + + +From 622b1eb96dc5719ad7562e565311d8a68d229315 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 14 Mar 2017 09:10:05 +0000 +Subject: [PATCH 202/218] BCM270X_DT: Add lm75 to i2c-sensor overlay + +See: https://www.raspberrypi.org/forums/viewtopic.php?f=107&t=177236 + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/overlays/README | 8 +++++--- + arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts | 8 ++++++++ + 2 files changed, 13 insertions(+), 3 deletions(-) + +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index c1883bba938290f03826026651c764cfd4ac278b..a8853b7820cd7a333cdaa2421f770a834dc724d5 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -388,9 +388,6 @@ Params: dr_mode Dual role mode: "host", "peripheral" or "otg" + g-np-tx-fifo-size Size of non-periodic tx fifo size in gadget + mode + +- g-tx-fifo-size Size of periodic tx fifo per endpoint +- (except ep0) in gadget mode +- + + [ The ds1307-rtc overlay has been deleted. See i2c-rtc. ] + +@@ -608,6 +605,11 @@ Params: bmp085 Select the Bosch sensortronic BMP085 + + bmp280 Select the Bosch sensortronic BMP280 + ++ lm75 Select the Maxim LM75 temperature sensor ++ ++ lm75addr Choose the address for the LM75 (0x48-0x4f - ++ default 0x4f) ++ + si7020 Select the Silicon Labs Si7013/20/21 humidity/ + temperature sensor + +diff --git a/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts b/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts +index 31bda8da4cb6a56bfe493a81b918900995fb0589..606b2d5012abf2e85712be631c42ea40a0b512c5 100644 +--- a/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts ++++ b/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts +@@ -25,6 +25,12 @@ + status = "disable"; + }; + ++ lm75: lm75@4f { ++ compatible = "lm75"; ++ reg = <0x4f>; ++ status = "disable"; ++ }; ++ + si7020: si7020@40 { + compatible = "si7020"; + reg = <0x40>; +@@ -36,6 +42,8 @@ + __overrides__ { + bmp085 = <&bmp085>,"status"; + bmp280 = <&bmp280>,"status"; ++ lm75 = <&lm75>,"status"; ++ lm75addr = <&lm75>,"reg:0"; + si7020 = <&si7020>,"status"; + }; + }; + +From 9be8413c7b7975dcb27a5ce2aff72bb538b06d59 Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Tue, 14 Mar 2017 14:23:06 +0000 +Subject: [PATCH 203/218] bcm2835-gpio-exp: Copy/paste error adding base twice + +brcmexp_gpio_set was adding gpio->gc.base to the offset +twice, so passing an invalid number to the mailbox service. +The firmware treated it modulo-8 anyway, but was logging an +assert every time. + +Signed-off-by: Dave Stevenson +--- + drivers/gpio/gpio-bcm-exp.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/drivers/gpio/gpio-bcm-exp.c b/drivers/gpio/gpio-bcm-exp.c +index 681a91492d4c33bdfd42416e069218e8611cc4d9..d68adafaee4ad406f45f4ff0d6b7c1ad5d10e330 100644 +--- a/drivers/gpio/gpio-bcm-exp.c ++++ b/drivers/gpio/gpio-bcm-exp.c +@@ -165,8 +165,6 @@ static void brcmexp_gpio_set(struct gpio_chip *gc, unsigned int off, int val) + + gpio = container_of(gc, struct brcmexp_gpio, gc); + +- off += gpio->gc.base; +- + set.gpio = off + gpio->gc.base; /* GPIO to update */ + set.state = val; /* Output state */ + + +From 9d7aa31a59af07d150cc733fbc29be367f97d93c Mon Sep 17 00:00:00 2001 +From: Dave Stevenson +Date: Wed, 15 Mar 2017 11:12:40 +0000 +Subject: [PATCH 204/218] bcm2835-camera: Correct port_parameter_get return + value + +The API for port_parameter_get() requires that the +filled length is returned, or if insufficient space +that the required space is returned. + +Signed-off-by: Dave Stevenson +--- + drivers/media/platform/bcm2835/mmal-vchiq.c | 17 ++++++++++++----- + 1 file changed, 12 insertions(+), 5 deletions(-) + +diff --git a/drivers/media/platform/bcm2835/mmal-vchiq.c b/drivers/media/platform/bcm2835/mmal-vchiq.c +index e4b243b33f58913f3d2952c97d2a2e3fbbbd0ae8..ec2853ba9d4b1b0cd6e07a495a424e15159208e8 100644 +--- a/drivers/media/platform/bcm2835/mmal-vchiq.c ++++ b/drivers/media/platform/bcm2835/mmal-vchiq.c +@@ -1292,6 +1292,7 @@ static int port_parameter_get(struct vchiq_mmal_instance *instance, + struct mmal_msg m; + struct mmal_msg *rmsg; + VCHI_HELD_MSG_T rmsg_handle; ++ u32 reply_size; + + m.h.type = MMAL_MSG_TYPE_PORT_PARAMETER_GET; + +@@ -1315,21 +1316,27 @@ static int port_parameter_get(struct vchiq_mmal_instance *instance, + } + + ret = -rmsg->u.port_parameter_get_reply.status; +- /* port_parameter_get_reply.size includes the header, ++ /* ++ * port_parameter_get_reply.size includes the header, + * whilst *value_size doesn't. + */ +- rmsg->u.port_parameter_get_reply.size -= (2 * sizeof(u32)); ++ reply_size = rmsg->u.port_parameter_get_reply.size - (2 * sizeof(u32)); + +- if (ret || rmsg->u.port_parameter_get_reply.size > *value_size) { ++ if (ret || (reply_size > *value_size)) { + /* Copy only as much as we have space for + * but report true size of parameter + */ + memcpy(value, &rmsg->u.port_parameter_get_reply.value, + *value_size); +- *value_size = rmsg->u.port_parameter_get_reply.size; + } else + memcpy(value, &rmsg->u.port_parameter_get_reply.value, +- rmsg->u.port_parameter_get_reply.size); ++ reply_size); ++ ++ /* ++ * Return amount of data copied if big enough, ++ * or wanted if not big enough. ++ */ ++ *value_size = reply_size; + + pr_debug("%s:result:%d component:0x%x port:%d parameter:%d\n", __func__, + ret, port->component->handle, port->handle, parameter_id); + +From 3fe69a591172fbc6dd340267c4d82a8ec55c7976 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 17 Mar 2017 12:24:41 +0000 +Subject: [PATCH 205/218] config: Make spidev a loadable module + +spidev isn't required early in the boot process, and not all users +need it (spi_bcm2835 is a module), so make it a loadable module. + +See: https://github.com/raspberrypi/linux/issues/1897 + +Signed-off-by: Phil Elwell +--- + arch/arm/configs/bcm2709_defconfig | 3 +-- + arch/arm/configs/bcmrpi_defconfig | 3 +-- + 2 files changed, 2 insertions(+), 4 deletions(-) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 5f5f19f0e277e3f5e7bf12eedb2d42cb7220ae39..598b4bf29f30a920b79b6451ded7a56d06033d7d 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -621,7 +621,7 @@ CONFIG_I2C_GPIO=m + CONFIG_SPI=y + CONFIG_SPI_BCM2835=m + CONFIG_SPI_BCM2835AUX=m +-CONFIG_SPI_SPIDEV=y ++CONFIG_SPI_SPIDEV=m + CONFIG_PPS=m + CONFIG_PPS_CLIENT_LDISC=m + CONFIG_PPS_CLIENT_GPIO=m +@@ -899,7 +899,6 @@ CONFIG_SND_PISOUND=m + CONFIG_SND_SOC_ADAU1701=m + CONFIG_SND_SOC_ADAU7002=m + CONFIG_SND_SOC_AK4554=m +-CONFIG_SND_SOC_CS42XX8_I2C=m + CONFIG_SND_SOC_WM8804_I2C=m + CONFIG_SND_SIMPLE_CARD=m + CONFIG_SOUND_PRIME=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 4bc0f8b52b7f39f99d650cb9c4cdfdba6fac59dd..8d64ce4465f6f276b2d58ed1e2e45fb0d69ef3ad 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -616,7 +616,7 @@ CONFIG_I2C_GPIO=m + CONFIG_SPI=y + CONFIG_SPI_BCM2835=m + CONFIG_SPI_BCM2835AUX=m +-CONFIG_SPI_SPIDEV=y ++CONFIG_SPI_SPIDEV=m + CONFIG_PPS=m + CONFIG_PPS_CLIENT_LDISC=m + CONFIG_PPS_CLIENT_GPIO=m +@@ -892,7 +892,6 @@ CONFIG_SND_PISOUND=m + CONFIG_SND_SOC_ADAU1701=m + CONFIG_SND_SOC_ADAU7002=m + CONFIG_SND_SOC_AK4554=m +-CONFIG_SND_SOC_CS42XX8_I2C=m + CONFIG_SND_SOC_WM8804_I2C=m + CONFIG_SND_SIMPLE_CARD=m + CONFIG_SOUND_PRIME=m + +From feb3e1ccb66923da95ed9986338109079c4356e8 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Thu, 23 Mar 2017 10:06:56 +0000 +Subject: [PATCH 206/218] ASoC: Add prompt for ICS43432 codec + +Without a prompt string, a config setting can't be included in a +defconfig. Give CONFIG_SND_SOC_ICS43432 a prompt so that Pi soundcards +can use the driver. + +Signed-off-by: Phil Elwell +--- + sound/soc/codecs/Kconfig | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig +index 9824cdd04b0c11c45b8cedd0187a0eba8f1dc2d4..c0b88d43df0de283c58ed6158680bc7e3da0e608 100644 +--- a/sound/soc/codecs/Kconfig ++++ b/sound/soc/codecs/Kconfig +@@ -535,7 +535,7 @@ config SND_SOC_HDAC_HDMI + select HDMI + + config SND_SOC_ICS43432 +- tristate ++ tristate "InvenSense ICS43432 I2S microphone codec" + + config SND_SOC_INNO_RK3036 + tristate "Inno codec driver for RK3036 SoC" + +From 48a6797639e52ccdf237b405f53ae6a372ea98fa Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Thu, 23 Mar 2017 16:34:46 +0000 +Subject: [PATCH 207/218] bcm2835-aux: Add aux interrupt controller + +The AUX block has a shared interrupt line with a register indicating +which devices have active IRQs. Expose this as a nested interrupt +controller to avoid sharing problems. + +See: https://github.com/raspberrypi/linux/issues/1484 + https://github.com/raspberrypi/linux/issues/1573 + +Signed-off-by: Phil Elwell +--- + drivers/clk/bcm/clk-bcm2835-aux.c | 120 ++++++++++++++++++++++++++++++++++++++ + 1 file changed, 120 insertions(+) + +diff --git a/drivers/clk/bcm/clk-bcm2835-aux.c b/drivers/clk/bcm/clk-bcm2835-aux.c +index bd750cf2238d61489811e7d7bd3b5f9950ed53c8..41e0702fae4692221980b0d02aed1ba652945650 100644 +--- a/drivers/clk/bcm/clk-bcm2835-aux.c ++++ b/drivers/clk/bcm/clk-bcm2835-aux.c +@@ -17,17 +17,107 @@ + #include + #include + #include ++#include ++#include ++#include + #include + + #define BCM2835_AUXIRQ 0x00 + #define BCM2835_AUXENB 0x04 + ++#define BCM2835_AUXIRQ_NUM_IRQS 3 ++ ++#define BCM2835_AUXIRQ_UART_IRQ 0 ++#define BCM2835_AUXIRQ_SPI1_IRQ 1 ++#define BCM2835_AUXIRQ_SPI2_IRQ 2 ++ ++#define BCM2835_AUXIRQ_UART_MASK 0x01 ++#define BCM2835_AUXIRQ_SPI1_MASK 0x02 ++#define BCM2835_AUXIRQ_SPI2_MASK 0x04 ++ ++#define BCM2835_AUXIRQ_ALL_MASK \ ++ (BCM2835_AUXIRQ_UART_MASK | \ ++ BCM2835_AUXIRQ_SPI1_MASK | \ ++ BCM2835_AUXIRQ_SPI2_MASK) ++ ++struct auxirq_state { ++ void __iomem *status; ++ u32 enables; ++ struct irq_domain *domain; ++ struct regmap *local_regmap; ++}; ++ ++static struct auxirq_state auxirq __read_mostly; ++ ++static irqreturn_t bcm2835_auxirq_handler(int irq, void *dev_id) ++{ ++ u32 stat = readl_relaxed(auxirq.status); ++ u32 masked = stat & auxirq.enables; ++ ++ if (masked & BCM2835_AUXIRQ_UART_MASK) ++ generic_handle_irq(irq_linear_revmap(auxirq.domain, ++ BCM2835_AUXIRQ_UART_IRQ)); ++ ++ if (masked & BCM2835_AUXIRQ_SPI1_MASK) ++ generic_handle_irq(irq_linear_revmap(auxirq.domain, ++ BCM2835_AUXIRQ_SPI1_IRQ)); ++ ++ if (masked & BCM2835_AUXIRQ_SPI2_MASK) ++ generic_handle_irq(irq_linear_revmap(auxirq.domain, ++ BCM2835_AUXIRQ_SPI2_IRQ)); ++ ++ return (masked & BCM2835_AUXIRQ_ALL_MASK) ? IRQ_HANDLED : IRQ_NONE; ++} ++ ++static int bcm2835_auxirq_xlate(struct irq_domain *d, ++ struct device_node *ctrlr, ++ const u32 *intspec, unsigned int intsize, ++ unsigned long *out_hwirq, ++ unsigned int *out_type) ++{ ++ if (WARN_ON(intsize != 1)) ++ return -EINVAL; ++ ++ if (WARN_ON(intspec[0] >= BCM2835_AUXIRQ_NUM_IRQS)) ++ return -EINVAL; ++ ++ *out_hwirq = intspec[0]; ++ *out_type = IRQ_TYPE_NONE; ++ return 0; ++} ++ ++static void bcm2835_auxirq_mask(struct irq_data *data) ++{ ++ irq_hw_number_t hwirq = irqd_to_hwirq(data); ++ ++ auxirq.enables &= ~(1 << hwirq); ++} ++ ++static void bcm2835_auxirq_unmask(struct irq_data *data) ++{ ++ irq_hw_number_t hwirq = irqd_to_hwirq(data); ++ ++ auxirq.enables |= (1 << hwirq); ++} ++ ++static struct irq_chip bcm2835_auxirq_chip = { ++ .name = "bcm2835-auxirq", ++ .irq_mask = bcm2835_auxirq_mask, ++ .irq_unmask = bcm2835_auxirq_unmask, ++}; ++ ++static const struct irq_domain_ops bcm2835_auxirq_ops = { ++ .xlate = bcm2835_auxirq_xlate//irq_domain_xlate_onecell ++}; ++ + static int bcm2835_aux_clk_probe(struct platform_device *pdev) + { + struct device *dev = &pdev->dev; ++ struct device_node *node = dev->of_node; + struct clk_hw_onecell_data *onecell; + const char *parent; + struct clk *parent_clk; ++ int parent_irq; + struct resource *res; + void __iomem *reg, *gate; + +@@ -41,6 +131,36 @@ static int bcm2835_aux_clk_probe(struct platform_device *pdev) + if (IS_ERR(reg)) + return PTR_ERR(reg); + ++ parent_irq = irq_of_parse_and_map(node, 0); ++ if (parent_irq) { ++ int ret; ++ int i; ++ ++ /* Manage the AUX irq as well */ ++ auxirq.status = reg + BCM2835_AUXIRQ; ++ auxirq.domain = irq_domain_add_linear(node, ++ BCM2835_AUXIRQ_NUM_IRQS, ++ &bcm2835_auxirq_ops, ++ NULL); ++ if (!auxirq.domain) ++ return -ENXIO; ++ ++ for (i = 0; i < BCM2835_AUXIRQ_NUM_IRQS; i++) { ++ unsigned int irq = irq_create_mapping(auxirq.domain, i); ++ ++ if (irq == 0) ++ return -ENXIO; ++ ++ irq_set_chip_and_handler(irq, &bcm2835_auxirq_chip, ++ handle_level_irq); ++ } ++ ++ ret = devm_request_irq(dev, parent_irq, bcm2835_auxirq_handler, ++ 0, "bcm2835-auxirq", NULL); ++ if (ret) ++ return ret; ++ } ++ + onecell = devm_kmalloc(dev, sizeof(*onecell) + sizeof(*onecell->hws) * + BCM2835_AUX_CLOCK_COUNT, GFP_KERNEL); + if (!onecell) + +From bfb106980fb14b160f1691a669182511b412d017 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Thu, 23 Mar 2017 17:08:44 +0000 +Subject: [PATCH 208/218] BCM270X_DT: Enable AUX interrupt controller in DT + +See: https://github.com/raspberrypi/linux/issues/1484 + https://github.com/raspberrypi/linux/issues/1573 + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/bcm283x.dtsi | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/arch/arm/boot/dts/bcm283x.dtsi b/arch/arm/boot/dts/bcm283x.dtsi +index d3cc586661f903e67a840189c0446aa80e16a44e..348c71bbc913644c04bab43fcb95abe9b6c9c640 100644 +--- a/arch/arm/boot/dts/bcm283x.dtsi ++++ b/arch/arm/boot/dts/bcm283x.dtsi +@@ -216,12 +216,16 @@ + #clock-cells = <1>; + reg = <0x7e215000 0x8>; + clocks = <&clocks BCM2835_CLOCK_VPU>; ++ interrupts = <1 29>; ++ interrupt-controller; ++ #interrupt-cells = <1>; + }; + + uart1: serial@7e215040 { + compatible = "brcm,bcm2835-aux-uart"; + reg = <0x7e215040 0x40>; +- interrupts = <1 29>; ++ interrupt-parent = <&aux>; ++ interrupts = <0>; + clocks = <&aux BCM2835_AUX_CLOCK_UART>; + status = "disabled"; + }; +@@ -229,7 +233,8 @@ + spi1: spi@7e215080 { + compatible = "brcm,bcm2835-aux-spi"; + reg = <0x7e215080 0x40>; +- interrupts = <1 29>; ++ interrupt-parent = <&aux>; ++ interrupts = <1>; + clocks = <&aux BCM2835_AUX_CLOCK_SPI1>; + #address-cells = <1>; + #size-cells = <0>; +@@ -239,7 +244,8 @@ + spi2: spi@7e2150c0 { + compatible = "brcm,bcm2835-aux-spi"; + reg = <0x7e2150c0 0x40>; +- interrupts = <1 29>; ++ interrupt-parent = <&aux>; ++ interrupts = <2>; + clocks = <&aux BCM2835_AUX_CLOCK_SPI2>; + #address-cells = <1>; + #size-cells = <0>; + +From 2c8658ecfda835d4581015b450e12815a0c82375 Mon Sep 17 00:00:00 2001 +From: Matt Flax +Date: Mon, 27 Mar 2017 22:26:49 +1100 +Subject: [PATCH 209/218] Audioinjector addons dts : add reset and regulators + for the Octo product. + +This patch adds a reset GPIO for the AudioInjector.net octo sound card. +This patch adds missing regulators for the cs42448 codec. +--- + .../dts/overlays/audioinjector-addons-overlay.dts | 27 +++++++++++++++++++++- + 1 file changed, 26 insertions(+), 1 deletion(-) + +diff --git a/arch/arm/boot/dts/overlays/audioinjector-addons-overlay.dts b/arch/arm/boot/dts/overlays/audioinjector-addons-overlay.dts +index dbf2f3cacc2e6bf5b7116fbadd97f2781580a79c..a36fa85a61f7eaab35ca481ed1dac621e2342e6d 100644 +--- a/arch/arm/boot/dts/overlays/audioinjector-addons-overlay.dts ++++ b/arch/arm/boot/dts/overlays/audioinjector-addons-overlay.dts +@@ -13,6 +13,26 @@ + }; + + fragment@1 { ++ target = <&soc>; ++ __overlay__ { ++ reg_digital: reg_digital@0 { ++ compatible = "regulator-fixed"; ++ regulator-name = "cs42448_dig_supply"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-always-on; ++ }; ++ reg_analogue: reg_analogue@0 { ++ compatible = "regulator-fixed"; ++ regulator-name = "cs42448_ana_supply"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ regulator-always-on; ++ }; ++ }; ++ }; ++ ++ fragment@2 { + target = <&i2c1>; + __overlay__ { + #address-cells = <1>; +@@ -25,6 +45,10 @@ + reg = <0x48>; + clocks = <&cs42448_mclk>; + clock-names = "mclk"; ++ VA-supply = <®_analogue>; ++ VD-supply = <®_digital>; ++ VLS-supply = <®_digital>; ++ VLC-supply = <®_digital>; + status = "okay"; + }; + +@@ -36,12 +60,13 @@ + }; + }; + +- fragment@2 { ++ fragment@3 { + target = <&sound>; + __overlay__ { + compatible = "ai,audioinjector-octo-soundcard"; + mult-gpios = <&gpio 27 0>, <&gpio 22 0>, <&gpio 23 0>, + <&gpio 24 0>; ++ reset-gpios = <&gpio 5 0>; + i2s-controller = <&i2s>; + codec = <&cs42448>; + status = "okay"; + +From 4afa6049340f289a62810d5a231d615017e211f1 Mon Sep 17 00:00:00 2001 +From: Matt Flax +Date: Mon, 27 Mar 2017 22:27:26 +1100 +Subject: [PATCH 210/218] AudioInjector Octo : Consolidate sample rates and add + a codec reset. + +This patch consolidates the sample rates which the audioinjector.net octo +sound card can use. The consolidation of sample rates are due to the +capabilities of the cs42448 codec. + +This codec also requires a hard reset using the GPIO pin 5 upon probe. +--- + sound/soc/bcm/audioinjector-octo-soundcard.c | 75 ++++++++++++++++------------ + 1 file changed, 42 insertions(+), 33 deletions(-) + +diff --git a/sound/soc/bcm/audioinjector-octo-soundcard.c b/sound/soc/bcm/audioinjector-octo-soundcard.c +index 9effea725798640887755dfa688da45338718afc..1198c36c4563b8673e5d386d1dfa92d43689e297 100644 +--- a/sound/soc/bcm/audioinjector-octo-soundcard.c ++++ b/sound/soc/bcm/audioinjector-octo-soundcard.c +@@ -27,8 +27,18 @@ + #include + + static struct gpio_descs *mult_gpios; ++static struct gpio_desc *codec_rst_gpio; + static unsigned int audioinjector_octo_rate; + ++static const unsigned int audioinjector_octo_rates[] = { ++ 96000, 48000, 88200, 44100, ++}; ++ ++static struct snd_pcm_hw_constraint_list audioinjector_octo_constraints = { ++ .list = audioinjector_octo_rates, ++ .count = ARRAY_SIZE(audioinjector_octo_rates), ++}; ++ + static int audioinjector_octo_dai_init(struct snd_soc_pcm_runtime *rtd) + { + return snd_soc_dai_set_bclk_ratio(rtd->cpu_dai, 64); +@@ -42,6 +52,11 @@ static int audioinjector_octo_startup(struct snd_pcm_substream *substream) + rtd->cpu_dai->driver->capture.channels_min = 8; + rtd->cpu_dai->driver->capture.channels_max = 8; + rtd->codec_dai->driver->capture.channels_max = 8; ++ ++ snd_pcm_hw_constraint_list(substream->runtime, 0, ++ SNDRV_PCM_HW_PARAM_RATE, ++ &audioinjector_octo_constraints); ++ + return 0; + } + +@@ -76,7 +91,21 @@ static int audioinjector_octo_hw_params(struct snd_pcm_substream *substream, + + audioinjector_octo_rate = params_rate(params); + +- return 0; ++ // Set the correct sysclock for the codec ++ switch (audioinjector_octo_rate) { ++ case 96000: ++ case 48000: ++ return snd_soc_dai_set_sysclk(rtd->codec_dai, 0, 49152000, ++ 0); ++ break; ++ case 88200: ++ case 44100: ++ return snd_soc_dai_set_sysclk(rtd->codec_dai, 0, 45185400, ++ 0); ++ break; ++ default: ++ return -EINVAL; ++ } + } + + static int audioinjector_octo_trigger(struct snd_pcm_substream *substream, +@@ -92,49 +121,17 @@ static int audioinjector_octo_trigger(struct snd_pcm_substream *substream, + case SNDRV_PCM_TRIGGER_RESUME: + case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: + switch (audioinjector_octo_rate) { +- case 192000: +- mult[3] = 1; +- case 176640: +- mult[0] = 1; +- mult[1] = 1; +- mult[2] = 1; +- break; + case 96000: + mult[3] = 1; + case 88200: + mult[1] = 1; + mult[2] = 1; + break; +- case 64000: +- mult[3] = 1; +- case 58800: +- mult[0] = 1; +- mult[2] = 1; +- break; + case 48000: + mult[3] = 1; + case 44100: + mult[2] = 1; + break; +- case 32000: +- mult[3] = 1; +- case 29400: +- mult[0] = 1; +- mult[1] = 1; +- break; +- case 24000: +- mult[3] = 1; +- case 22050: +- mult[1] = 1; +- break; +- case 16000: +- mult[3] = 1; +- case 14700: +- mult[0] = 1; +- break; +- case 8000: +- mult[3] = 1; +- break; + default: + return -EINVAL; + } +@@ -231,6 +228,18 @@ static int audioinjector_octo_probe(struct platform_device *pdev) + if (IS_ERR(mult_gpios)) + return PTR_ERR(mult_gpios); + ++ codec_rst_gpio = devm_gpiod_get_optional(&pdev->dev, "reset", ++ GPIOD_OUT_LOW); ++ if (IS_ERR(codec_rst_gpio)) ++ return PTR_ERR(codec_rst_gpio); ++ ++ if (codec_rst_gpio) ++ gpiod_set_value(codec_rst_gpio, 0); ++ msleep(5); ++ if (codec_rst_gpio) ++ gpiod_set_value(codec_rst_gpio, 1); ++ msleep(50); ++ + if (i2s_node && codec_node) { + dai->cpu_dai_name = NULL; + dai->cpu_of_node = i2s_node; + +From dc8d7fe750d33056e1a0612b2fb903d02edc461b Mon Sep 17 00:00:00 2001 +From: Peter Malkin +Date: Mon, 27 Mar 2017 16:38:21 -0700 +Subject: [PATCH 211/218] Driver support for Google voiceHAT soundcard. + +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 6 + + .../overlays/googlevoicehat-soundcard-overlay.dts | 49 +++++ + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + sound/soc/bcm/Kconfig | 7 + + sound/soc/bcm/Makefile | 6 + + sound/soc/bcm/googlevoicehat-codec.c | 199 +++++++++++++++++++++ + sound/soc/bcm/googlevoicehat-soundcard.c | 124 +++++++++++++ + 9 files changed, 394 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/googlevoicehat-soundcard-overlay.dts + create mode 100644 sound/soc/bcm/googlevoicehat-codec.c + create mode 100644 sound/soc/bcm/googlevoicehat-soundcard.c + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index 0f7340799fb465ba1fb5aaa1e970cbf6295d75c4..2f1cd17697606687fe47cb4e6a25a572611bf241 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -23,6 +23,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + enc28j60.dtbo \ + enc28j60-spi2.dtbo \ + fe-pi-audio.dtbo \ ++ googlevoicehat-soundcard.dtbo \ + gpio-ir.dtbo \ + gpio-poweroff.dtbo \ + hifiberry-amp.dtbo \ +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index a8853b7820cd7a333cdaa2421f770a834dc724d5..6870e83a2e6acf842259a769d483b0b98c172279 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -414,6 +414,12 @@ Load: dtoverlay=fe-pi-audio + Params: + + ++Name: googlevoicehat-soundcard ++Info: Configures the Google voiceHAT soundcard ++Load: dtoverlay=googlevoicehat-soundcard ++Params: ++ ++ + Name: gpio-ir + Info: Use GPIO pin as rc-core style infrared receiver input. The rc-core- + based gpio_ir_recv driver maps received keys directly to a +diff --git a/arch/arm/boot/dts/overlays/googlevoicehat-soundcard-overlay.dts b/arch/arm/boot/dts/overlays/googlevoicehat-soundcard-overlay.dts +new file mode 100644 +index 0000000000000000000000000000000000000000..9a9e9a0ca28cf774a868b2882ae57b00de1cf7b7 +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/googlevoicehat-soundcard-overlay.dts +@@ -0,0 +1,49 @@ ++// Definitions for Google voiceHAT v1 soundcard overlay ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target = <&i2s>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&gpio>; ++ __overlay__ { ++ googlevoicehat_pins: googlevoicehat_pins { ++ brcm,pins = <16>; ++ brcm,function = <1>; /* out */ ++ brcm,pull = <0>; /* up */ ++ }; ++ }; ++ }; ++ ++ ++ fragment@2 { ++ target-path = "/"; ++ __overlay__ { ++ voicehat-codec { ++ #sound-dai-cells = <0>; ++ compatible = "google,voicehat"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&googlevoicehat_pins>; ++ sdmode-gpios= <&gpio 16 0>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ fragment@3 { ++ target = <&sound>; ++ __overlay__ { ++ compatible = "googlevoicehat,googlevoicehat-soundcard"; ++ i2s-controller = <&i2s>; ++ status = "okay"; ++ }; ++ }; ++}; +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 598b4bf29f30a920b79b6451ded7a56d06033d7d..38c52eb831715ec6c2ce3555c7a4d9e5383e35d5 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -888,6 +888,7 @@ CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m + CONFIG_SND_BCM2708_SOC_IQAUDIO_DIGI=m + CONFIG_SND_BCM2708_SOC_RASPIDAC3=m + CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m ++CONFIG_SND_BCM2708_SOC_GOOGLEVOICEHAT_SOUNDCARD=m + CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m + CONFIG_SND_AUDIOINJECTOR_OCTO_SOUNDCARD=m + CONFIG_SND_DIGIDAC1_SOUNDCARD=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 8d64ce4465f6f276b2d58ed1e2e45fb0d69ef3ad..c46b86dda8ade97cfa5589106e77d75e241147e0 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -881,6 +881,7 @@ CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m + CONFIG_SND_BCM2708_SOC_IQAUDIO_DIGI=m + CONFIG_SND_BCM2708_SOC_RASPIDAC3=m + CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m ++CONFIG_SND_BCM2708_SOC_GOOGLEVOICEHAT_SOUNDCARD=m + CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m + CONFIG_SND_AUDIOINJECTOR_OCTO_SOUNDCARD=m + CONFIG_SND_DIGIDAC1_SOUNDCARD=m +diff --git a/sound/soc/bcm/Kconfig b/sound/soc/bcm/Kconfig +index 58d03b97f53363ed18df8fb10b4b3477a59e4ca3..e4a47fa404d3fe7c8c0713e2512ee3092492e605 100644 +--- a/sound/soc/bcm/Kconfig ++++ b/sound/soc/bcm/Kconfig +@@ -17,6 +17,13 @@ config SND_SOC_CYGNUS + + If you don't know what to do here, say N. + ++config SND_BCM2708_SOC_GOOGLEVOICEHAT_SOUNDCARD ++ tristate "Support for Google voiceHAT soundcard" ++ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S ++ select SND_SOC_VOICEHAT ++ help ++ Say Y or M if you want to add support for voiceHAT soundcard. ++ + config SND_BCM2708_SOC_HIFIBERRY_DAC + tristate "Support for HifiBerry DAC" + depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S +diff --git a/sound/soc/bcm/Makefile b/sound/soc/bcm/Makefile +index d448aa517bf994fc0a41580c91b5d87deec9e1b0..e37457f01b263ba47ad884c7e945d33b001d9c66 100644 +--- a/sound/soc/bcm/Makefile ++++ b/sound/soc/bcm/Makefile +@@ -8,8 +8,12 @@ snd-soc-cygnus-objs := cygnus-pcm.o cygnus-ssp.o + + obj-$(CONFIG_SND_SOC_CYGNUS) += snd-soc-cygnus.o + ++# Google voiceHAT custom codec support ++snd-soc-googlevoicehat-codec-objs := googlevoicehat-codec.o ++ + # BCM2708 Machine Support + snd-soc-adau1977-adc-objs := adau1977-adc.o ++snd-soc-googlevoicehat-soundcard-objs := googlevoicehat-soundcard.o + snd-soc-hifiberry-amp-objs := hifiberry_amp.o + snd-soc-hifiberry-dac-objs := hifiberry_dac.o + snd-soc-hifiberry-dacplus-objs := hifiberry_dacplus.o +@@ -32,6 +36,8 @@ snd-soc-pisound-objs := pisound.o + snd-soc-fe-pi-audio-objs := fe-pi-audio.o + + obj-$(CONFIG_SND_BCM2708_SOC_ADAU1977_ADC) += snd-soc-adau1977-adc.o ++obj-$(CONFIG_SND_BCM2708_SOC_GOOGLEVOICEHAT_SOUNDCARD) += snd-soc-googlevoicehat-soundcard.o ++obj-$(CONFIG_SND_BCM2708_SOC_GOOGLEVOICEHAT_SOUNDCARD) += snd-soc-googlevoicehat-codec.o + obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_AMP) += snd-soc-hifiberry-amp.o + obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DAC) += snd-soc-hifiberry-dac.o + obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DACPLUS) += snd-soc-hifiberry-dacplus.o +diff --git a/sound/soc/bcm/googlevoicehat-codec.c b/sound/soc/bcm/googlevoicehat-codec.c +new file mode 100644 +index 0000000000000000000000000000000000000000..7e31c9c54652cd9bd050028efb82dfc09fd9fced +--- /dev/null ++++ b/sound/soc/bcm/googlevoicehat-codec.c +@@ -0,0 +1,199 @@ ++/* ++ * Driver for the Google voiceHAT audio codec for Raspberry Pi. ++ * ++ * Author: Peter Malkin ++ * Copyright 2016 ++ * ++ * 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. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define ICS43432_RATE_MIN_HZ 7190 /* from data sheet */ ++#define ICS43432_RATE_MAX_HZ 52800 /* from data sheet */ ++#define SDMODE_DELAY_MS \ ++ 5 /* Delay in enabling SDMODE after clock settles to remove pop */ ++ ++struct voicehat_priv { ++ struct delayed_work enable_sdmode_work; ++ struct gpio_desc *sdmode_gpio; ++ unsigned int sdmode_delay; ++}; ++ ++static void voicehat_enable_sdmode_work(struct work_struct *work) { ++ struct voicehat_priv *voicehat = ++ container_of(work, struct voicehat_priv, enable_sdmode_work.work); ++ gpiod_set_value(voicehat->sdmode_gpio, 1); ++} ++ ++static int voicehat_codec_probe(struct snd_soc_codec *codec) { ++ struct voicehat_priv *voicehat = snd_soc_codec_get_drvdata(codec); ++ ++ voicehat->sdmode_gpio = devm_gpiod_get(codec->dev, "sdmode", GPIOD_OUT_LOW); ++ if (IS_ERR(voicehat->sdmode_gpio)) { ++ dev_err(codec->dev, "Unable to allocate GPIO pin\n"); ++ return PTR_ERR(voicehat->sdmode_gpio); ++ } ++ ++ INIT_DELAYED_WORK(&voicehat->enable_sdmode_work, voicehat_enable_sdmode_work); ++ return 0; ++} ++ ++static int voicehat_codec_remove(struct snd_soc_codec *codec) { ++ struct voicehat_priv *voicehat = snd_soc_codec_get_drvdata(codec); ++ ++ cancel_delayed_work_sync(&voicehat->enable_sdmode_work); ++ ++ return 0; ++} ++ ++static const struct snd_soc_dapm_widget voicehat_dapm_widgets[] = { ++ SND_SOC_DAPM_OUTPUT("Speaker"), ++}; ++ ++static const struct snd_soc_dapm_route voicehat_dapm_routes[] = { ++ {"Speaker", NULL, "HiFi Playback"}, ++}; ++ ++static struct snd_soc_codec_driver voicehat_codec_driver = { ++ .probe = voicehat_codec_probe, ++ .remove = voicehat_codec_remove, ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0) ++ .component_driver = { ++#endif ++ .dapm_widgets = voicehat_dapm_widgets, ++ .num_dapm_widgets = ARRAY_SIZE(voicehat_dapm_widgets), ++ .dapm_routes = voicehat_dapm_routes, ++ .num_dapm_routes = ARRAY_SIZE(voicehat_dapm_routes), ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0) ++ }, ++#endif ++}; ++ ++static int voicehat_daiops_trigger(struct snd_pcm_substream *substream, int cmd, ++ struct snd_soc_dai *dai) { ++ struct snd_soc_codec *codec = dai->codec; ++ struct voicehat_priv *voicehat = snd_soc_codec_get_drvdata(codec); ++ ++ if (voicehat->sdmode_delay == 0) return 0; ++ ++ dev_dbg(dai->dev, "CMD %d", cmd); ++ dev_dbg(dai->dev, "Playback Active %d", dai->playback_active); ++ dev_dbg(dai->dev, "Capture Active %d", dai->capture_active); ++ ++ switch (cmd) { ++ case SNDRV_PCM_TRIGGER_START: ++ case SNDRV_PCM_TRIGGER_RESUME: ++ case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: ++ if (dai->playback_active) { ++ dev_info(dai->dev, "Enabling audio amp...\n"); ++ queue_delayed_work(system_power_efficient_wq, ++ &voicehat->enable_sdmode_work, ++ msecs_to_jiffies(voicehat->sdmode_delay)); ++ } ++ break; ++ case SNDRV_PCM_TRIGGER_STOP: ++ case SNDRV_PCM_TRIGGER_SUSPEND: ++ case SNDRV_PCM_TRIGGER_PAUSE_PUSH: ++ if (dai->playback_active) { ++ cancel_delayed_work(&voicehat->enable_sdmode_work); ++ dev_info(dai->dev, "Disabling audio amp...\n"); ++ gpiod_set_value(voicehat->sdmode_gpio, 0); ++ } ++ break; ++ } ++ return 0; ++} ++ ++static const struct snd_soc_dai_ops voicehat_dai_ops = { ++ .trigger = voicehat_daiops_trigger, ++}; ++ ++static struct snd_soc_dai_driver voicehat_dai = { ++ .name = "voicehat-hifi", ++ .capture = {.stream_name = "HiFi Capture", ++ .channels_min = 2, ++ .channels_max = 2, ++ .rates = SNDRV_PCM_RATE_48000, ++ .formats = SNDRV_PCM_FMTBIT_S32_LE}, ++ .playback = {.stream_name = "HiFi Playback", ++ .channels_min = 2, ++ .channels_max = 2, ++ .rates = SNDRV_PCM_RATE_48000, ++ .formats = SNDRV_PCM_FMTBIT_S32_LE}, ++ .ops = &voicehat_dai_ops, ++ .symmetric_rates = 1}; ++ ++#ifdef CONFIG_OF ++static const struct of_device_id voicehat_ids[] = { ++ { ++ .compatible = "google,voicehat", ++ }, ++ {}}; ++MODULE_DEVICE_TABLE(of, voicehat_ids); ++#endif ++ ++static int voicehat_platform_probe(struct platform_device *pdev) { ++ struct voicehat_priv *voicehat; ++ int ret; ++ ++ voicehat = devm_kzalloc(&pdev->dev, sizeof(*voicehat), GFP_KERNEL); ++ if (!voicehat) return -ENOMEM; ++ ++ ret = device_property_read_u32(&pdev->dev, "voicehat_sdmode_delay", ++ &voicehat->sdmode_delay); ++ ++ if (ret) { ++ voicehat->sdmode_delay = SDMODE_DELAY_MS; ++ dev_info(&pdev->dev, ++ "property 'voicehat_sdmode_delay' not found default 5 mS"); ++ } else { ++ dev_info(&pdev->dev, "property 'voicehat_sdmode_delay' found delay= %d mS", ++ voicehat->sdmode_delay); ++ } ++ ++ dev_set_drvdata(&pdev->dev, voicehat); ++ ++ return snd_soc_register_codec(&pdev->dev, &voicehat_codec_driver, &voicehat_dai, 1); ++} ++ ++static int voicehat_platform_remove(struct platform_device *pdev) { ++ snd_soc_unregister_codec(&pdev->dev); ++ return 0; ++} ++ ++static struct platform_driver voicehat_driver = { ++ .driver = ++ { ++ .name = "voicehat-codec", .of_match_table = of_match_ptr(voicehat_ids), ++ }, ++ .probe = voicehat_platform_probe, ++ .remove = voicehat_platform_remove, ++}; ++ ++module_platform_driver(voicehat_driver); ++ ++MODULE_DESCRIPTION("Google voiceHAT Codec driver"); ++MODULE_AUTHOR("Peter Malkin "); ++MODULE_LICENSE("GPL v2"); +diff --git a/sound/soc/bcm/googlevoicehat-soundcard.c b/sound/soc/bcm/googlevoicehat-soundcard.c +new file mode 100644 +index 0000000000000000000000000000000000000000..225854b8e5298b3c3018f59a49404354a831a24e +--- /dev/null ++++ b/sound/soc/bcm/googlevoicehat-soundcard.c +@@ -0,0 +1,124 @@ ++/* ++ * ASoC Driver for Google voiceHAT SoundCard ++ * ++ * Author: Peter Malkin ++ * Copyright 2016 ++ * ++ * 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. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ */ ++ ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++ ++static int snd_rpi_googlevoicehat_soundcard_init(struct snd_soc_pcm_runtime *rtd) ++{ ++ return 0; ++} ++ ++static int snd_rpi_googlevoicehat_soundcard_hw_params( ++ struct snd_pcm_substream *substream, ++ struct snd_pcm_hw_params *params) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_dai *cpu_dai = rtd->cpu_dai; ++ ++ unsigned int sample_bits = ++ snd_pcm_format_physical_width(params_format(params)); ++ ++ return snd_soc_dai_set_bclk_ratio(cpu_dai, sample_bits * 2); ++} ++ ++/* machine stream operations */ ++static struct snd_soc_ops snd_rpi_googlevoicehat_soundcard_ops = { ++ .hw_params = snd_rpi_googlevoicehat_soundcard_hw_params, ++}; ++ ++static struct snd_soc_dai_link snd_rpi_googlevoicehat_soundcard_dai[] = { ++{ ++ .name = "Google voiceHAT SoundCard", ++ .stream_name = "Google voiceHAT SoundCard HiFi", ++ .cpu_dai_name = "bcm2708-i2s.0", ++ .codec_dai_name = "voicehat-hifi", ++ .platform_name = "bcm2708-i2s.0", ++ .codec_name = "voicehat-codec", ++ .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | ++ SND_SOC_DAIFMT_CBS_CFS, ++ .ops = &snd_rpi_googlevoicehat_soundcard_ops, ++ .init = snd_rpi_googlevoicehat_soundcard_init, ++}, ++}; ++ ++/* audio machine driver */ ++static struct snd_soc_card snd_rpi_googlevoicehat_soundcard = { ++ .name = "snd_rpi_googlevoicehat_soundcard", ++ .owner = THIS_MODULE, ++ .dai_link = snd_rpi_googlevoicehat_soundcard_dai, ++ .num_links = ARRAY_SIZE(snd_rpi_googlevoicehat_soundcard_dai), ++}; ++ ++static int snd_rpi_googlevoicehat_soundcard_probe(struct platform_device *pdev) ++{ ++ int ret = 0; ++ ++ snd_rpi_googlevoicehat_soundcard.dev = &pdev->dev; ++ ++ if (pdev->dev.of_node) { ++ struct device_node *i2s_node; ++ struct snd_soc_dai_link *dai = &snd_rpi_googlevoicehat_soundcard_dai[0]; ++ i2s_node = of_parse_phandle(pdev->dev.of_node, ++ "i2s-controller", 0); ++ ++ if (i2s_node) { ++ dai->cpu_dai_name = NULL; ++ dai->cpu_of_node = i2s_node; ++ dai->platform_name = NULL; ++ dai->platform_of_node = i2s_node; ++ } ++ } ++ ++ ret = snd_soc_register_card(&snd_rpi_googlevoicehat_soundcard); ++ if (ret) ++ dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", ret); ++ ++ return ret; ++} ++ ++static int snd_rpi_googlevoicehat_soundcard_remove(struct platform_device *pdev) ++{ ++ return snd_soc_unregister_card(&snd_rpi_googlevoicehat_soundcard); ++} ++ ++static const struct of_device_id snd_rpi_googlevoicehat_soundcard_of_match[] = { ++ { .compatible = "googlevoicehat,googlevoicehat-soundcard", }, ++ {}, ++}; ++MODULE_DEVICE_TABLE(of, snd_rpi_googlevoicehat_soundcard_of_match); ++ ++static struct platform_driver snd_rpi_googlevoicehat_soundcard_driver = { ++ .driver = { ++ .name = "snd-googlevoicehat-soundcard", ++ .owner = THIS_MODULE, ++ .of_match_table = snd_rpi_googlevoicehat_soundcard_of_match, ++ }, ++ .probe = snd_rpi_googlevoicehat_soundcard_probe, ++ .remove = snd_rpi_googlevoicehat_soundcard_remove, ++}; ++ ++module_platform_driver(snd_rpi_googlevoicehat_soundcard_driver); ++ ++MODULE_AUTHOR("Peter Malkin "); ++MODULE_DESCRIPTION("ASoC Driver for Google voiceHAT SoundCard"); ++MODULE_LICENSE("GPL v2"); + +From a2df1bd37f752dbe06a36c437b24e4719614c26a Mon Sep 17 00:00:00 2001 +From: Raashid Muhammed +Date: Mon, 27 Mar 2017 12:35:00 +0530 +Subject: [PATCH 212/218] Add support for Allo Piano DAC 2.1 plus add-on board + for Raspberry Pi. + +The Piano DAC 2.1 has support for 4 channels with subwoofer. + +Signed-off-by: Baswaraj K +Reviewed-by: Vijay Kumar B. +Reviewed-by: Raashid Muhammed +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 18 + + .../allo-piano-dac-plus-pcm512x-audio-overlay.dts | 51 +++ + sound/soc/bcm/Kconfig | 7 + + sound/soc/bcm/Makefile | 2 + + sound/soc/bcm/allo-piano-dac-plus.c | 467 +++++++++++++++++++++ + 6 files changed, 546 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/allo-piano-dac-plus-pcm512x-audio-overlay.dts + create mode 100644 sound/soc/bcm/allo-piano-dac-plus.c + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index 2f1cd17697606687fe47cb4e6a25a572611bf241..73826c74d2cfb58cac1a72e523ce00b021411d16 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -8,6 +8,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + ads7846.dtbo \ + akkordion-iqdacplus.dtbo \ + allo-piano-dac-pcm512x-audio.dtbo \ ++ allo-piano-dac-plus-pcm512x-audio.dtbo \ + at86rf233.dtbo \ + audioinjector-addons.dtbo \ + audioinjector-wm8731-audio.dtbo \ +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 6870e83a2e6acf842259a769d483b0b98c172279..1e3420e80d620f3c376ffb7c905e7aba7f63d709 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -283,6 +283,24 @@ Params: 24db_digital_gain Allow gain to be applied via the PCM512x codec + that does not result in clipping/distortion!) + + ++Name: allo-piano-dac-plus-pcm512x-audio ++Info: Configures the Allo Piano DAC (2.1) audio cards. ++Load: dtoverlay=allo-piano-dac-plus-pcm512x-audio, ++Params: 24db_digital_gain Allow gain to be applied via the PCM512x codec ++ Digital volume control. ++ (The default behaviour is that the Digital ++ volume control is limited to a maximum of ++ 0dB. ie. it can attenuate but not provide ++ gain. For most users, this will be desired ++ as it will prevent clipping. By appending ++ the 24db_digital_gain parameter, the Digital ++ volume control will allow up to 24dB of ++ gain. If this parameter is enabled, it is the ++ responsibility of the user to ensure that ++ the Digital volume control is set to a value ++ that does not result in clipping/distortion!) ++ ++ + Name: at86rf233 + Info: Configures the Atmel AT86RF233 802.15.4 low-power WPAN transceiver, + connected to spi0.0 +diff --git a/arch/arm/boot/dts/overlays/allo-piano-dac-plus-pcm512x-audio-overlay.dts b/arch/arm/boot/dts/overlays/allo-piano-dac-plus-pcm512x-audio-overlay.dts +new file mode 100644 +index 0000000000000000000000000000000000000000..6943b55ca5f96097668e2d10c05f56a26be62b0a +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/allo-piano-dac-plus-pcm512x-audio-overlay.dts +@@ -0,0 +1,51 @@ ++// Definitions for Piano DAC ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target = <&i2s>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&i2c1>; ++ __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ pcm5122_4c: pcm5122@4c { ++ #sound-dai-cells = <0>; ++ compatible = "ti,pcm5122"; ++ reg = <0x4c>; ++ status = "okay"; ++ }; ++ pcm5122_4d: pcm5122@4d { ++ #sound-dai-cells = <0>; ++ compatible = "ti,pcm5122"; ++ reg = <0x4d>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&sound>; ++ piano_dac: __overlay__ { ++ compatible = "allo,piano-dac-plus"; ++ audio-codec = <&pcm5122_4c &pcm5122_4d>; ++ i2s-controller = <&i2s>; ++ status = "okay"; ++ }; ++ }; ++ ++ __overrides__ { ++ 24db_digital_gain = ++ <&piano_dac>,"piano,24db_digital_gain?"; ++ }; ++}; +diff --git a/sound/soc/bcm/Kconfig b/sound/soc/bcm/Kconfig +index e4a47fa404d3fe7c8c0713e2512ee3092492e605..4c647abe7504546dbd1d1566f2440cd6ceb12785 100644 +--- a/sound/soc/bcm/Kconfig ++++ b/sound/soc/bcm/Kconfig +@@ -161,6 +161,13 @@ config SND_BCM2708_SOC_ALLO_PIANO_DAC + help + Say Y or M if you want to add support for Allo Piano DAC. + ++config SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS ++ tristate "Support for Allo Piano DAC Plus" ++ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S ++ select SND_SOC_PCM512x_I2C ++ help ++ Say Y or M if you want to add support for Allo Piano DAC Plus. ++ + config SND_BCM2708_SOC_FE_PI_AUDIO + tristate "Support for Fe-Pi-Audio" + depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S +diff --git a/sound/soc/bcm/Makefile b/sound/soc/bcm/Makefile +index e37457f01b263ba47ad884c7e945d33b001d9c66..54b4111ad820b3f8086867ca2ce86d5339fca93e 100644 +--- a/sound/soc/bcm/Makefile ++++ b/sound/soc/bcm/Makefile +@@ -32,6 +32,7 @@ snd-soc-digidac1-soundcard-objs := digidac1-soundcard.o + snd-soc-dionaudio-loco-objs := dionaudio_loco.o + snd-soc-dionaudio-loco-v2-objs := dionaudio_loco-v2.o + snd-soc-allo-piano-dac-objs := allo-piano-dac.o ++snd-soc-allo-piano-dac-plus-objs := allo-piano-dac-plus.o + snd-soc-pisound-objs := pisound.o + snd-soc-fe-pi-audio-objs := fe-pi-audio.o + +@@ -56,5 +57,6 @@ obj-$(CONFIG_SND_DIGIDAC1_SOUNDCARD) += snd-soc-digidac1-soundcard.o + obj-$(CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO) += snd-soc-dionaudio-loco.o + obj-$(CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO_V2) += snd-soc-dionaudio-loco-v2.o + obj-$(CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC) += snd-soc-allo-piano-dac.o ++obj-$(CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS) += snd-soc-allo-piano-dac-plus.o + obj-$(CONFIG_SND_PISOUND) += snd-soc-pisound.o + obj-$(CONFIG_SND_BCM2708_SOC_FE_PI_AUDIO) += snd-soc-fe-pi-audio.o +diff --git a/sound/soc/bcm/allo-piano-dac-plus.c b/sound/soc/bcm/allo-piano-dac-plus.c +new file mode 100644 +index 0000000000000000000000000000000000000000..f66f42abadbd5f9d3fe000676e8297ed91630e47 +--- /dev/null ++++ b/sound/soc/bcm/allo-piano-dac-plus.c +@@ -0,0 +1,467 @@ ++/* ++ * ALSA ASoC Machine Driver for Allo Piano DAC Plus Subwoofer ++ * ++ * Author: Baswaraj K ++ * Copyright 2016 ++ * based on code by Daniel Matuschek ++ * based on code by Florian Meier ++ * ++ * 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. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ */ ++ ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "../codecs/pcm512x.h" ++ ++struct dsp_code { ++ char i2c_addr; ++ char offset; ++ char val; ++}; ++ ++static struct snd_soc_pcm_runtime *rtd_glb; ++static bool digital_gain_0db_limit = true; ++unsigned int set_lowpass, set_mode, set_rate, dsp_page_number; ++ ++static const char * const allo_piano_mode_texts[] = { ++ "2.0", ++ "2.1", ++ "2.2", ++}; ++ ++static const SOC_ENUM_SINGLE_DECL(allo_piano_mode_enum, ++ 0, 0, allo_piano_mode_texts); ++ ++static const char * const allo_piano_dsp_low_pass_texts[] = { ++ "60", ++ "70", ++ "80", ++ "90", ++ "100", ++ "110", ++ "120", ++ "130", ++ "140", ++ "150", ++ "160", ++ "170", ++ "180", ++ "190", ++ "200", ++}; ++ ++static const SOC_ENUM_SINGLE_DECL(allo_piano_enum, ++ 0, 0, allo_piano_dsp_low_pass_texts); ++ ++static int snd_allo_piano_dsp_program(struct snd_soc_pcm_runtime *rtd, ++ unsigned int mode, unsigned int rate, unsigned int lowpass) ++{ ++ const struct firmware *fw; ++ char firmware_name[40]; ++ int ret = 0, dac = 0; ++ ++ if (rate <= 46000) ++ rate = 44100; ++ else if (rate <= 68000) ++ rate = 48000; ++ else if (rate <= 92000) ++ rate = 88200; ++ else if (rate <= 136000) ++ rate = 96000; ++ else if (rate <= 184000) ++ rate = 176400; ++ else ++ rate = 192000; ++ ++ /* same configuration loaded */ ++ if ((rate == set_rate) && (lowpass == set_lowpass) ++ && (mode == set_mode)) ++ return 1; ++ ++ set_rate = rate; ++ set_mode = mode; ++ ++ if (mode == 0) { /* 2.0 */ ++ snd_soc_write(rtd->codec_dais[1]->codec, ++ PCM512x_MUTE, 0x11); ++ return 1; ++ } else { ++ snd_soc_write(rtd->codec_dais[1]->codec, ++ PCM512x_MUTE, 0x00); ++ } ++ ++ set_lowpass = lowpass; ++ ++ for (dac = 0; dac < rtd->num_codecs; dac++) { ++ struct dsp_code *dsp_code_read; ++ int i = 1; ++ struct snd_soc_codec *codec = rtd->codec_dais[dac]->codec; ++ ++ if (dac == 0) { /* high */ ++ sprintf(firmware_name, ++ "alloPiano/2.2/allo-piano-dsp-%d-%d-%d.bin", ++ rate, ((set_lowpass * 10) + 60), dac); ++ } else { /* low */ ++ sprintf(firmware_name, ++ "alloPiano/2.%d/allo-piano-dsp-%d-%d-%d.bin", ++ set_mode, rate, ((set_lowpass * 10) + 60), dac); ++ } ++ ++ dev_info(codec->dev, "Dsp Firmware File Name: %s\n", ++ firmware_name); ++ ++ ret = request_firmware(&fw, firmware_name, codec->dev); ++ if (ret < 0) { ++ dev_err(codec->dev, "Error: AlloPiano Firmware %s missing. %d\n", ++ firmware_name, ret); ++ goto err; ++ } ++ ++ while (i < (fw->size - 1)) { ++ dsp_code_read = (struct dsp_code *)&fw->data[i]; ++ ++ if (dsp_code_read->offset == 0) { ++ dsp_page_number = dsp_code_read->val; ++ ret = snd_soc_write(rtd->codec_dais[dac]->codec, ++ PCM512x_PAGE_BASE(0), ++ dsp_code_read->val); ++ ++ } else if (dsp_code_read->offset != 0) { ++ ret = snd_soc_write(rtd->codec_dais[dac]->codec, ++ (PCM512x_PAGE_BASE(dsp_page_number) + ++ dsp_code_read->offset), ++ dsp_code_read->val); ++ ++ } ++ if (ret < 0) { ++ dev_err(codec->dev, ++ "Failed to write Register: %d\n", ret); ++ goto err; ++ } ++ i = i + 3; ++ } ++ release_firmware(fw); ++ } ++ return 1; ++ ++err: ++ release_firmware(fw); ++ return ret; ++} ++ ++static int snd_allo_piano_mode_get(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ ucontrol->value.integer.value[0] = set_mode; ++ return 0; ++} ++ ++static int snd_allo_piano_mode_put(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ return(snd_allo_piano_dsp_program(rtd_glb, ++ ucontrol->value.integer.value[0], ++ set_rate, set_lowpass)); ++} ++ ++static int snd_allo_piano_lowpass_get(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ ucontrol->value.integer.value[0] = set_lowpass; ++ return 0; ++} ++ ++static int snd_allo_piano_lowpass_put(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ return(snd_allo_piano_dsp_program(rtd_glb, ++ set_mode, set_rate, ++ ucontrol->value.integer.value[0])); ++} ++ ++static int pcm512x_get_reg_sub(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ struct soc_mixer_control *mc = ++ (struct soc_mixer_control *)kcontrol->private_value; ++ unsigned int left_val = 0; ++ unsigned int right_val = 0; ++ ++ left_val = snd_soc_read(rtd_glb->codec_dais[1]->codec, ++ PCM512x_DIGITAL_VOLUME_2); ++ if (left_val < 0) ++ return left_val; ++ ++ right_val = snd_soc_read(rtd_glb->codec_dais[1]->codec, ++ PCM512x_DIGITAL_VOLUME_3); ++ if (right_val < 0) ++ return right_val; ++ ++ ucontrol->value.integer.value[0] = ++ (~(left_val >> mc->shift)) & mc->max; ++ ucontrol->value.integer.value[1] = ++ (~(right_val >> mc->shift)) & mc->max; ++ ++ return 0; ++} ++ ++static int pcm512x_set_reg_sub(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ struct soc_mixer_control *mc = ++ (struct soc_mixer_control *)kcontrol->private_value; ++ unsigned int left_val = (ucontrol->value.integer.value[0] & mc->max); ++ unsigned int right_val = (ucontrol->value.integer.value[1] & mc->max); ++ int ret = 0; ++ ++ ret = snd_soc_write(rtd_glb->codec_dais[1]->codec, ++ PCM512x_DIGITAL_VOLUME_2, (~left_val)); ++ if (ret < 0) ++ return ret; ++ ++ ret = snd_soc_write(rtd_glb->codec_dais[1]->codec, ++ PCM512x_DIGITAL_VOLUME_3, (~right_val)); ++ if (ret < 0) ++ return ret; ++ ++ return 1; ++} ++ ++static int pcm512x_get_reg_sub_switch(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ int val = 0; ++ ++ val = snd_soc_read(rtd_glb->codec_dais[1]->codec, PCM512x_MUTE); ++ if (val < 0) ++ return val; ++ ++ ucontrol->value.integer.value[0] = (val & 0x10) ? 0 : 1; ++ ucontrol->value.integer.value[1] = (val & 0x01) ? 0 : 1; ++ ++ return val; ++} ++ ++static int pcm512x_set_reg_sub_switch(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ unsigned int left_val = (ucontrol->value.integer.value[0]); ++ unsigned int right_val = (ucontrol->value.integer.value[1]); ++ int ret = 0; ++ ++ ret = snd_soc_write(rtd_glb->codec_dais[1]->codec, PCM512x_MUTE, ++ ~((left_val & 0x01)<<4 | (right_val & 0x01))); ++ if (ret < 0) ++ return ret; ++ ++ return 1; ++ ++} ++ ++static const DECLARE_TLV_DB_SCALE(digital_tlv_sub, -10350, 50, 1); ++ ++static const struct snd_kcontrol_new allo_piano_controls[] = { ++ SOC_ENUM_EXT("Subwoofer mode", ++ allo_piano_mode_enum, ++ snd_allo_piano_mode_get, ++ snd_allo_piano_mode_put), ++ ++ SOC_ENUM_EXT("Lowpass", allo_piano_enum, ++ snd_allo_piano_lowpass_get, ++ snd_allo_piano_lowpass_put), ++ ++ SOC_DOUBLE_R_EXT_TLV("Subwoofer Digital Playback Volume", ++ PCM512x_DIGITAL_VOLUME_2, ++ PCM512x_DIGITAL_VOLUME_3, 0, 255, 1, ++ pcm512x_get_reg_sub, ++ pcm512x_set_reg_sub, ++ digital_tlv_sub), ++ ++ SOC_DOUBLE_EXT("Subwoofer Digital Playback Switch", ++ PCM512x_MUTE, ++ PCM512x_RQML_SHIFT, ++ PCM512x_RQMR_SHIFT, 1, 1, ++ pcm512x_get_reg_sub_switch, ++ pcm512x_set_reg_sub_switch), ++}; ++ ++static int snd_allo_piano_dac_init(struct snd_soc_pcm_runtime *rtd) ++{ ++ rtd_glb = rtd; ++ ++ if (digital_gain_0db_limit) { ++ int ret; ++ struct snd_soc_card *card = rtd->card; ++ ++ ret = snd_soc_limit_volume(card, "Digital Playback Volume", ++ 207); ++ if (ret < 0) ++ dev_warn(card->dev, "Failed to set volume limit: %d\n", ++ ret); ++ } ++ ++ return 0; ++} ++ ++static int snd_allo_piano_dac_hw_params(struct snd_pcm_substream *substream, ++ struct snd_pcm_hw_params *params) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_dai *cpu_dai = rtd->cpu_dai; ++ unsigned int sample_bits = ++ snd_pcm_format_physical_width(params_format(params)); ++ unsigned int rate = params_rate(params); ++ struct snd_soc_card *card = rtd->card; ++ int ret = 0; ++ ++ rtd_glb = rtd; /* TODO */ ++ if (digital_gain_0db_limit) { ++ ret = snd_soc_limit_volume(card, ++ "Subwoofer Digital Playback Volume", 207); ++ if (ret < 0) ++ dev_warn(card->dev, "Failed to set volume limit: %d\n", ++ ret); ++ } ++ ret = snd_allo_piano_dsp_program(rtd, set_mode, rate, set_lowpass); ++ if (ret < 0) ++ return ret; ++ ++ ret = snd_soc_dai_set_bclk_ratio(cpu_dai, sample_bits * 2); ++ ++ return ret; ++} ++ ++/* machine stream operations */ ++static struct snd_soc_ops snd_allo_piano_dac_ops = { ++ .hw_params = snd_allo_piano_dac_hw_params, ++}; ++ ++static struct snd_soc_dai_link_component allo_piano_2_1_codecs[] = { ++ { ++ .dai_name = "pcm512x-hifi", ++ }, ++ { ++ .dai_name = "pcm512x-hifi", ++ }, ++}; ++ ++static struct snd_soc_dai_link snd_allo_piano_dac_dai[] = { ++ { ++ .name = "PianoDACPlus", ++ .stream_name = "PianoDACPlus", ++ .cpu_dai_name = "bcm2708-i2s.0", ++ .platform_name = "bcm2708-i2s.0", ++ .codecs = allo_piano_2_1_codecs, ++ .num_codecs = 2, ++ .dai_fmt = SND_SOC_DAIFMT_I2S | ++ SND_SOC_DAIFMT_NB_NF | ++ SND_SOC_DAIFMT_CBS_CFS, ++ .ops = &snd_allo_piano_dac_ops, ++ .init = snd_allo_piano_dac_init, ++ }, ++}; ++ ++/* audio machine driver */ ++static struct snd_soc_card snd_allo_piano_dac = { ++ .name = "PianoDACPlus", ++ .owner = THIS_MODULE, ++ .dai_link = snd_allo_piano_dac_dai, ++ .num_links = ARRAY_SIZE(snd_allo_piano_dac_dai), ++ .controls = allo_piano_controls, ++ .num_controls = ARRAY_SIZE(allo_piano_controls), ++}; ++ ++static int snd_allo_piano_dac_probe(struct platform_device *pdev) ++{ ++ int ret = 0, i = 0; ++ struct snd_soc_card *card = &snd_allo_piano_dac; ++ ++ card->dev = &pdev->dev; ++ snd_allo_piano_dac.dev = &pdev->dev; ++ ++ if (pdev->dev.of_node) { ++ struct device_node *i2s_node; ++ struct snd_soc_dai_link *dai; ++ ++ dai = &snd_allo_piano_dac_dai[0]; ++ i2s_node = of_parse_phandle(pdev->dev.of_node, ++ "i2s-controller", 0); ++ if (i2s_node) { ++ for (i = 0; i < card->num_links; i++) { ++ dai->cpu_dai_name = NULL; ++ dai->cpu_of_node = i2s_node; ++ dai->platform_name = NULL; ++ dai->platform_of_node = i2s_node; ++ } ++ } ++ digital_gain_0db_limit = ++ !of_property_read_bool(pdev->dev.of_node, ++ "allo,24db_digital_gain"); ++ ++ allo_piano_2_1_codecs[0].of_node = ++ of_parse_phandle(pdev->dev.of_node, "audio-codec", 0); ++ if (!allo_piano_2_1_codecs[0].of_node) { ++ dev_err(&pdev->dev, ++ "Property 'audio-codec' missing or invalid\n"); ++ return -EINVAL; ++ } ++ ++ allo_piano_2_1_codecs[1].of_node = ++ of_parse_phandle(pdev->dev.of_node, "audio-codec", 1); ++ if (!allo_piano_2_1_codecs[1].of_node) { ++ dev_err(&pdev->dev, ++ "Property 'audio-codec' missing or invalid\n"); ++ return -EINVAL; ++ } ++ } ++ ++ ret = snd_soc_register_card(&snd_allo_piano_dac); ++ if (ret < 0) ++ dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", ++ ret); ++ ++ return ret; ++} ++ ++static int snd_allo_piano_dac_remove(struct platform_device *pdev) ++{ ++ return snd_soc_unregister_card(&snd_allo_piano_dac); ++} ++ ++static const struct of_device_id snd_allo_piano_dac_of_match[] = { ++ { .compatible = "allo,piano-dac-plus", }, ++ { /* sentinel */ }, ++}; ++ ++MODULE_DEVICE_TABLE(of, snd_allo_piano_dac_of_match); ++ ++static struct platform_driver snd_allo_piano_dac_driver = { ++ .driver = { ++ .name = "snd-allo-piano-dac-plus", ++ .owner = THIS_MODULE, ++ .of_match_table = snd_allo_piano_dac_of_match, ++ }, ++ .probe = snd_allo_piano_dac_probe, ++ .remove = snd_allo_piano_dac_remove, ++}; ++ ++module_platform_driver(snd_allo_piano_dac_driver); ++ ++MODULE_AUTHOR("Baswaraj K "); ++MODULE_DESCRIPTION("ALSA ASoC Machine Driver for Allo Piano DAC Plus"); ++MODULE_LICENSE("GPL v2"); + +From 29ab0b844215f7f86b75bc05ba73add0caa422bb Mon Sep 17 00:00:00 2001 +From: BabuSubashChandar +Date: Tue, 28 Mar 2017 20:04:42 +0530 +Subject: [PATCH 213/218] Add support for Allo Boss DAC add-on board for + Raspberry Pi. (#1924) + +Signed-off-by: Baswaraj K +Reviewed-by: Deepak +Reviewed-by: BabuSubashChandar +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 24 ++ + .../allo-boss-dac-pcm512x-audio-overlay.dts | 58 ++++ + drivers/clk/Makefile | 1 + + drivers/clk/clk-allo-dac-45Mhz.c | 161 +++++++++ + sound/soc/bcm/Kconfig | 8 + + sound/soc/bcm/Makefile | 2 + + sound/soc/bcm/allo-boss-dac.c | 374 +++++++++++++++++++++ + 8 files changed, 629 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/allo-boss-dac-pcm512x-audio-overlay.dts + create mode 100644 drivers/clk/clk-allo-dac-45Mhz.c + create mode 100644 sound/soc/bcm/allo-boss-dac.c + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index 73826c74d2cfb58cac1a72e523ce00b021411d16..b64dd7ac0630b2b525809a9f5221420f34a58ac9 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -7,6 +7,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + ads1115.dtbo \ + ads7846.dtbo \ + akkordion-iqdacplus.dtbo \ ++ allo-boss-dac-pcm512x-audio.dtbo \ + allo-piano-dac-pcm512x-audio.dtbo \ + allo-piano-dac-plus-pcm512x-audio.dtbo \ + at86rf233.dtbo \ +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 1e3420e80d620f3c376ffb7c905e7aba7f63d709..c9e954253a6318dbd2605b93026c04974b3271bd 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -263,6 +263,30 @@ Params: 24db_digital_gain Allow gain to be applied via the PCM512x codec + that does not result in clipping/distortion!) + + ++Name: allo-boss-dac-pcm512x-audio ++Info: Configures the Allo Boss DAC audio cards. ++Load: dtoverlay=allo-boss-dac-pcm512x-audio, ++Params: 24db_digital_gain Allow gain to be applied via the PCM512x codec ++ Digital volume control. Enable with ++ "dtoverlay=allo-boss-dac-pcm512x-audio, ++ 24db_digital_gain" ++ (The default behaviour is that the Digital ++ volume control is limited to a maximum of ++ 0dB. ie. it can attenuate but not provide ++ gain. For most users, this will be desired ++ as it will prevent clipping. By appending ++ the 24db_digital_gain parameter, the Digital ++ volume control will allow up to 24dB of ++ gain. If this parameter is enabled, it is the ++ responsibility of the user to ensure that ++ the Digital volume control is set to a value ++ that does not result in clipping/distortion!) ++ slave Force Boss DAC into slave mode, using Pi a ++ master for bit clock and frame clock. Enable ++ with "dtoverlay=allo-boss-dac-pcm512x-audio, ++ slave" ++ ++ + Name: allo-piano-dac-pcm512x-audio + Info: Configures the Allo Piano DAC (2.0/2.1) audio cards. + (NB. This initial support is for 2.0 channel audio ONLY! ie. stereo. +diff --git a/arch/arm/boot/dts/overlays/allo-boss-dac-pcm512x-audio-overlay.dts b/arch/arm/boot/dts/overlays/allo-boss-dac-pcm512x-audio-overlay.dts +new file mode 100644 +index 0000000000000000000000000000000000000000..7df335a3d82f7043d31ba69331cdf3185264d78c +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/allo-boss-dac-pcm512x-audio-overlay.dts +@@ -0,0 +1,58 @@ ++/* ++ * Definitions for Allo Boss DAC board ++ */ ++ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target-path = "/clocks"; ++ __overlay__ { ++ boss_osc: boss_osc { ++ compatible = "allo,dac-clk"; ++ #clock-cells = <0>; ++ }; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&i2s>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&i2c1>; ++ __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ pcm5122@4d { ++ #sound-dai-cells = <0>; ++ compatible = "ti,pcm5122"; ++ clocks = <&boss_osc>; ++ reg = <0x4d>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ fragment@3 { ++ target = <&sound>; ++ boss_dac: __overlay__ { ++ compatible = "allo,boss-dac"; ++ i2s-controller = <&i2s>; ++ status = "okay"; ++ }; ++ }; ++ ++ __overrides__ { ++ 24db_digital_gain = <&boss_dac>,"allo,24db_digital_gain?"; ++ slave = <&boss_dac>,"allo,slave?"; ++ }; ++}; +diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile +index 2b6fcd8abf79da77aa85fdc53512aafd09f836cb..b1b3cf5d3a09fe8bd38dfed880dd7e6ac0ccc3d7 100644 +--- a/drivers/clk/Makefile ++++ b/drivers/clk/Makefile +@@ -17,6 +17,7 @@ endif + + # hardware specific clock types + # please keep this section sorted lexicographically by file path name ++obj-$(CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC) += clk-allo-dac-45Mhz.o + obj-$(CONFIG_MACH_ASM9260) += clk-asm9260.o + obj-$(CONFIG_COMMON_CLK_AXI_CLKGEN) += clk-axi-clkgen.o + obj-$(CONFIG_ARCH_AXXIA) += clk-axm5516.o +diff --git a/drivers/clk/clk-allo-dac-45Mhz.c b/drivers/clk/clk-allo-dac-45Mhz.c +new file mode 100644 +index 0000000000000000000000000000000000000000..d5e9e5b3495cfd2e94fae256f11bc6e0d1f470c6 +--- /dev/null ++++ b/drivers/clk/clk-allo-dac-45Mhz.c +@@ -0,0 +1,161 @@ ++/* ++ * Clock Driver for Allo DAC ++ * ++ * Author: Baswaraj K ++ * Copyright 2016 ++ * based on code by Stuart MacLean ++ * ++ * 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. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/* Clock rate of CLK44EN attached to GPIO6 pin */ ++#define CLK_44EN_RATE 45158400UL ++/* Clock rate of CLK48EN attached to GPIO3 pin */ ++#define CLK_48EN_RATE 49152000UL ++ ++/** ++ * struct allo_dac_clk - Common struct to the Allo DAC ++ * @hw: clk_hw for the common clk framework ++ * @mode: 0 => CLK44EN, 1 => CLK48EN ++ */ ++struct clk_allo_hw { ++ struct clk_hw hw; ++ uint8_t mode; ++}; ++ ++#define to_allo_clk(_hw) container_of(_hw, struct clk_allo_hw, hw) ++ ++static const struct of_device_id clk_allo_dac_dt_ids[] = { ++ { .compatible = "allo,dac-clk",}, ++ { } ++}; ++MODULE_DEVICE_TABLE(of, clk_allo_dac_dt_ids); ++ ++static unsigned long clk_allo_dac_recalc_rate(struct clk_hw *hw, ++ unsigned long parent_rate) ++{ ++ return (to_allo_clk(hw)->mode == 0) ? CLK_44EN_RATE : ++ CLK_48EN_RATE; ++} ++ ++static long clk_allo_dac_round_rate(struct clk_hw *hw, ++ unsigned long rate, unsigned long *parent_rate) ++{ ++ long actual_rate; ++ ++ if (rate <= CLK_44EN_RATE) { ++ actual_rate = (long)CLK_44EN_RATE; ++ } else if (rate >= CLK_48EN_RATE) { ++ actual_rate = (long)CLK_48EN_RATE; ++ } else { ++ long diff44Rate = (long)(rate - CLK_44EN_RATE); ++ long diff48Rate = (long)(CLK_48EN_RATE - rate); ++ ++ if (diff44Rate < diff48Rate) ++ actual_rate = (long)CLK_44EN_RATE; ++ else ++ actual_rate = (long)CLK_48EN_RATE; ++ } ++ return actual_rate; ++} ++ ++ ++static int clk_allo_dac_set_rate(struct clk_hw *hw, ++ unsigned long rate, unsigned long parent_rate) ++{ ++ unsigned long actual_rate; ++ struct clk_allo_hw *clk = to_allo_clk(hw); ++ ++ actual_rate = (unsigned long)clk_allo_dac_round_rate(hw, rate, ++ &parent_rate); ++ clk->mode = (actual_rate == CLK_44EN_RATE) ? 0 : 1; ++ return 0; ++} ++ ++ ++const struct clk_ops clk_allo_dac_rate_ops = { ++ .recalc_rate = clk_allo_dac_recalc_rate, ++ .round_rate = clk_allo_dac_round_rate, ++ .set_rate = clk_allo_dac_set_rate, ++}; ++ ++static int clk_allo_dac_probe(struct platform_device *pdev) ++{ ++ int ret; ++ struct clk_allo_hw *proclk; ++ struct clk *clk; ++ struct device *dev; ++ struct clk_init_data init; ++ ++ dev = &pdev->dev; ++ ++ proclk = kzalloc(sizeof(struct clk_allo_hw), GFP_KERNEL); ++ if (!proclk) ++ return -ENOMEM; ++ ++ init.name = "clk-allo-dac"; ++ init.ops = &clk_allo_dac_rate_ops; ++ init.flags = CLK_IS_ROOT | CLK_IS_BASIC; ++ init.parent_names = NULL; ++ init.num_parents = 0; ++ ++ proclk->mode = 0; ++ proclk->hw.init = &init; ++ ++ clk = devm_clk_register(dev, &proclk->hw); ++ if (!IS_ERR(clk)) { ++ ret = of_clk_add_provider(dev->of_node, of_clk_src_simple_get, ++ clk); ++ } else { ++ dev_err(dev, "Fail to register clock driver\n"); ++ kfree(proclk); ++ ret = PTR_ERR(clk); ++ } ++ return ret; ++} ++ ++static int clk_allo_dac_remove(struct platform_device *pdev) ++{ ++ of_clk_del_provider(pdev->dev.of_node); ++ return 0; ++} ++ ++static struct platform_driver clk_allo_dac_driver = { ++ .probe = clk_allo_dac_probe, ++ .remove = clk_allo_dac_remove, ++ .driver = { ++ .name = "clk-allo-dac", ++ .of_match_table = clk_allo_dac_dt_ids, ++ }, ++}; ++ ++static int __init clk_allo_dac_init(void) ++{ ++ return platform_driver_register(&clk_allo_dac_driver); ++} ++core_initcall(clk_allo_dac_init); ++ ++static void __exit clk_allo_dac_exit(void) ++{ ++ platform_driver_unregister(&clk_allo_dac_driver); ++} ++module_exit(clk_allo_dac_exit); ++ ++MODULE_DESCRIPTION("Allo DAC clock driver"); ++MODULE_LICENSE("GPL v2"); ++MODULE_ALIAS("platform:clk-allo-dac"); +diff --git a/sound/soc/bcm/Kconfig b/sound/soc/bcm/Kconfig +index 4c647abe7504546dbd1d1566f2440cd6ceb12785..76cb7626d7651b144fb268c46f2099b4981a330e 100644 +--- a/sound/soc/bcm/Kconfig ++++ b/sound/soc/bcm/Kconfig +@@ -175,6 +175,14 @@ config SND_BCM2708_SOC_FE_PI_AUDIO + help + Say Y or M if you want to add support for Fe-Pi-Audio. + ++config SND_BCM2708_SOC_ALLO_BOSS_DAC ++ tristate "Support for allo Boss DAC" ++ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S ++ select SND_SOC_PCM512x_I2C ++ help ++ Say Y or M if you want to add support for allo Boss DAC. ++ ++ + config SND_PISOUND + tristate "Support for Blokas Labs pisound" + depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S +diff --git a/sound/soc/bcm/Makefile b/sound/soc/bcm/Makefile +index 54b4111ad820b3f8086867ca2ce86d5339fca93e..72e1620fa4038035804cf3b2a09c6b12e7ae0fe1 100644 +--- a/sound/soc/bcm/Makefile ++++ b/sound/soc/bcm/Makefile +@@ -31,6 +31,7 @@ snd-soc-audioinjector-octo-soundcard-objs := audioinjector-octo-soundcard.o + snd-soc-digidac1-soundcard-objs := digidac1-soundcard.o + snd-soc-dionaudio-loco-objs := dionaudio_loco.o + snd-soc-dionaudio-loco-v2-objs := dionaudio_loco-v2.o ++snd-soc-allo-boss-dac-objs := allo-boss-dac.o + snd-soc-allo-piano-dac-objs := allo-piano-dac.o + snd-soc-allo-piano-dac-plus-objs := allo-piano-dac-plus.o + snd-soc-pisound-objs := pisound.o +@@ -56,6 +57,7 @@ obj-$(CONFIG_SND_AUDIOINJECTOR_OCTO_SOUNDCARD) += snd-soc-audioinjector-octo-sou + obj-$(CONFIG_SND_DIGIDAC1_SOUNDCARD) += snd-soc-digidac1-soundcard.o + obj-$(CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO) += snd-soc-dionaudio-loco.o + obj-$(CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO_V2) += snd-soc-dionaudio-loco-v2.o ++obj-$(CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC) += snd-soc-allo-boss-dac.o + obj-$(CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC) += snd-soc-allo-piano-dac.o + obj-$(CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS) += snd-soc-allo-piano-dac-plus.o + obj-$(CONFIG_SND_PISOUND) += snd-soc-pisound.o +diff --git a/sound/soc/bcm/allo-boss-dac.c b/sound/soc/bcm/allo-boss-dac.c +new file mode 100644 +index 0000000000000000000000000000000000000000..c080e31065d99ab309ab3bdf41a44adfdd8f8039 +--- /dev/null ++++ b/sound/soc/bcm/allo-boss-dac.c +@@ -0,0 +1,374 @@ ++/* ++ * ALSA ASoC Machine Driver for Allo Boss DAC ++ * ++ * Author: Baswaraj K ++ * Copyright 2016 ++ * based on code by Daniel Matuschek, Stuart MacLean ++ * based on code by Florian Meier ++ * ++ * 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. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include "../codecs/pcm512x.h" ++ ++#define ALLO_BOSS_NOCLOCK 0 ++#define ALLO_BOSS_CLK44EN 1 ++#define ALLO_BOSS_CLK48EN 2 ++ ++struct pcm512x_priv { ++ struct regmap *regmap; ++ struct clk *sclk; ++}; ++ ++/* Clock rate of CLK44EN attached to GPIO6 pin */ ++#define CLK_44EN_RATE 45158400UL ++/* Clock rate of CLK48EN attached to GPIO3 pin */ ++#define CLK_48EN_RATE 49152000UL ++ ++static bool slave; ++static bool snd_soc_allo_boss_master; ++static bool digital_gain_0db_limit = true; ++ ++static void snd_allo_boss_select_clk(struct snd_soc_codec *codec, ++ int clk_id) ++{ ++ switch (clk_id) { ++ case ALLO_BOSS_NOCLOCK: ++ snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x24, 0x00); ++ break; ++ case ALLO_BOSS_CLK44EN: ++ snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x24, 0x20); ++ break; ++ case ALLO_BOSS_CLK48EN: ++ snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x24, 0x04); ++ break; ++ } ++} ++ ++static void snd_allo_boss_clk_gpio(struct snd_soc_codec *codec) ++{ ++ snd_soc_update_bits(codec, PCM512x_GPIO_EN, 0x24, 0x24); ++ snd_soc_update_bits(codec, PCM512x_GPIO_OUTPUT_3, 0x0f, 0x02); ++ snd_soc_update_bits(codec, PCM512x_GPIO_OUTPUT_6, 0x0f, 0x02); ++} ++ ++static bool snd_allo_boss_is_sclk(struct snd_soc_codec *codec) ++{ ++ int sck; ++ ++ sck = snd_soc_read(codec, PCM512x_RATE_DET_4); ++ return (!(sck & 0x40)); ++} ++ ++static bool snd_allo_boss_is_sclk_sleep( ++ struct snd_soc_codec *codec) ++{ ++ msleep(2); ++ return snd_allo_boss_is_sclk(codec); ++} ++ ++static bool snd_allo_boss_is_master_card(struct snd_soc_codec *codec) ++{ ++ bool isClk44EN, isClk48En, isNoClk; ++ ++ snd_allo_boss_clk_gpio(codec); ++ ++ snd_allo_boss_select_clk(codec, ALLO_BOSS_CLK44EN); ++ isClk44EN = snd_allo_boss_is_sclk_sleep(codec); ++ ++ snd_allo_boss_select_clk(codec, ALLO_BOSS_NOCLOCK); ++ isNoClk = snd_allo_boss_is_sclk_sleep(codec); ++ ++ snd_allo_boss_select_clk(codec, ALLO_BOSS_CLK48EN); ++ isClk48En = snd_allo_boss_is_sclk_sleep(codec); ++ ++ return (isClk44EN && isClk48En && !isNoClk); ++} ++ ++static int snd_allo_boss_clk_for_rate(int sample_rate) ++{ ++ int type; ++ ++ switch (sample_rate) { ++ case 11025: ++ case 22050: ++ case 44100: ++ case 88200: ++ case 176400: ++ type = ALLO_BOSS_CLK44EN; ++ break; ++ default: ++ type = ALLO_BOSS_CLK48EN; ++ break; ++ } ++ return type; ++} ++ ++static void snd_allo_boss_set_sclk(struct snd_soc_codec *codec, ++ int sample_rate) ++{ ++ struct pcm512x_priv *pcm512x = snd_soc_codec_get_drvdata(codec); ++ ++ if (!IS_ERR(pcm512x->sclk)) { ++ int ctype; ++ ++ ctype = snd_allo_boss_clk_for_rate(sample_rate); ++ clk_set_rate(pcm512x->sclk, (ctype == ALLO_BOSS_CLK44EN) ++ ? CLK_44EN_RATE : CLK_48EN_RATE); ++ snd_allo_boss_select_clk(codec, ctype); ++ } ++} ++ ++static int snd_allo_boss_init(struct snd_soc_pcm_runtime *rtd) ++{ ++ struct snd_soc_codec *codec = rtd->codec; ++ struct pcm512x_priv *priv; ++ ++ if (slave) ++ snd_soc_allo_boss_master = false; ++ else ++ snd_soc_allo_boss_master = ++ snd_allo_boss_is_master_card(codec); ++ ++ if (snd_soc_allo_boss_master) { ++ struct snd_soc_dai_link *dai = rtd->dai_link; ++ ++ dai->name = "BossDAC"; ++ dai->stream_name = "BossDAC"; ++ dai->dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF ++ | SND_SOC_DAIFMT_CBM_CFM; ++ ++ snd_soc_update_bits(codec, PCM512x_BCLK_LRCLK_CFG, 0x31, 0x11); ++ snd_soc_update_bits(codec, PCM512x_MASTER_MODE, 0x03, 0x03); ++ snd_soc_update_bits(codec, PCM512x_MASTER_CLKDIV_2, 0x7f, 63); ++ } else { ++ priv = snd_soc_codec_get_drvdata(codec); ++ priv->sclk = ERR_PTR(-ENOENT); ++ } ++ ++ snd_soc_update_bits(codec, PCM512x_GPIO_EN, 0x08, 0x08); ++ snd_soc_update_bits(codec, PCM512x_GPIO_OUTPUT_4, 0x0f, 0x02); ++ snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08, 0x08); ++ ++ if (digital_gain_0db_limit) { ++ int ret; ++ struct snd_soc_card *card = rtd->card; ++ ++ ret = snd_soc_limit_volume(card, "Digital Playback Volume", ++ 207); ++ if (ret < 0) ++ dev_warn(card->dev, "Failed to set volume limit: %d\n", ++ ret); ++ } ++ ++ return 0; ++} ++ ++static int snd_allo_boss_update_rate_den( ++ struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_codec *codec = rtd->codec; ++ struct pcm512x_priv *pcm512x = snd_soc_codec_get_drvdata(codec); ++ struct snd_ratnum *rats_no_pll; ++ unsigned int num = 0, den = 0; ++ int err; ++ ++ rats_no_pll = devm_kzalloc(rtd->dev, sizeof(*rats_no_pll), GFP_KERNEL); ++ if (!rats_no_pll) ++ return -ENOMEM; ++ ++ rats_no_pll->num = clk_get_rate(pcm512x->sclk) / 64; ++ rats_no_pll->den_min = 1; ++ rats_no_pll->den_max = 128; ++ rats_no_pll->den_step = 1; ++ ++ err = snd_interval_ratnum(hw_param_interval(params, ++ SNDRV_PCM_HW_PARAM_RATE), 1, rats_no_pll, &num, &den); ++ if (err >= 0 && den) { ++ params->rate_num = num; ++ params->rate_den = den; ++ } ++ ++ devm_kfree(rtd->dev, rats_no_pll); ++ return 0; ++} ++ ++static int snd_allo_boss_set_bclk_ratio_pro( ++ struct snd_soc_dai *cpu_dai, struct snd_pcm_hw_params *params) ++{ ++ int bratio = snd_pcm_format_physical_width(params_format(params)) ++ * params_channels(params); ++ return snd_soc_dai_set_bclk_ratio(cpu_dai, bratio); ++} ++ ++static int snd_allo_boss_hw_params( ++ struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) ++{ ++ int ret = 0; ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_dai *cpu_dai = rtd->cpu_dai; ++ unsigned int sample_bits = ++ snd_pcm_format_physical_width(params_format(params)); ++ ++ if (snd_soc_allo_boss_master) { ++ struct snd_soc_codec *codec = rtd->codec; ++ ++ snd_allo_boss_set_sclk(codec, ++ params_rate(params)); ++ ++ ret = snd_allo_boss_set_bclk_ratio_pro(cpu_dai, ++ params); ++ if (!ret) ++ ret = snd_allo_boss_update_rate_den( ++ substream, params); ++ } else { ++ if (snd_allo_boss_is_sclk(rtd->codec)) { ++ snd_soc_update_bits(rtd->codec, PCM512x_PLL_EN, ++ PCM512x_PLLE, 0x01); ++ snd_soc_update_bits(rtd->codec, PCM512x_PLL_REF, ++ PCM512x_SREF, PCM512x_SREF_BCK); ++ dev_dbg(rtd->codec->dev, ++ "Setting BCLK as input clock and Enable PLL\n"); ++ } else { ++ snd_soc_update_bits(rtd->codec, PCM512x_PLL_EN, ++ PCM512x_PLLE, 0x00); ++ snd_soc_update_bits(rtd->codec, PCM512x_PLL_REF, ++ PCM512x_SREF, PCM512x_SREF_SCK); ++ ++ dev_dbg(rtd->codec->dev, ++ "Setting SCLK as input clock and disabled PLL\n"); ++ } ++ ++ ret = snd_soc_dai_set_bclk_ratio(cpu_dai, sample_bits * 2); ++ } ++ return ret; ++} ++ ++static int snd_allo_boss_startup( ++ struct snd_pcm_substream *substream) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_codec *codec = rtd->codec; ++ ++ snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08, 0x08); ++ return 0; ++} ++ ++static void snd_allo_boss_shutdown( ++ struct snd_pcm_substream *substream) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_codec *codec = rtd->codec; ++ ++ snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08, 0x00); ++} ++ ++/* machine stream operations */ ++static struct snd_soc_ops snd_allo_boss_ops = { ++ .hw_params = snd_allo_boss_hw_params, ++ .startup = snd_allo_boss_startup, ++ .shutdown = snd_allo_boss_shutdown, ++}; ++ ++static struct snd_soc_dai_link snd_allo_boss_dai[] = { ++{ ++ .name = "Boss DAC", ++ .stream_name = "Boss DAC HiFi", ++ .cpu_dai_name = "bcm2708-i2s.0", ++ .codec_dai_name = "pcm512x-hifi", ++ .platform_name = "bcm2708-i2s.0", ++ .codec_name = "pcm512x.1-004d", ++ .dai_fmt = SND_SOC_DAIFMT_I2S | ++ SND_SOC_DAIFMT_NB_NF | ++ SND_SOC_DAIFMT_CBS_CFS, ++ .ops = &snd_allo_boss_ops, ++ .init = snd_allo_boss_init, ++}, ++}; ++ ++/* audio machine driver */ ++static struct snd_soc_card snd_allo_boss = { ++ .name = "BossDAC", ++ .owner = THIS_MODULE, ++ .dai_link = snd_allo_boss_dai, ++ .num_links = ARRAY_SIZE(snd_allo_boss_dai), ++}; ++ ++static int snd_allo_boss_probe(struct platform_device *pdev) ++{ ++ int ret = 0; ++ ++ snd_allo_boss.dev = &pdev->dev; ++ ++ if (pdev->dev.of_node) { ++ struct device_node *i2s_node; ++ struct snd_soc_dai_link *dai; ++ ++ dai = &snd_allo_boss_dai[0]; ++ i2s_node = of_parse_phandle(pdev->dev.of_node, ++ "i2s-controller", 0); ++ ++ if (i2s_node) { ++ dai->cpu_dai_name = NULL; ++ dai->cpu_of_node = i2s_node; ++ dai->platform_name = NULL; ++ dai->platform_of_node = i2s_node; ++ } ++ ++ digital_gain_0db_limit = !of_property_read_bool( ++ pdev->dev.of_node, "allo,24db_digital_gain"); ++ slave = of_property_read_bool(pdev->dev.of_node, ++ "allo,slave"); ++ } ++ ++ ret = snd_soc_register_card(&snd_allo_boss); ++ if (ret) ++ dev_err(&pdev->dev, ++ "snd_soc_register_card() failed: %d\n", ret); ++ ++ return ret; ++} ++ ++static int snd_allo_boss_remove(struct platform_device *pdev) ++{ ++ return snd_soc_unregister_card(&snd_allo_boss); ++} ++ ++static const struct of_device_id snd_allo_boss_of_match[] = { ++ { .compatible = "allo,boss-dac", }, ++ { /* sentinel */ }, ++}; ++MODULE_DEVICE_TABLE(of, snd_allo_boss_of_match); ++ ++static struct platform_driver snd_allo_boss_driver = { ++ .driver = { ++ .name = "snd-allo-boss-dac", ++ .owner = THIS_MODULE, ++ .of_match_table = snd_allo_boss_of_match, ++ }, ++ .probe = snd_allo_boss_probe, ++ .remove = snd_allo_boss_remove, ++}; ++ ++module_platform_driver(snd_allo_boss_driver); ++ ++MODULE_AUTHOR("Baswaraj K "); ++MODULE_DESCRIPTION("ALSA ASoC Machine Driver for Allo Boss DAC"); ++MODULE_LICENSE("GPL v2"); + +From f0fe0c0a16c869d7a0a315969ae7ab3232ebd6c8 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 28 Mar 2017 14:22:20 +0100 +Subject: [PATCH 214/218] BCM270X_DT: Allow multiple instances of w1-gpio + overlays + +Upcoming firmware will modify the address portion of node names when +their "reg" property is written by a dtparam. Modify the w1-gpio +overlays to write the gpiopin parameter value to "reg" properties, so +that multiple instances can be loaded simultaneously. + +Note: The value of the "address" is unimportant - the w1 subsystem +assigns instance numbers to buses sequentially from 1, and it is +not necessary to know which bus a device is on in order to find it. +--- + arch/arm/boot/dts/overlays/w1-gpio-overlay.dts | 6 ++++-- + arch/arm/boot/dts/overlays/w1-gpio-pullup-overlay.dts | 6 ++++-- + 2 files changed, 8 insertions(+), 4 deletions(-) + +diff --git a/arch/arm/boot/dts/overlays/w1-gpio-overlay.dts b/arch/arm/boot/dts/overlays/w1-gpio-overlay.dts +index 29a3b48d19ab36b814c09e4cc4eef6d9e2022da1..f7f8747512653465d01dd1c41a0fcbd2e3e5fbdb 100644 +--- a/arch/arm/boot/dts/overlays/w1-gpio-overlay.dts ++++ b/arch/arm/boot/dts/overlays/w1-gpio-overlay.dts +@@ -23,7 +23,7 @@ + fragment@1 { + target = <&gpio>; + __overlay__ { +- w1_pins: w1_pins { ++ w1_pins: w1_pins@0 { + brcm,pins = <4>; + brcm,function = <0>; // in (initially) + brcm,pull = <0>; // off +@@ -33,7 +33,9 @@ + + __overrides__ { + gpiopin = <&w1>,"gpios:4", +- <&w1_pins>,"brcm,pins:0"; ++ <&w1>,"reg:0", ++ <&w1_pins>,"brcm,pins:0", ++ <&w1_pins>,"reg:0"; + pullup = <&w1>,"rpi,parasitic-power:0"; + }; + }; +diff --git a/arch/arm/boot/dts/overlays/w1-gpio-pullup-overlay.dts b/arch/arm/boot/dts/overlays/w1-gpio-pullup-overlay.dts +index 66a98f6c9601f51483f27803995bec772bb3350e..ef8bfbcabdb31231075d5c281df3b38b1b857c7c 100644 +--- a/arch/arm/boot/dts/overlays/w1-gpio-pullup-overlay.dts ++++ b/arch/arm/boot/dts/overlays/w1-gpio-pullup-overlay.dts +@@ -23,7 +23,7 @@ + fragment@1 { + target = <&gpio>; + __overlay__ { +- w1_pins: w1_pins { ++ w1_pins: w1_pins@0 { + brcm,pins = <4 5>; + brcm,function = <0 1>; // in out + brcm,pull = <0 0>; // off off +@@ -33,7 +33,9 @@ + + __overrides__ { + gpiopin = <&w1>,"gpios:4", +- <&w1_pins>,"brcm,pins:0"; ++ <&w1>,"reg:0", ++ <&w1_pins>,"brcm,pins:0", ++ <&w1_pins>,"reg:0"; + extpullup = <&w1>,"gpios:16", + <&w1_pins>,"brcm,pins:4"; + pullup = <&w1>,"rpi,parasitic-power:0"; + +From 5f04b2d8ae6476f42d0d134a6baf169af4f0cefa Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 28 Mar 2017 17:41:30 +0100 +Subject: [PATCH 215/218] leds-gpio: Remove stray assignment to brightness_set + +The brightness_set method is intended for use cases that must not +block, and can only be used if the GPIO provider can never sleep. +Remove an accidental initialisation (a copy-and-paste error) that +sets it regardless, which has been seen to cause crashes with the +gpio expander driver. + +Signed-off-by: Phil Elwell +--- + drivers/leds/leds-gpio.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c +index 6a27a693034825de2897bb7b338b60cc10c9e59f..a6b352cb003ff5e6c87cf6d37d6502b6b7c63e89 100644 +--- a/drivers/leds/leds-gpio.c ++++ b/drivers/leds/leds-gpio.c +@@ -136,7 +136,6 @@ static int create_gpio_led(const struct gpio_led *template, + led_dat->platform_gpio_blink_set = blink_set; + led_dat->cdev.blink_set = gpio_blink_set; + } +- led_dat->cdev.brightness_set = gpio_led_set; + led_dat->cdev.brightness_get = gpio_led_get; + if (template->default_state == LEDS_GPIO_DEFSTATE_KEEP) { + state = gpiod_get_value_cansleep(led_dat->gpiod); + +From 5db062ea8d7a63257abbbfbeadfe7eb338a0643b Mon Sep 17 00:00:00 2001 +From: Matt Flax +Date: Thu, 30 Mar 2017 11:43:57 +1100 +Subject: [PATCH 216/218] Audioinjector Octo : add extra sample rates, fix rst + and use bcm270x regs + +This patch adds new sample rates to the Audioinjector Octo sound card. The +new supported rates are (in kHz) : +96, 48, 32, 24, 16, 8, 88.2, 44.1, 29.4, 22.05, 14.7 + +This patch also replaces the regulators in the device tree overlay with +the ones declared in bcm270x.dtsi include file. + +This patch also adds an extra codec reset and delay on probe. +--- + .../dts/overlays/audioinjector-addons-overlay.dts | 30 +++---------- + sound/soc/bcm/audioinjector-octo-soundcard.c | 50 ++++++++++++++++++++-- + 2 files changed, 52 insertions(+), 28 deletions(-) + +diff --git a/arch/arm/boot/dts/overlays/audioinjector-addons-overlay.dts b/arch/arm/boot/dts/overlays/audioinjector-addons-overlay.dts +index a36fa85a61f7eaab35ca481ed1dac621e2342e6d..a40bb1193a4cebc5672709e8db861e1167d3a699 100644 +--- a/arch/arm/boot/dts/overlays/audioinjector-addons-overlay.dts ++++ b/arch/arm/boot/dts/overlays/audioinjector-addons-overlay.dts +@@ -13,26 +13,6 @@ + }; + + fragment@1 { +- target = <&soc>; +- __overlay__ { +- reg_digital: reg_digital@0 { +- compatible = "regulator-fixed"; +- regulator-name = "cs42448_dig_supply"; +- regulator-min-microvolt = <3300000>; +- regulator-max-microvolt = <3300000>; +- regulator-always-on; +- }; +- reg_analogue: reg_analogue@0 { +- compatible = "regulator-fixed"; +- regulator-name = "cs42448_ana_supply"; +- regulator-min-microvolt = <5000000>; +- regulator-max-microvolt = <5000000>; +- regulator-always-on; +- }; +- }; +- }; +- +- fragment@2 { + target = <&i2c1>; + __overlay__ { + #address-cells = <1>; +@@ -45,10 +25,10 @@ + reg = <0x48>; + clocks = <&cs42448_mclk>; + clock-names = "mclk"; +- VA-supply = <®_analogue>; +- VD-supply = <®_digital>; +- VLS-supply = <®_digital>; +- VLC-supply = <®_digital>; ++ VA-supply = <&vdd_5v0_reg>; ++ VD-supply = <&vdd_3v3_reg>; ++ VLS-supply = <&vdd_3v3_reg>; ++ VLC-supply = <&vdd_3v3_reg>; + status = "okay"; + }; + +@@ -60,7 +40,7 @@ + }; + }; + +- fragment@3 { ++ fragment@2 { + target = <&sound>; + __overlay__ { + compatible = "ai,audioinjector-octo-soundcard"; +diff --git a/sound/soc/bcm/audioinjector-octo-soundcard.c b/sound/soc/bcm/audioinjector-octo-soundcard.c +index 1198c36c4563b8673e5d386d1dfa92d43689e297..dcf403ab37639ba79e38278d7e4b1ade452c292a 100644 +--- a/sound/soc/bcm/audioinjector-octo-soundcard.c ++++ b/sound/soc/bcm/audioinjector-octo-soundcard.c +@@ -31,7 +31,7 @@ static struct gpio_desc *codec_rst_gpio; + static unsigned int audioinjector_octo_rate; + + static const unsigned int audioinjector_octo_rates[] = { +- 96000, 48000, 88200, 44100, ++ 96000, 48000, 32000, 24000, 16000, 8000, 88200, 44100, 29400, 22050, 14700, + }; + + static struct snd_pcm_hw_constraint_list audioinjector_octo_constraints = { +@@ -98,11 +98,33 @@ static int audioinjector_octo_hw_params(struct snd_pcm_substream *substream, + return snd_soc_dai_set_sysclk(rtd->codec_dai, 0, 49152000, + 0); + break; ++ case 24000: ++ return snd_soc_dai_set_sysclk(rtd->codec_dai, 0, 49152000/2, ++ 0); ++ break; ++ case 32000: ++ case 16000: ++ return snd_soc_dai_set_sysclk(rtd->codec_dai, 0, 49152000/3, ++ 0); ++ break; ++ case 8000: ++ return snd_soc_dai_set_sysclk(rtd->codec_dai, 0, 49152000/6, ++ 0); ++ break; + case 88200: + case 44100: + return snd_soc_dai_set_sysclk(rtd->codec_dai, 0, 45185400, + 0); + break; ++ case 22050: ++ return snd_soc_dai_set_sysclk(rtd->codec_dai, 0, 45185400/2, ++ 0); ++ break; ++ case 29400: ++ case 14700: ++ return snd_soc_dai_set_sysclk(rtd->codec_dai, 0, 45185400/3, ++ 0); ++ break; + default: + return -EINVAL; + } +@@ -132,6 +154,25 @@ static int audioinjector_octo_trigger(struct snd_pcm_substream *substream, + case 44100: + mult[2] = 1; + break; ++ case 32000: ++ mult[3] = 1; ++ case 29400: ++ mult[0] = 1; ++ mult[1] = 1; ++ break; ++ case 24000: ++ mult[3] = 1; ++ case 22050: ++ mult[1] = 1; ++ break; ++ case 16000: ++ mult[3] = 1; ++ case 14700: ++ mult[0] = 1; ++ break; ++ case 8000: ++ mult[3] = 1; ++ break; + default: + return -EINVAL; + } +@@ -234,11 +275,14 @@ static int audioinjector_octo_probe(struct platform_device *pdev) + return PTR_ERR(codec_rst_gpio); + + if (codec_rst_gpio) ++ gpiod_set_value(codec_rst_gpio, 1); ++ msleep(500); ++ if (codec_rst_gpio) + gpiod_set_value(codec_rst_gpio, 0); +- msleep(5); ++ msleep(500); + if (codec_rst_gpio) + gpiod_set_value(codec_rst_gpio, 1); +- msleep(50); ++ msleep(500); + + if (i2s_node && codec_node) { + dai->cpu_dai_name = NULL; + +From 19a3cefda797f4596d3a4a1083aa644a9b28a8c7 Mon Sep 17 00:00:00 2001 +From: BabuSubashChandar C +Date: Thu, 30 Mar 2017 20:17:27 +0530 +Subject: [PATCH 217/218] Add support for new clock rate and mute gpios. + +Signed-off-by: Baswaraj K +Reviewed-by: Deepak +Reviewed-by: BabuSubashChandar +--- + .../allo-boss-dac-pcm512x-audio-overlay.dts | 1 + + arch/arm/configs/bcm2709_defconfig | 1 + + drivers/clk/Makefile | 2 +- + drivers/clk/clk-allo-dac-45Mhz.c | 161 --------------------- + drivers/clk/clk-allo-dac.c | 161 +++++++++++++++++++++ + sound/soc/bcm/Kconfig | 4 +- + sound/soc/bcm/allo-boss-dac.c | 145 +++++++++++++++---- + 7 files changed, 282 insertions(+), 193 deletions(-) + delete mode 100644 drivers/clk/clk-allo-dac-45Mhz.c + create mode 100644 drivers/clk/clk-allo-dac.c + +diff --git a/arch/arm/boot/dts/overlays/allo-boss-dac-pcm512x-audio-overlay.dts b/arch/arm/boot/dts/overlays/allo-boss-dac-pcm512x-audio-overlay.dts +index 7df335a3d82f7043d31ba69331cdf3185264d78c..ac1cfe093d9aa8a77ef25cc62a9d8100d81ca684 100644 +--- a/arch/arm/boot/dts/overlays/allo-boss-dac-pcm512x-audio-overlay.dts ++++ b/arch/arm/boot/dts/overlays/allo-boss-dac-pcm512x-audio-overlay.dts +@@ -47,6 +47,7 @@ + boss_dac: __overlay__ { + compatible = "allo,boss-dac"; + i2s-controller = <&i2s>; ++ mute-gpios = <&gpio 6 1>; + status = "okay"; + }; + }; +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 38c52eb831715ec6c2ce3555c7a4d9e5383e35d5..6a95db4edd5680f3c8889a3a41d0589bf33d7f2d 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -894,6 +894,7 @@ CONFIG_SND_AUDIOINJECTOR_OCTO_SOUNDCARD=m + CONFIG_SND_DIGIDAC1_SOUNDCARD=m + CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO=m + CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO_V2=m ++CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC=m + CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC=m + CONFIG_SND_BCM2708_SOC_FE_PI_AUDIO=m + CONFIG_SND_PISOUND=m +diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile +index b1b3cf5d3a09fe8bd38dfed880dd7e6ac0ccc3d7..eb521affd5b7d30290dd6120e32c3c2a0b0b60f0 100644 +--- a/drivers/clk/Makefile ++++ b/drivers/clk/Makefile +@@ -17,7 +17,7 @@ endif + + # hardware specific clock types + # please keep this section sorted lexicographically by file path name +-obj-$(CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC) += clk-allo-dac-45Mhz.o ++obj-$(CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC) += clk-allo-dac.o + obj-$(CONFIG_MACH_ASM9260) += clk-asm9260.o + obj-$(CONFIG_COMMON_CLK_AXI_CLKGEN) += clk-axi-clkgen.o + obj-$(CONFIG_ARCH_AXXIA) += clk-axm5516.o +diff --git a/drivers/clk/clk-allo-dac-45Mhz.c b/drivers/clk/clk-allo-dac-45Mhz.c +deleted file mode 100644 +index d5e9e5b3495cfd2e94fae256f11bc6e0d1f470c6..0000000000000000000000000000000000000000 +--- a/drivers/clk/clk-allo-dac-45Mhz.c ++++ /dev/null +@@ -1,161 +0,0 @@ +-/* +- * Clock Driver for Allo DAC +- * +- * Author: Baswaraj K +- * Copyright 2016 +- * based on code by Stuart MacLean +- * +- * 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. +- * +- * This program is distributed in the hope that it will be useful, but +- * WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +- * General Public License for more details. +- */ +- +-#include +-#include +-#include +-#include +-#include +-#include +-#include +- +-/* Clock rate of CLK44EN attached to GPIO6 pin */ +-#define CLK_44EN_RATE 45158400UL +-/* Clock rate of CLK48EN attached to GPIO3 pin */ +-#define CLK_48EN_RATE 49152000UL +- +-/** +- * struct allo_dac_clk - Common struct to the Allo DAC +- * @hw: clk_hw for the common clk framework +- * @mode: 0 => CLK44EN, 1 => CLK48EN +- */ +-struct clk_allo_hw { +- struct clk_hw hw; +- uint8_t mode; +-}; +- +-#define to_allo_clk(_hw) container_of(_hw, struct clk_allo_hw, hw) +- +-static const struct of_device_id clk_allo_dac_dt_ids[] = { +- { .compatible = "allo,dac-clk",}, +- { } +-}; +-MODULE_DEVICE_TABLE(of, clk_allo_dac_dt_ids); +- +-static unsigned long clk_allo_dac_recalc_rate(struct clk_hw *hw, +- unsigned long parent_rate) +-{ +- return (to_allo_clk(hw)->mode == 0) ? CLK_44EN_RATE : +- CLK_48EN_RATE; +-} +- +-static long clk_allo_dac_round_rate(struct clk_hw *hw, +- unsigned long rate, unsigned long *parent_rate) +-{ +- long actual_rate; +- +- if (rate <= CLK_44EN_RATE) { +- actual_rate = (long)CLK_44EN_RATE; +- } else if (rate >= CLK_48EN_RATE) { +- actual_rate = (long)CLK_48EN_RATE; +- } else { +- long diff44Rate = (long)(rate - CLK_44EN_RATE); +- long diff48Rate = (long)(CLK_48EN_RATE - rate); +- +- if (diff44Rate < diff48Rate) +- actual_rate = (long)CLK_44EN_RATE; +- else +- actual_rate = (long)CLK_48EN_RATE; +- } +- return actual_rate; +-} +- +- +-static int clk_allo_dac_set_rate(struct clk_hw *hw, +- unsigned long rate, unsigned long parent_rate) +-{ +- unsigned long actual_rate; +- struct clk_allo_hw *clk = to_allo_clk(hw); +- +- actual_rate = (unsigned long)clk_allo_dac_round_rate(hw, rate, +- &parent_rate); +- clk->mode = (actual_rate == CLK_44EN_RATE) ? 0 : 1; +- return 0; +-} +- +- +-const struct clk_ops clk_allo_dac_rate_ops = { +- .recalc_rate = clk_allo_dac_recalc_rate, +- .round_rate = clk_allo_dac_round_rate, +- .set_rate = clk_allo_dac_set_rate, +-}; +- +-static int clk_allo_dac_probe(struct platform_device *pdev) +-{ +- int ret; +- struct clk_allo_hw *proclk; +- struct clk *clk; +- struct device *dev; +- struct clk_init_data init; +- +- dev = &pdev->dev; +- +- proclk = kzalloc(sizeof(struct clk_allo_hw), GFP_KERNEL); +- if (!proclk) +- return -ENOMEM; +- +- init.name = "clk-allo-dac"; +- init.ops = &clk_allo_dac_rate_ops; +- init.flags = CLK_IS_ROOT | CLK_IS_BASIC; +- init.parent_names = NULL; +- init.num_parents = 0; +- +- proclk->mode = 0; +- proclk->hw.init = &init; +- +- clk = devm_clk_register(dev, &proclk->hw); +- if (!IS_ERR(clk)) { +- ret = of_clk_add_provider(dev->of_node, of_clk_src_simple_get, +- clk); +- } else { +- dev_err(dev, "Fail to register clock driver\n"); +- kfree(proclk); +- ret = PTR_ERR(clk); +- } +- return ret; +-} +- +-static int clk_allo_dac_remove(struct platform_device *pdev) +-{ +- of_clk_del_provider(pdev->dev.of_node); +- return 0; +-} +- +-static struct platform_driver clk_allo_dac_driver = { +- .probe = clk_allo_dac_probe, +- .remove = clk_allo_dac_remove, +- .driver = { +- .name = "clk-allo-dac", +- .of_match_table = clk_allo_dac_dt_ids, +- }, +-}; +- +-static int __init clk_allo_dac_init(void) +-{ +- return platform_driver_register(&clk_allo_dac_driver); +-} +-core_initcall(clk_allo_dac_init); +- +-static void __exit clk_allo_dac_exit(void) +-{ +- platform_driver_unregister(&clk_allo_dac_driver); +-} +-module_exit(clk_allo_dac_exit); +- +-MODULE_DESCRIPTION("Allo DAC clock driver"); +-MODULE_LICENSE("GPL v2"); +-MODULE_ALIAS("platform:clk-allo-dac"); +diff --git a/drivers/clk/clk-allo-dac.c b/drivers/clk/clk-allo-dac.c +new file mode 100644 +index 0000000000000000000000000000000000000000..0baf821d6947ebb757c8ea4594f6c1b04b4e10dd +--- /dev/null ++++ b/drivers/clk/clk-allo-dac.c +@@ -0,0 +1,161 @@ ++/* ++ * Clock Driver for Allo DAC ++ * ++ * Author: Baswaraj K ++ * Copyright 2016 ++ * based on code by Stuart MacLean ++ * ++ * 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. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/* Clock rate of CLK44EN attached to GPIO6 pin */ ++#define CLK_44EN_RATE 45158400UL ++/* Clock rate of CLK48EN attached to GPIO3 pin */ ++#define CLK_48EN_RATE 49152000UL ++ ++/** ++ * struct allo_dac_clk - Common struct to the Allo DAC ++ * @hw: clk_hw for the common clk framework ++ * @mode: 0 => CLK44EN, 1 => CLK48EN ++ */ ++struct clk_allo_hw { ++ struct clk_hw hw; ++ uint8_t mode; ++}; ++ ++#define to_allo_clk(_hw) container_of(_hw, struct clk_allo_hw, hw) ++ ++static const struct of_device_id clk_allo_dac_dt_ids[] = { ++ { .compatible = "allo,dac-clk",}, ++ { } ++}; ++MODULE_DEVICE_TABLE(of, clk_allo_dac_dt_ids); ++ ++static unsigned long clk_allo_dac_recalc_rate(struct clk_hw *hw, ++ unsigned long parent_rate) ++{ ++ return (to_allo_clk(hw)->mode == 0) ? CLK_44EN_RATE : ++ CLK_48EN_RATE; ++} ++ ++static long clk_allo_dac_round_rate(struct clk_hw *hw, ++ unsigned long rate, unsigned long *parent_rate) ++{ ++ long actual_rate; ++ ++ if (rate <= CLK_44EN_RATE) { ++ actual_rate = (long)CLK_44EN_RATE; ++ } else if (rate >= CLK_48EN_RATE) { ++ actual_rate = (long)CLK_48EN_RATE; ++ } else { ++ long diff44Rate = (long)(rate - CLK_44EN_RATE); ++ long diff48Rate = (long)(CLK_48EN_RATE - rate); ++ ++ if (diff44Rate < diff48Rate) ++ actual_rate = (long)CLK_44EN_RATE; ++ else ++ actual_rate = (long)CLK_48EN_RATE; ++ } ++ return actual_rate; ++} ++ ++ ++static int clk_allo_dac_set_rate(struct clk_hw *hw, ++ unsigned long rate, unsigned long parent_rate) ++{ ++ unsigned long actual_rate; ++ struct clk_allo_hw *clk = to_allo_clk(hw); ++ ++ actual_rate = (unsigned long)clk_allo_dac_round_rate(hw, rate, ++ &parent_rate); ++ clk->mode = (actual_rate == CLK_44EN_RATE) ? 0 : 1; ++ return 0; ++} ++ ++ ++const struct clk_ops clk_allo_dac_rate_ops = { ++ .recalc_rate = clk_allo_dac_recalc_rate, ++ .round_rate = clk_allo_dac_round_rate, ++ .set_rate = clk_allo_dac_set_rate, ++}; ++ ++static int clk_allo_dac_probe(struct platform_device *pdev) ++{ ++ int ret; ++ struct clk_allo_hw *proclk; ++ struct clk *clk; ++ struct device *dev; ++ struct clk_init_data init; ++ ++ dev = &pdev->dev; ++ ++ proclk = kzalloc(sizeof(struct clk_allo_hw), GFP_KERNEL); ++ if (!proclk) ++ return -ENOMEM; ++ ++ init.name = "clk-allo-dac"; ++ init.ops = &clk_allo_dac_rate_ops; ++ init.flags = CLK_IS_BASIC; ++ init.parent_names = NULL; ++ init.num_parents = 0; ++ ++ proclk->mode = 0; ++ proclk->hw.init = &init; ++ ++ clk = devm_clk_register(dev, &proclk->hw); ++ if (!IS_ERR(clk)) { ++ ret = of_clk_add_provider(dev->of_node, of_clk_src_simple_get, ++ clk); ++ } else { ++ dev_err(dev, "Fail to register clock driver\n"); ++ kfree(proclk); ++ ret = PTR_ERR(clk); ++ } ++ return ret; ++} ++ ++static int clk_allo_dac_remove(struct platform_device *pdev) ++{ ++ of_clk_del_provider(pdev->dev.of_node); ++ return 0; ++} ++ ++static struct platform_driver clk_allo_dac_driver = { ++ .probe = clk_allo_dac_probe, ++ .remove = clk_allo_dac_remove, ++ .driver = { ++ .name = "clk-allo-dac", ++ .of_match_table = clk_allo_dac_dt_ids, ++ }, ++}; ++ ++static int __init clk_allo_dac_init(void) ++{ ++ return platform_driver_register(&clk_allo_dac_driver); ++} ++core_initcall(clk_allo_dac_init); ++ ++static void __exit clk_allo_dac_exit(void) ++{ ++ platform_driver_unregister(&clk_allo_dac_driver); ++} ++module_exit(clk_allo_dac_exit); ++ ++MODULE_DESCRIPTION("Allo DAC clock driver"); ++MODULE_LICENSE("GPL v2"); ++MODULE_ALIAS("platform:clk-allo-dac"); +diff --git a/sound/soc/bcm/Kconfig b/sound/soc/bcm/Kconfig +index 76cb7626d7651b144fb268c46f2099b4981a330e..ede81ecbfa2ac6e0430768ddf31cb957201eb3fd 100644 +--- a/sound/soc/bcm/Kconfig ++++ b/sound/soc/bcm/Kconfig +@@ -176,11 +176,11 @@ config SND_BCM2708_SOC_FE_PI_AUDIO + Say Y or M if you want to add support for Fe-Pi-Audio. + + config SND_BCM2708_SOC_ALLO_BOSS_DAC +- tristate "Support for allo Boss DAC" ++ tristate "Support for Allo Boss DAC" + depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S + select SND_SOC_PCM512x_I2C + help +- Say Y or M if you want to add support for allo Boss DAC. ++ Say Y or M if you want to add support for Allo Boss DAC. + + + config SND_PISOUND +diff --git a/sound/soc/bcm/allo-boss-dac.c b/sound/soc/bcm/allo-boss-dac.c +index c080e31065d99ab309ab3bdf41a44adfdd8f8039..203ab76c7045b081578e23bda1099dd103d11154 100644 +--- a/sound/soc/bcm/allo-boss-dac.c ++++ b/sound/soc/bcm/allo-boss-dac.c +@@ -2,8 +2,9 @@ + * ALSA ASoC Machine Driver for Allo Boss DAC + * + * Author: Baswaraj K +- * Copyright 2016 +- * based on code by Daniel Matuschek, Stuart MacLean ++ * Copyright 2017 ++ * based on code by Daniel Matuschek, ++ * Stuart MacLean + * based on code by Florian Meier + * + * This program is free software; you can redistribute it and/or +@@ -17,6 +18,7 @@ + */ + + #include ++#include + #include + #include + #include +@@ -36,6 +38,8 @@ struct pcm512x_priv { + struct clk *sclk; + }; + ++static struct gpio_desc *mute_gpio; ++ + /* Clock rate of CLK44EN attached to GPIO6 pin */ + #define CLK_44EN_RATE 45158400UL + /* Clock rate of CLK48EN attached to GPIO3 pin */ +@@ -111,6 +115,7 @@ static int snd_allo_boss_clk_for_rate(int sample_rate) + case 44100: + case 88200: + case 176400: ++ case 352800: + type = ALLO_BOSS_CLK44EN; + break; + default: +@@ -138,7 +143,7 @@ static void snd_allo_boss_set_sclk(struct snd_soc_codec *codec, + static int snd_allo_boss_init(struct snd_soc_pcm_runtime *rtd) + { + struct snd_soc_codec *codec = rtd->codec; +- struct pcm512x_priv *priv; ++ struct pcm512x_priv *priv = snd_soc_codec_get_drvdata(codec); + + if (slave) + snd_soc_allo_boss_master = false; +@@ -150,15 +155,22 @@ static int snd_allo_boss_init(struct snd_soc_pcm_runtime *rtd) + struct snd_soc_dai_link *dai = rtd->dai_link; + + dai->name = "BossDAC"; +- dai->stream_name = "BossDAC"; ++ dai->stream_name = "Boss DAC HiFi [Master]"; + dai->dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF + | SND_SOC_DAIFMT_CBM_CFM; + + snd_soc_update_bits(codec, PCM512x_BCLK_LRCLK_CFG, 0x31, 0x11); + snd_soc_update_bits(codec, PCM512x_MASTER_MODE, 0x03, 0x03); + snd_soc_update_bits(codec, PCM512x_MASTER_CLKDIV_2, 0x7f, 63); ++ /* ++ * Default sclk to CLK_48EN_RATE, otherwise codec ++ * pcm512x_dai_startup_master method could call ++ * snd_pcm_hw_constraint_ratnums using CLK_44EN/64 ++ * which will mask 384k sample rate. ++ */ ++ if (!IS_ERR(priv->sclk)) ++ clk_set_rate(priv->sclk, CLK_48EN_RATE); + } else { +- priv = snd_soc_codec_get_drvdata(codec); + priv->sclk = ERR_PTR(-ENOENT); + } + +@@ -218,6 +230,52 @@ static int snd_allo_boss_set_bclk_ratio_pro( + return snd_soc_dai_set_bclk_ratio(cpu_dai, bratio); + } + ++static void snd_allo_boss_gpio_mute(struct snd_soc_card *card) ++{ ++ if (mute_gpio) ++ gpiod_set_value_cansleep(mute_gpio, 1); ++} ++ ++static void snd_allo_boss_gpio_unmute(struct snd_soc_card *card) ++{ ++ if (mute_gpio) ++ gpiod_set_value_cansleep(mute_gpio, 0); ++} ++ ++static int snd_allo_boss_set_bias_level(struct snd_soc_card *card, ++ struct snd_soc_dapm_context *dapm, enum snd_soc_bias_level level) ++{ ++ struct snd_soc_pcm_runtime *rtd; ++ struct snd_soc_dai *codec_dai; ++ ++ rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); ++ codec_dai = rtd->codec_dai; ++ ++ if (dapm->dev != codec_dai->dev) ++ return 0; ++ ++ switch (level) { ++ case SND_SOC_BIAS_PREPARE: ++ if (dapm->bias_level != SND_SOC_BIAS_STANDBY) ++ break; ++ /* UNMUTE DAC */ ++ snd_allo_boss_gpio_unmute(card); ++ break; ++ ++ case SND_SOC_BIAS_STANDBY: ++ if (dapm->bias_level != SND_SOC_BIAS_PREPARE) ++ break; ++ /* MUTE DAC */ ++ snd_allo_boss_gpio_mute(card); ++ break; ++ ++ default: ++ break; ++ } ++ ++ return 0; ++} ++ + static int snd_allo_boss_hw_params( + struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) + { +@@ -239,23 +297,6 @@ static int snd_allo_boss_hw_params( + ret = snd_allo_boss_update_rate_den( + substream, params); + } else { +- if (snd_allo_boss_is_sclk(rtd->codec)) { +- snd_soc_update_bits(rtd->codec, PCM512x_PLL_EN, +- PCM512x_PLLE, 0x01); +- snd_soc_update_bits(rtd->codec, PCM512x_PLL_REF, +- PCM512x_SREF, PCM512x_SREF_BCK); +- dev_dbg(rtd->codec->dev, +- "Setting BCLK as input clock and Enable PLL\n"); +- } else { +- snd_soc_update_bits(rtd->codec, PCM512x_PLL_EN, +- PCM512x_PLLE, 0x00); +- snd_soc_update_bits(rtd->codec, PCM512x_PLL_REF, +- PCM512x_SREF, PCM512x_SREF_SCK); +- +- dev_dbg(rtd->codec->dev, +- "Setting SCLK as input clock and disabled PLL\n"); +- } +- + ret = snd_soc_dai_set_bclk_ratio(cpu_dai, sample_bits * 2); + } + return ret; +@@ -266,8 +307,23 @@ static int snd_allo_boss_startup( + { + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_codec *codec = rtd->codec; ++ struct snd_soc_card *card = rtd->card; + + snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08, 0x08); ++ snd_allo_boss_gpio_mute(card); ++ ++ if (snd_soc_allo_boss_master) { ++ struct pcm512x_priv *priv = snd_soc_codec_get_drvdata(codec); ++ /* ++ * Default sclk to CLK_48EN_RATE, otherwise codec ++ * pcm512x_dai_startup_master method could call ++ * snd_pcm_hw_constraint_ratnums using CLK_44EN/64 ++ * which will mask 384k sample rate. ++ */ ++ if (!IS_ERR(priv->sclk)) ++ clk_set_rate(priv->sclk, CLK_48EN_RATE); ++ } ++ + return 0; + } + +@@ -280,11 +336,21 @@ static void snd_allo_boss_shutdown( + snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08, 0x00); + } + ++static int snd_allo_boss_prepare( ++ struct snd_pcm_substream *substream) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_card *card = rtd->card; ++ ++ snd_allo_boss_gpio_unmute(card); ++ return 0; ++} + /* machine stream operations */ + static struct snd_soc_ops snd_allo_boss_ops = { + .hw_params = snd_allo_boss_hw_params, + .startup = snd_allo_boss_startup, + .shutdown = snd_allo_boss_shutdown, ++ .prepare = snd_allo_boss_prepare, + }; + + static struct snd_soc_dai_link snd_allo_boss_dai[] = { +@@ -335,19 +401,40 @@ static int snd_allo_boss_probe(struct platform_device *pdev) + digital_gain_0db_limit = !of_property_read_bool( + pdev->dev.of_node, "allo,24db_digital_gain"); + slave = of_property_read_bool(pdev->dev.of_node, +- "allo,slave"); +- } ++ "allo,slave"); ++ ++ mute_gpio = devm_gpiod_get_optional(&pdev->dev, "mute", ++ GPIOD_OUT_LOW); ++ if (IS_ERR(mute_gpio)) { ++ ret = PTR_ERR(mute_gpio); ++ dev_err(&pdev->dev, ++ "failed to get mute gpio: %d\n", ret); ++ return ret; ++ } + +- ret = snd_soc_register_card(&snd_allo_boss); +- if (ret) +- dev_err(&pdev->dev, +- "snd_soc_register_card() failed: %d\n", ret); ++ if (mute_gpio) ++ snd_allo_boss.set_bias_level = ++ snd_allo_boss_set_bias_level; + +- return ret; ++ ret = snd_soc_register_card(&snd_allo_boss); ++ if (ret) { ++ dev_err(&pdev->dev, ++ "snd_soc_register_card() failed: %d\n", ret); ++ return ret; ++ } ++ ++ if (mute_gpio) ++ snd_allo_boss_gpio_mute(&snd_allo_boss); ++ ++ return 0; ++ } ++ ++ return -EINVAL; + } + + static int snd_allo_boss_remove(struct platform_device *pdev) + { ++ snd_allo_boss_gpio_mute(&snd_allo_boss); + return snd_soc_unregister_card(&snd_allo_boss); + } + + +From a279188d3efbc8900336ef484536247513ecf472 Mon Sep 17 00:00:00 2001 +From: BabuSubashChandar +Date: Sat, 1 Apr 2017 00:46:52 +0530 +Subject: [PATCH 218/218] Add clock changes and mute gpios (#1938) + +Also improve code style and adhere to ALSA coding conventions. + +Signed-off-by: Baswaraj K +Reviewed-by: Vijay Kumar B. +Reviewed-by: Raashid Muhammed +--- + arch/arm/boot/dts/overlays/README | 3 + + .../allo-piano-dac-plus-pcm512x-audio-overlay.dts | 12 +- + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 2 + + sound/soc/bcm/allo-piano-dac-plus.c | 338 +++++++++++++++++---- + 5 files changed, 291 insertions(+), 65 deletions(-) + +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index c9e954253a6318dbd2605b93026c04974b3271bd..1377e5b8e8363c3e0ede318ce54bd784cb70d4c9 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -323,6 +323,9 @@ Params: 24db_digital_gain Allow gain to be applied via the PCM512x codec + responsibility of the user to ensure that + the Digital volume control is set to a value + that does not result in clipping/distortion!) ++ glb_mclk This option is only with Kali board. If enabled, ++ MCLK for Kali is used and PLL is disabled for ++ better voice quality. (default Off) + + + Name: at86rf233 +diff --git a/arch/arm/boot/dts/overlays/allo-piano-dac-plus-pcm512x-audio-overlay.dts b/arch/arm/boot/dts/overlays/allo-piano-dac-plus-pcm512x-audio-overlay.dts +index 6943b55ca5f96097668e2d10c05f56a26be62b0a..5c1c81c427a8b396ca9e9c903e97f2711850d4c6 100644 +--- a/arch/arm/boot/dts/overlays/allo-piano-dac-plus-pcm512x-audio-overlay.dts ++++ b/arch/arm/boot/dts/overlays/allo-piano-dac-plus-pcm512x-audio-overlay.dts +@@ -19,13 +19,13 @@ + #size-cells = <0>; + status = "okay"; + +- pcm5122_4c: pcm5122@4c { ++ allo_pcm5122_4c: pcm5122@4c { + #sound-dai-cells = <0>; + compatible = "ti,pcm5122"; + reg = <0x4c>; + status = "okay"; + }; +- pcm5122_4d: pcm5122@4d { ++ allo_pcm5122_4d: pcm5122@4d { + #sound-dai-cells = <0>; + compatible = "ti,pcm5122"; + reg = <0x4d>; +@@ -38,14 +38,18 @@ + target = <&sound>; + piano_dac: __overlay__ { + compatible = "allo,piano-dac-plus"; +- audio-codec = <&pcm5122_4c &pcm5122_4d>; ++ audio-codec = <&allo_pcm5122_4c &allo_pcm5122_4d>; + i2s-controller = <&i2s>; ++ mute1-gpios = <&gpio 6 1>; ++ mute2-gpios = <&gpio 25 1>; + status = "okay"; + }; + }; + + __overrides__ { + 24db_digital_gain = +- <&piano_dac>,"piano,24db_digital_gain?"; ++ <&piano_dac>,"allo,24db_digital_gain?"; ++ glb_mclk = ++ <&piano_dac>,"allo,glb_mclk?"; + }; + }; +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 6a95db4edd5680f3c8889a3a41d0589bf33d7f2d..6290adaf6b07e8b9aacc72343dc67f4cfd6f1a97 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -896,6 +896,7 @@ CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO=m + CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO_V2=m + CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC=m + CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC=m ++CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS=m + CONFIG_SND_BCM2708_SOC_FE_PI_AUDIO=m + CONFIG_SND_PISOUND=m + CONFIG_SND_SOC_ADAU1701=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index c46b86dda8ade97cfa5589106e77d75e241147e0..fd535ff21e7dab6717eb61f1b966b7d92791ec8d 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -887,7 +887,9 @@ CONFIG_SND_AUDIOINJECTOR_OCTO_SOUNDCARD=m + CONFIG_SND_DIGIDAC1_SOUNDCARD=m + CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO=m + CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO_V2=m ++CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC=m + CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC=m ++CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS=m + CONFIG_SND_BCM2708_SOC_FE_PI_AUDIO=m + CONFIG_SND_PISOUND=m + CONFIG_SND_SOC_ADAU1701=m +diff --git a/sound/soc/bcm/allo-piano-dac-plus.c b/sound/soc/bcm/allo-piano-dac-plus.c +index f66f42abadbd5f9d3fe000676e8297ed91630e47..56e43f98846b41e487b3089813f7edc3c08517eb 100644 +--- a/sound/soc/bcm/allo-piano-dac-plus.c ++++ b/sound/soc/bcm/allo-piano-dac-plus.c +@@ -18,7 +18,7 @@ + + #include + #include +- ++#include + #include + #include + #include +@@ -34,9 +34,19 @@ struct dsp_code { + char val; + }; + +-static struct snd_soc_pcm_runtime *rtd_glb; ++struct glb_pool { ++ struct mutex lock; ++ unsigned int set_lowpass; ++ unsigned int set_mode; ++ unsigned int set_rate; ++ unsigned int dsp_page_number; ++}; ++ + static bool digital_gain_0db_limit = true; +-unsigned int set_lowpass, set_mode, set_rate, dsp_page_number; ++bool glb_mclk; ++ ++static struct gpio_desc *mute_gpio[2]; ++ + + static const char * const allo_piano_mode_texts[] = { + "2.0", +@@ -68,12 +78,14 @@ static const char * const allo_piano_dsp_low_pass_texts[] = { + static const SOC_ENUM_SINGLE_DECL(allo_piano_enum, + 0, 0, allo_piano_dsp_low_pass_texts); + +-static int snd_allo_piano_dsp_program(struct snd_soc_pcm_runtime *rtd, ++static int __snd_allo_piano_dsp_program(struct snd_soc_pcm_runtime *rtd, + unsigned int mode, unsigned int rate, unsigned int lowpass) + { + const struct firmware *fw; +- char firmware_name[40]; ++ char firmware_name[60]; + int ret = 0, dac = 0; ++ struct snd_soc_card *card = rtd->card; ++ struct glb_pool *glb_ptr = card->drvdata; + + if (rate <= 46000) + rate = 44100; +@@ -88,47 +100,51 @@ static int snd_allo_piano_dsp_program(struct snd_soc_pcm_runtime *rtd, + else + rate = 192000; + +- /* same configuration loaded */ +- if ((rate == set_rate) && (lowpass == set_lowpass) +- && (mode == set_mode)) +- return 1; ++ if ((lowpass > 14) || (lowpass < 0)) ++ lowpass = 3; ++ if ((mode > 2) || (mode < 0)) ++ mode = 0; + +- set_rate = rate; +- set_mode = mode; ++ /* same configuration loaded */ ++ if ((rate == glb_ptr->set_rate) && (lowpass == glb_ptr->set_lowpass) ++ && (mode == glb_ptr->set_mode)) ++ return 0; + + if (mode == 0) { /* 2.0 */ + snd_soc_write(rtd->codec_dais[1]->codec, +- PCM512x_MUTE, 0x11); ++ PCM512x_MUTE, 0x11); ++ glb_ptr->set_rate = rate; ++ glb_ptr->set_mode = mode; ++ glb_ptr->set_lowpass = lowpass; + return 1; + } else { + snd_soc_write(rtd->codec_dais[1]->codec, +- PCM512x_MUTE, 0x00); ++ PCM512x_MUTE, 0x00); + } + +- set_lowpass = lowpass; +- + for (dac = 0; dac < rtd->num_codecs; dac++) { + struct dsp_code *dsp_code_read; +- int i = 1; + struct snd_soc_codec *codec = rtd->codec_dais[dac]->codec; ++ int i = 1; + + if (dac == 0) { /* high */ + sprintf(firmware_name, +- "alloPiano/2.2/allo-piano-dsp-%d-%d-%d.bin", +- rate, ((set_lowpass * 10) + 60), dac); ++ "allo/piano/2.2/allo-piano-dsp-%d-%d-%d.bin", ++ rate, ((lowpass * 10) + 60), dac); + } else { /* low */ + sprintf(firmware_name, +- "alloPiano/2.%d/allo-piano-dsp-%d-%d-%d.bin", +- set_mode, rate, ((set_lowpass * 10) + 60), dac); ++ "allo/piano/2.%d/allo-piano-dsp-%d-%d-%d.bin", ++ mode, rate, ((lowpass * 10) + 60), dac); + } + + dev_info(codec->dev, "Dsp Firmware File Name: %s\n", +- firmware_name); ++ firmware_name); + + ret = request_firmware(&fw, firmware_name, codec->dev); + if (ret < 0) { +- dev_err(codec->dev, "Error: AlloPiano Firmware %s missing. %d\n", +- firmware_name, ret); ++ dev_err(codec->dev, ++ "Error: Allo Piano Firmware %s missing. %d\n", ++ firmware_name, ret); + goto err; + } + +@@ -136,62 +152,97 @@ static int snd_allo_piano_dsp_program(struct snd_soc_pcm_runtime *rtd, + dsp_code_read = (struct dsp_code *)&fw->data[i]; + + if (dsp_code_read->offset == 0) { +- dsp_page_number = dsp_code_read->val; ++ glb_ptr->dsp_page_number = dsp_code_read->val; + ret = snd_soc_write(rtd->codec_dais[dac]->codec, + PCM512x_PAGE_BASE(0), + dsp_code_read->val); + + } else if (dsp_code_read->offset != 0) { + ret = snd_soc_write(rtd->codec_dais[dac]->codec, +- (PCM512x_PAGE_BASE(dsp_page_number) + ++ (PCM512x_PAGE_BASE( ++ glb_ptr->dsp_page_number) + + dsp_code_read->offset), + dsp_code_read->val); +- + } + if (ret < 0) { + dev_err(codec->dev, + "Failed to write Register: %d\n", ret); ++ release_firmware(fw); + goto err; + } + i = i + 3; + } + release_firmware(fw); + } ++ glb_ptr->set_rate = rate; ++ glb_ptr->set_mode = mode; ++ glb_ptr->set_lowpass = lowpass; + return 1; + + err: +- release_firmware(fw); ++ return ret; ++} ++ ++static int snd_allo_piano_dsp_program(struct snd_soc_pcm_runtime *rtd, ++ unsigned int mode, unsigned int rate, unsigned int lowpass) ++{ ++ struct snd_soc_card *card = rtd->card; ++ struct glb_pool *glb_ptr = card->drvdata; ++ int ret = 0; ++ ++ mutex_lock(&glb_ptr->lock); ++ ++ ret = __snd_allo_piano_dsp_program(rtd, ++ mode, rate, lowpass); ++ mutex_unlock(&glb_ptr->lock); ++ + return ret; + } + + static int snd_allo_piano_mode_get(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) + { +- ucontrol->value.integer.value[0] = set_mode; ++ struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); ++ struct glb_pool *glb_ptr = card->drvdata; ++ ++ ucontrol->value.integer.value[0] = glb_ptr->set_mode; + return 0; + } + + static int snd_allo_piano_mode_put(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) + { +- return(snd_allo_piano_dsp_program(rtd_glb, +- ucontrol->value.integer.value[0], +- set_rate, set_lowpass)); ++ struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); ++ struct snd_soc_pcm_runtime *rtd; ++ struct glb_pool *glb_ptr = card->drvdata; ++ ++ rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); ++ return(snd_allo_piano_dsp_program(rtd, ++ ucontrol->value.integer.value[0], ++ glb_ptr->set_rate, glb_ptr->set_lowpass)); + } + + static int snd_allo_piano_lowpass_get(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) + { +- ucontrol->value.integer.value[0] = set_lowpass; ++ struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); ++ struct glb_pool *glb_ptr = card->drvdata; ++ ++ ucontrol->value.integer.value[0] = glb_ptr->set_lowpass; + return 0; + } + + static int snd_allo_piano_lowpass_put(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) + { +- return(snd_allo_piano_dsp_program(rtd_glb, +- set_mode, set_rate, +- ucontrol->value.integer.value[0])); ++ struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); ++ struct snd_soc_pcm_runtime *rtd; ++ struct glb_pool *glb_ptr = card->drvdata; ++ ++ rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); ++ return(snd_allo_piano_dsp_program(rtd, ++ glb_ptr->set_mode, glb_ptr->set_rate, ++ ucontrol->value.integer.value[0])); + } + + static int pcm512x_get_reg_sub(struct snd_kcontrol *kcontrol, +@@ -199,15 +250,18 @@ static int pcm512x_get_reg_sub(struct snd_kcontrol *kcontrol, + { + struct soc_mixer_control *mc = + (struct soc_mixer_control *)kcontrol->private_value; ++ struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); ++ struct snd_soc_pcm_runtime *rtd; + unsigned int left_val = 0; + unsigned int right_val = 0; + +- left_val = snd_soc_read(rtd_glb->codec_dais[1]->codec, ++ rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); ++ left_val = snd_soc_read(rtd->codec_dais[1]->codec, + PCM512x_DIGITAL_VOLUME_2); + if (left_val < 0) + return left_val; + +- right_val = snd_soc_read(rtd_glb->codec_dais[1]->codec, ++ right_val = snd_soc_read(rtd->codec_dais[1]->codec, + PCM512x_DIGITAL_VOLUME_3); + if (right_val < 0) + return right_val; +@@ -225,16 +279,19 @@ static int pcm512x_set_reg_sub(struct snd_kcontrol *kcontrol, + { + struct soc_mixer_control *mc = + (struct soc_mixer_control *)kcontrol->private_value; ++ struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); ++ struct snd_soc_pcm_runtime *rtd; + unsigned int left_val = (ucontrol->value.integer.value[0] & mc->max); + unsigned int right_val = (ucontrol->value.integer.value[1] & mc->max); + int ret = 0; + +- ret = snd_soc_write(rtd_glb->codec_dais[1]->codec, ++ rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); ++ ret = snd_soc_write(rtd->codec_dais[1]->codec, + PCM512x_DIGITAL_VOLUME_2, (~left_val)); + if (ret < 0) + return ret; + +- ret = snd_soc_write(rtd_glb->codec_dais[1]->codec, ++ ret = snd_soc_write(rtd->codec_dais[1]->codec, + PCM512x_DIGITAL_VOLUME_3, (~right_val)); + if (ret < 0) + return ret; +@@ -245,9 +302,12 @@ static int pcm512x_set_reg_sub(struct snd_kcontrol *kcontrol, + static int pcm512x_get_reg_sub_switch(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) + { ++ struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); ++ struct snd_soc_pcm_runtime *rtd; + int val = 0; + +- val = snd_soc_read(rtd_glb->codec_dais[1]->codec, PCM512x_MUTE); ++ rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); ++ val = snd_soc_read(rtd->codec_dais[1]->codec, PCM512x_MUTE); + if (val < 0) + return val; + +@@ -260,11 +320,14 @@ static int pcm512x_get_reg_sub_switch(struct snd_kcontrol *kcontrol, + static int pcm512x_set_reg_sub_switch(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) + { ++ struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); ++ struct snd_soc_pcm_runtime *rtd; + unsigned int left_val = (ucontrol->value.integer.value[0]); + unsigned int right_val = (ucontrol->value.integer.value[1]); + int ret = 0; + +- ret = snd_soc_write(rtd_glb->codec_dais[1]->codec, PCM512x_MUTE, ++ rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); ++ ret = snd_soc_write(rtd->codec_dais[1]->codec, PCM512x_MUTE, + ~((left_val & 0x01)<<4 | (right_val & 0x01))); + if (ret < 0) + return ret; +@@ -276,23 +339,23 @@ static int pcm512x_set_reg_sub_switch(struct snd_kcontrol *kcontrol, + static const DECLARE_TLV_DB_SCALE(digital_tlv_sub, -10350, 50, 1); + + static const struct snd_kcontrol_new allo_piano_controls[] = { +- SOC_ENUM_EXT("Subwoofer mode", ++ SOC_ENUM_EXT("Subwoofer mode Route", + allo_piano_mode_enum, + snd_allo_piano_mode_get, + snd_allo_piano_mode_put), + +- SOC_ENUM_EXT("Lowpass", allo_piano_enum, ++ SOC_ENUM_EXT("Lowpass Route", allo_piano_enum, + snd_allo_piano_lowpass_get, + snd_allo_piano_lowpass_put), + +- SOC_DOUBLE_R_EXT_TLV("Subwoofer Digital Playback Volume", ++ SOC_DOUBLE_R_EXT_TLV("Subwoofer Playback Volume", + PCM512x_DIGITAL_VOLUME_2, + PCM512x_DIGITAL_VOLUME_3, 0, 255, 1, + pcm512x_get_reg_sub, + pcm512x_set_reg_sub, + digital_tlv_sub), + +- SOC_DOUBLE_EXT("Subwoofer Digital Playback Switch", ++ SOC_DOUBLE_EXT("Subwoofer Playback Switch", + PCM512x_MUTE, + PCM512x_RQML_SHIFT, + PCM512x_RQMR_SHIFT, 1, 1, +@@ -302,11 +365,20 @@ static const struct snd_kcontrol_new allo_piano_controls[] = { + + static int snd_allo_piano_dac_init(struct snd_soc_pcm_runtime *rtd) + { +- rtd_glb = rtd; ++ struct snd_soc_card *card = rtd->card; ++ struct glb_pool *glb_ptr; ++ ++ glb_ptr = kmalloc(sizeof(struct glb_pool), GFP_KERNEL); ++ if (!glb_ptr) ++ return -ENOMEM; ++ ++ memset(glb_ptr, 0x00, sizeof(glb_ptr)); ++ card->drvdata = glb_ptr; ++ ++ mutex_init(&glb_ptr->lock); + + if (digital_gain_0db_limit) { + int ret; +- struct snd_soc_card *card = rtd->card; + + ret = snd_soc_limit_volume(card, "Digital Playback Volume", + 207); +@@ -318,7 +390,71 @@ static int snd_allo_piano_dac_init(struct snd_soc_pcm_runtime *rtd) + return 0; + } + +-static int snd_allo_piano_dac_hw_params(struct snd_pcm_substream *substream, ++static void snd_allo_piano_gpio_mute(struct snd_soc_card *card) ++{ ++ if (mute_gpio[0]) ++ gpiod_set_value_cansleep(mute_gpio[0], 1); ++ ++ if (mute_gpio[1]) ++ gpiod_set_value_cansleep(mute_gpio[1], 1); ++} ++ ++static void snd_allo_piano_gpio_unmute(struct snd_soc_card *card) ++{ ++ if (mute_gpio[0]) ++ gpiod_set_value_cansleep(mute_gpio[0], 0); ++ ++ if (mute_gpio[1]) ++ gpiod_set_value_cansleep(mute_gpio[1], 0); ++} ++ ++static int snd_allo_piano_set_bias_level(struct snd_soc_card *card, ++ struct snd_soc_dapm_context *dapm, enum snd_soc_bias_level level) ++{ ++ struct snd_soc_pcm_runtime *rtd; ++ struct snd_soc_dai *codec_dai; ++ ++ rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); ++ codec_dai = rtd->codec_dai; ++ ++ if (dapm->dev != codec_dai->dev) ++ return 0; ++ ++ switch (level) { ++ case SND_SOC_BIAS_PREPARE: ++ if (dapm->bias_level != SND_SOC_BIAS_STANDBY) ++ break; ++ /* UNMUTE DAC */ ++ snd_allo_piano_gpio_unmute(card); ++ break; ++ ++ case SND_SOC_BIAS_STANDBY: ++ if (dapm->bias_level != SND_SOC_BIAS_PREPARE) ++ break; ++ /* MUTE DAC */ ++ snd_allo_piano_gpio_mute(card); ++ break; ++ ++ default: ++ break; ++ } ++ ++ return 0; ++} ++ ++static int snd_allo_piano_dac_startup( ++ struct snd_pcm_substream *substream) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_card *card = rtd->card; ++ ++ snd_allo_piano_gpio_mute(card); ++ ++ return 0; ++} ++ ++static int snd_allo_piano_dac_hw_params( ++ struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params) + { + struct snd_soc_pcm_runtime *rtd = substream->private_data; +@@ -327,17 +463,49 @@ static int snd_allo_piano_dac_hw_params(struct snd_pcm_substream *substream, + snd_pcm_format_physical_width(params_format(params)); + unsigned int rate = params_rate(params); + struct snd_soc_card *card = rtd->card; +- int ret = 0; ++ struct glb_pool *glb_ptr = card->drvdata; ++ int ret = 0, val = 0, dac; ++ ++ for (dac = 0; (glb_mclk && dac < 2); dac++) { ++ /* Configure the PLL clock reference for both the Codecs */ ++ val = snd_soc_read(rtd->codec_dais[dac]->codec, ++ PCM512x_RATE_DET_4); ++ if (val < 0) { ++ dev_err(rtd->codec_dais[dac]->codec->dev, ++ "Failed to read register PCM512x_RATE_DET_4\n"); ++ return val; ++ } ++ ++ if (val & 0x40) { ++ snd_soc_write(rtd->codec_dais[dac]->codec, ++ PCM512x_PLL_REF, ++ PCM512x_SREF_BCK); ++ ++ dev_info(rtd->codec_dais[dac]->codec->dev, ++ "Setting BCLK as input clock & Enable PLL\n"); ++ } else { ++ snd_soc_write(rtd->codec_dais[dac]->codec, ++ PCM512x_PLL_EN, ++ 0x00); ++ ++ snd_soc_write(rtd->codec_dais[dac]->codec, ++ PCM512x_PLL_REF, ++ PCM512x_SREF_SCK); ++ ++ dev_info(rtd->codec_dais[dac]->codec->dev, ++ "Setting SCLK as input clock & disabled PLL\n"); ++ } ++ } + +- rtd_glb = rtd; /* TODO */ + if (digital_gain_0db_limit) { + ret = snd_soc_limit_volume(card, +- "Subwoofer Digital Playback Volume", 207); ++ "Subwoofer Playback Volume", 207); + if (ret < 0) + dev_warn(card->dev, "Failed to set volume limit: %d\n", + ret); + } +- ret = snd_allo_piano_dsp_program(rtd, set_mode, rate, set_lowpass); ++ ret = snd_allo_piano_dsp_program(rtd, glb_ptr->set_mode, rate, ++ glb_ptr->set_lowpass); + if (ret < 0) + return ret; + +@@ -346,9 +514,21 @@ static int snd_allo_piano_dac_hw_params(struct snd_pcm_substream *substream, + return ret; + } + ++static int snd_allo_piano_dac_prepare( ++ struct snd_pcm_substream *substream) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_card *card = rtd->card; ++ ++ snd_allo_piano_gpio_unmute(card); ++ return 0; ++} ++ + /* machine stream operations */ + static struct snd_soc_ops snd_allo_piano_dac_ops = { ++ .startup = snd_allo_piano_dac_startup, + .hw_params = snd_allo_piano_dac_hw_params, ++ .prepare = snd_allo_piano_dac_prepare, + }; + + static struct snd_soc_dai_link_component allo_piano_2_1_codecs[] = { +@@ -388,11 +568,11 @@ static struct snd_soc_card snd_allo_piano_dac = { + + static int snd_allo_piano_dac_probe(struct platform_device *pdev) + { +- int ret = 0, i = 0; + struct snd_soc_card *card = &snd_allo_piano_dac; ++ int ret = 0, i = 0; + + card->dev = &pdev->dev; +- snd_allo_piano_dac.dev = &pdev->dev; ++ platform_set_drvdata(pdev, &snd_allo_piano_dac); + + if (pdev->dev.of_node) { + struct device_node *i2s_node; +@@ -400,7 +580,7 @@ static int snd_allo_piano_dac_probe(struct platform_device *pdev) + + dai = &snd_allo_piano_dac_dai[0]; + i2s_node = of_parse_phandle(pdev->dev.of_node, +- "i2s-controller", 0); ++ "i2s-controller", 0); + if (i2s_node) { + for (i = 0; i < card->num_links; i++) { + dai->cpu_dai_name = NULL; +@@ -413,6 +593,9 @@ static int snd_allo_piano_dac_probe(struct platform_device *pdev) + !of_property_read_bool(pdev->dev.of_node, + "allo,24db_digital_gain"); + ++ glb_mclk = of_property_read_bool(pdev->dev.of_node, ++ "allo,glb_mclk"); ++ + allo_piano_2_1_codecs[0].of_node = + of_parse_phandle(pdev->dev.of_node, "audio-codec", 0); + if (!allo_piano_2_1_codecs[0].of_node) { +@@ -428,18 +611,51 @@ static int snd_allo_piano_dac_probe(struct platform_device *pdev) + "Property 'audio-codec' missing or invalid\n"); + return -EINVAL; + } +- } + +- ret = snd_soc_register_card(&snd_allo_piano_dac); +- if (ret < 0) +- dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", +- ret); ++ mute_gpio[0] = devm_gpiod_get_optional(&pdev->dev, "mute1", ++ GPIOD_OUT_LOW); ++ if (IS_ERR(mute_gpio[0])) { ++ ret = PTR_ERR(mute_gpio[0]); ++ dev_err(&pdev->dev, ++ "failed to get mute1 gpio6: %d\n", ret); ++ return ret; ++ } + +- return ret; ++ mute_gpio[1] = devm_gpiod_get_optional(&pdev->dev, "mute2", ++ GPIOD_OUT_LOW); ++ if (IS_ERR(mute_gpio[1])) { ++ ret = PTR_ERR(mute_gpio[1]); ++ dev_err(&pdev->dev, ++ "failed to get mute2 gpio25: %d\n", ret); ++ return ret; ++ } ++ ++ if (mute_gpio[0] && mute_gpio[1]) ++ snd_allo_piano_dac.set_bias_level = ++ snd_allo_piano_set_bias_level; ++ ++ ret = snd_soc_register_card(&snd_allo_piano_dac); ++ if (ret < 0) { ++ dev_err(&pdev->dev, ++ "snd_soc_register_card() failed: %d\n", ret); ++ return ret; ++ } ++ ++ if ((mute_gpio[0]) && (mute_gpio[1])) ++ snd_allo_piano_gpio_mute(&snd_allo_piano_dac); ++ ++ return 0; ++ } ++ ++ return -EINVAL; + } + + static int snd_allo_piano_dac_remove(struct platform_device *pdev) + { ++ struct snd_soc_card *card = platform_get_drvdata(pdev); ++ ++ kfree(&card->drvdata); ++ snd_allo_piano_gpio_mute(&snd_allo_piano_dac); + return snd_soc_unregister_card(&snd_allo_piano_dac); + } + diff --git a/tools/RPi/gen-rpi-linux-patch.sh b/tools/RPi/gen-rpi-linux-patch.sh index 4bb014f94e..cd71606525 100755 --- a/tools/RPi/gen-rpi-linux-patch.sh +++ b/tools/RPi/gen-rpi-linux-patch.sh @@ -14,6 +14,8 @@ BRANCH="$1" while [ $# -gt 1 ]; do if [ "${2,,}" == "rebase" ]; then REBASE="_rebase" + elif [[ ${2,,} =~ [_-]rebase ]]; then + REBASE="$2" elif [[ ${2} =~ ^[0-9a-f]*$ ]]; then BASEREV="${2}" fi @@ -24,10 +26,11 @@ usage() { local me="$(basename $0)" - echo "Usage: ${me} | [rebase] [baserev]" + echo "Usage: ${me} | [[_-]rebase] [baserev]" echo echo "Example: 4.4 (for rpi-4.4.y) or 4.4.6 - specifying an exact kernel version avoids fetching the upstream repo" echo " 4.4 rebase - use rpi-4.4.y_rebase branch" + echo " 4.4 -rebase - use rpi-4.4.y-rebase branch" echo " 4.6-rc6" echo " 4.7 523d939ef98fd712632d93a5a2b588e477a7565e" echo " 4.7.0"