From 713fb8df7a75529b893fc7c81299dc1084a0b9a6 Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Mon, 10 Apr 2017 17:41:46 +0100 Subject: [PATCH 1/6] tools: fix generation script to support variable rebase suffix --- tools/RPi/gen-rpi-linux-patch.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/RPi/gen-rpi-linux-patch.sh b/tools/RPi/gen-rpi-linux-patch.sh index c82d43a108..412ada97ef 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" From 861e3bd8702fd4134eb069efe23be161620770c3 Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Mon, 10 Apr 2017 17:41:46 +0100 Subject: [PATCH 2/6] RPi: Enable GoogleVoiceHAT, ALLO_PIANO and ALLO_BOSS soundcards --- projects/RPi/devices/RPi/linux/linux.arm.conf | 5 ++++- projects/RPi/devices/RPi2/linux/linux.arm.conf | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/projects/RPi/devices/RPi/linux/linux.arm.conf b/projects/RPi/devices/RPi/linux/linux.arm.conf index e071f25864..9550d8c07a 100644 --- a/projects/RPi/devices/RPi/linux/linux.arm.conf +++ b/projects/RPi/devices/RPi/linux/linux.arm.conf @@ -1,6 +1,6 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/arm 4.10.5 Kernel Configuration +# Linux/arm 4.10.6 Kernel Configuration # CONFIG_ARM=y CONFIG_ARM_HAS_SG_CHAIN=y @@ -2814,6 +2814,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 @@ -2833,7 +2834,9 @@ 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_BCM2708_SOC_SLICE=m CONFIG_SND_PISOUND=m # CONFIG_SND_DESIGNWARE_I2S is not set diff --git a/projects/RPi/devices/RPi2/linux/linux.arm.conf b/projects/RPi/devices/RPi2/linux/linux.arm.conf index bdb5010c3b..cb8e2d8335 100644 --- a/projects/RPi/devices/RPi2/linux/linux.arm.conf +++ b/projects/RPi/devices/RPi2/linux/linux.arm.conf @@ -1,6 +1,6 @@ # # Automatically generated file; DO NOT EDIT. -# Linux/arm 4.10.5 Kernel Configuration +# Linux/arm 4.10.6 Kernel Configuration # CONFIG_ARM=y CONFIG_ARM_HAS_SG_CHAIN=y @@ -2905,6 +2905,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 @@ -2924,7 +2925,9 @@ 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_BCM2708_SOC_SLICE=m CONFIG_SND_PISOUND=m # CONFIG_SND_DESIGNWARE_I2S is not set From 3830ef8012d0379563f6a4545908ec0429af7790 Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Mon, 10 Apr 2017 17:41:46 +0100 Subject: [PATCH 3/6] linux: update to linux-4.10.8 --- packages/linux/package.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/linux/package.mk b/packages/linux/package.mk index e35d9398cd..8ed9c051d7 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.10.6" + PKG_VERSION="4.10.8" PKG_URL="http://www.kernel.org/pub/linux/kernel/v4.x/$PKG_NAME-$PKG_VERSION.tar.xz" PKG_PATCH_DIRS="default" ;; From 216be9ea84785beb61fd097b25ed57b0360f604f Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Mon, 10 Apr 2017 17:41:46 +0100 Subject: [PATCH 4/6] RPi: update to firmware-b038854 --- packages/graphics/bcm2835-driver/package.mk | 2 +- packages/tools/bcm2835-bootloader/package.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/graphics/bcm2835-driver/package.mk b/packages/graphics/bcm2835-driver/package.mk index 41f5ec4d82..b10a8a6076 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="76fc4dd" +PKG_VERSION="b038854" PKG_ARCH="any" PKG_LICENSE="nonfree" PKG_SITE="http://www.broadcom.com" diff --git a/packages/tools/bcm2835-bootloader/package.mk b/packages/tools/bcm2835-bootloader/package.mk index 92d75b2fc2..023e74edcd 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="76fc4dd" +PKG_VERSION="b038854" PKG_ARCH="arm" PKG_LICENSE="nonfree" PKG_SITE="http://www.broadcom.com" From 3ff8bf86e76854a57227d0c281c2a57f59836c8c Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Mon, 10 Apr 2017 17:41:46 +0100 Subject: [PATCH 5/6] linux: update to linux-4.10.9 --- packages/linux/package.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/linux/package.mk b/packages/linux/package.mk index 8ed9c051d7..5300c9c798 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.10.8" + PKG_VERSION="4.10.9" PKG_URL="http://www.kernel.org/pub/linux/kernel/v4.x/$PKG_NAME-$PKG_VERSION.tar.xz" PKG_PATCH_DIRS="default" ;; From 10d78d0d3579890a3c1f63f237acb9f2e4b76975 Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Mon, 10 Apr 2017 17:41:46 +0100 Subject: [PATCH 6/6] RPi: update linux support patch for linux 4.10.9 --- .../patches/linux/linux-01-RPi_support.patch | 4294 +++++++++++++++-- 1 file changed, 3892 insertions(+), 402 deletions(-) diff --git a/projects/RPi/patches/linux/linux-01-RPi_support.patch b/projects/RPi/patches/linux/linux-01-RPi_support.patch index 1dfe8fb94a..8f0f5912e5 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 98ddca5812e4858138ee66d44f0ab6a2ba43f960 Mon Sep 17 00:00:00 2001 +From 89dadd30769462cf8f53757a9c6d0a99357a20bd Mon Sep 17 00:00:00 2001 From: Steve Glendinning Date: Thu, 19 Feb 2015 18:47:12 +0000 -Subject: [PATCH 001/197] smsx95xx: fix crimes against truesize +Subject: [PATCH 001/205] 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 5d4217373d0193bab05806a1390ced0866738438 Mon Sep 17 00:00:00 2001 +From efb7470e3215b68a353ff289dd2169401f9b9627 Mon Sep 17 00:00:00 2001 From: Sam Nazarko Date: Fri, 1 Apr 2016 17:27:21 +0100 -Subject: [PATCH 002/197] smsc95xx: Experimental: Enable turbo_mode and +Subject: [PATCH 002/205] 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 a64671d646558545fb7cd6e9c40f3d96f2d46283 Mon Sep 17 00:00:00 2001 +From 0381daf05402920828aba3cc890842f2dac68fd4 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 17:26:38 +0000 -Subject: [PATCH 003/197] Allow mac address to be set in smsc95xx +Subject: [PATCH 003/205] 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 fcb903cad0ca57a88d92ce5bdeb7f7cebffe2dbe Mon Sep 17 00:00:00 2001 +From c908aa4e3407f3f7106a9486c1614666c43b4b1b Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 13 Mar 2015 12:43:36 +0000 -Subject: [PATCH 004/197] Protect __release_resource against resources without +Subject: [PATCH 004/205] 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 8d75ff295a68056e11103250ea1dff6bbb30fdd7 Mon Sep 17 00:00:00 2001 +From efddcc014b8b5b7331c4bb3ad197d7601849c01b Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 18 Dec 2014 16:07:15 -0800 -Subject: [PATCH 005/197] mm: Remove the PFN busy warning +Subject: [PATCH 005/205] mm: Remove the PFN busy warning See commit dae803e165a11bc88ca8dbc07a11077caf97bbcb -- the warning is expected sometimes when using CMA. However, that commit still spams @@ -252,10 +252,10 @@ index 1a5f6655958e16ec09584c79405991dc248d2852..8068e8f926d87c02ac60f583d9b4cdef goto done; } -From 816598fb3a71d5139532097ad4e7a31cc6e45863 Mon Sep 17 00:00:00 2001 +From 3f6a1c1bf0ce1cca27569e072bb3ca42fefab7a4 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 4 Dec 2015 17:41:50 +0000 -Subject: [PATCH 006/197] irq-bcm2836: Prevent spurious interrupts, and trap +Subject: [PATCH 006/205] 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 e7463e3c08143acae3e8cc5682f918c6a0b07ebd..a8db33b50ad9ff83d284fa54fe4d3b65 #endif } else if (stat) { -From 9b028ff3292996815077a7db3c40fe76326ba494 Mon Sep 17 00:00:00 2001 +From 6fcb12f9d9578ad59ec131b0ea9b17151073a5a5 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/197] irqchip: bcm2835: Add FIQ support +Subject: [PATCH 007/205] 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 58fca041a5f099d8afaf568cc4e19d70f3284b87 Mon Sep 17 00:00:00 2001 +From a599690f54e2476a9f385b85c0a38c06a08a61d8 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/197] irqchip: irq-bcm2835: Add 2836 FIQ support +Subject: [PATCH 008/205] 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 7767325883e527048cf084e27a5ddfe6cc1dea44 Mon Sep 17 00:00:00 2001 +From d9433d8cf3a7a7cc1a1c1008fc93ad8a343f10c8 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Jul 2015 10:26:09 +0100 -Subject: [PATCH 009/197] spidev: Add "spidev" compatible string to silence +Subject: [PATCH 009/205] spidev: Add "spidev" compatible string to silence warning See: https://github.com/raspberrypi/linux/issues/1054 @@ -540,10 +540,10 @@ index 9e2e099baf8ca5cc6510912a36d4ca03daeb8273..e59640942826db2ea14d0bde0ff5ab22 }; MODULE_DEVICE_TABLE(of, spidev_dt_ids); -From f73ce9bacac21cd49b03f3434b7a0b12cdbc3d74 Mon Sep 17 00:00:00 2001 +From bb9350c60c8f9f53fd59a8e5916112ca85c24794 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 30 Jun 2015 14:12:42 +0100 -Subject: [PATCH 010/197] serial: 8250: Don't crash when nr_uarts is 0 +Subject: [PATCH 010/205] serial: 8250: Don't crash when nr_uarts is 0 --- drivers/tty/serial/8250/8250_core.c | 2 ++ @@ -563,10 +563,10 @@ index 76e03a7de9cc3d790a230948f599ef2db4b93249..0a172c2e6fa288de1e080463e897ea85 for (i = 0; i < nr_uarts; i++) { struct uart_8250_port *up = &serial8250_ports[i]; -From 9b93b098a50e4ec255f24182b0ca0aa1b16b9492 Mon Sep 17 00:00:00 2001 +From ee4b51cc466e457402fc5e60bf316b874e96f78a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 3 Jan 2017 18:25:01 +0000 -Subject: [PATCH 011/197] Revert "pinctrl: bcm2835: switch to GPIOLIB_IRQCHIP" +Subject: [PATCH 011/205] Revert "pinctrl: bcm2835: switch to GPIOLIB_IRQCHIP" This reverts commit 85ae9e512f437cd09bf61564bdba29ab88bab3e3. --- @@ -860,10 +860,10 @@ index 85d0091128644c446aed878e87769e82c77c3ebf..4f2621272bfd5cbc0d691d2fabe89e2e if (IS_ERR(pc->pctl_dev)) { gpiochip_remove(&pc->gpio_chip); -From b735c10201c52989a7af2716865ca5b8cb98cebd Mon Sep 17 00:00:00 2001 +From 53e7a001e701d9c968504a1d8d0b016c18c42652 Mon Sep 17 00:00:00 2001 From: notro Date: Thu, 10 Jul 2014 13:59:47 +0200 -Subject: [PATCH 012/197] pinctrl-bcm2835: Set base to 0 give expected gpio +Subject: [PATCH 012/205] pinctrl-bcm2835: Set base to 0 give expected gpio numbering Signed-off-by: Noralf Tronnes @@ -885,10 +885,10 @@ index 4f2621272bfd5cbc0d691d2fabe89e2ee428d6db..5b7cb4c415e19f98e25b221ab0ad36b6 .can_sleep = false, }; -From 81ce0ff1af95b08687ace5d50bc1b2f56a8cba4c Mon Sep 17 00:00:00 2001 +From cff5be96f67aca139c96f30eb1058b24aadb15a5 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 26 Feb 2015 09:58:22 +0000 -Subject: [PATCH 013/197] pinctrl-bcm2835: Only request the interrupts listed +Subject: [PATCH 013/205] pinctrl-bcm2835: Only request the interrupts listed in the DTB Although the GPIO controller can generate three interrupts (four counting @@ -915,10 +915,10 @@ index 5b7cb4c415e19f98e25b221ab0ad36b6885dae4c..6351fe7f8e314ac5ebb102dd20847b38 pc->irq_data[i].irqgroup = i; -From 6bcd587a3277ac3a0faffabc483778e785e91b93 Mon Sep 17 00:00:00 2001 +From 04e6a8e84aa2c3574c66380434816fdb6751fa74 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 24 Jun 2015 14:10:44 +0100 -Subject: [PATCH 014/197] spi-bcm2835: Support pin groups other than 7-11 +Subject: [PATCH 014/205] 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 @@ -999,10 +999,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 a193bb987035670adebb0343ed4a9ec03e6ffbab Mon Sep 17 00:00:00 2001 +From 6b0647cff1fd3c05ff69ad73d56865c8d5b4ca7f Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 1 Jul 2016 22:09:24 +0100 -Subject: [PATCH 015/197] spi-bcm2835: Disable forced software CS +Subject: [PATCH 015/205] 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 @@ -1036,10 +1036,10 @@ index 5dfe20ffc2866fa6789825016c585175a29705b6..8493474d286f7a1ac6454a22c61c8c2c return 0; } -From 70db70329aad60952340540a5fc2296cc4872360 Mon Sep 17 00:00:00 2001 +From bc2bf0667ac142bda0a88c6d0125afc02d103981 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 8 Nov 2016 21:35:38 +0000 -Subject: [PATCH 016/197] spi-bcm2835: Remove unused code +Subject: [PATCH 016/205] spi-bcm2835: Remove unused code --- drivers/spi/spi-bcm2835.c | 61 ----------------------------------------------- @@ -1127,10 +1127,10 @@ index 8493474d286f7a1ac6454a22c61c8c2cef9121bf..33d75ad38a7f77d085321ace9101900a } -From f76f950b3e05fb93ac080a1b5fa324d19ed4375e Mon Sep 17 00:00:00 2001 +From 09ada1636f805035c0d21047972b9e6453b648d2 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 017/197] ARM: bcm2835: Set Serial number and Revision +Subject: [PATCH 017/205] ARM: bcm2835: Set Serial number and Revision MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -1183,10 +1183,10 @@ index 0c1edfc98696da0e0bb7f4a18cdfbcdd27a9795d..8f152266ba9b470df2eaaed9ebcf158e static const char * const bcm2835_compat[] = { -From c08f41cc6f47177c79d2361c17df15cdd4744795 Mon Sep 17 00:00:00 2001 +From 4608ee7b3f7a981ff7c02664fbea9dce2f798b8c 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 018/197] dmaengine: bcm2835: Load driver early and support +Subject: [PATCH 018/205] dmaengine: bcm2835: Load driver early and support legacy API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -1289,10 +1289,10 @@ index e18dc596cf2447fa9ef7e41b62d9396e29043426..80d35f760b4a4a51e60c355a84d538ba MODULE_ALIAS("platform:bcm2835-dma"); MODULE_DESCRIPTION("BCM2835 DMA engine driver"); -From 410a9e9e6c5c26390ae2412349fbbf756baa076f Mon Sep 17 00:00:00 2001 +From 93fe848bc1014552c503a33159879ee5e9b76463 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 25 Jan 2016 17:25:12 +0000 -Subject: [PATCH 019/197] firmware: Updated mailbox header +Subject: [PATCH 019/205] firmware: Updated mailbox header --- include/soc/bcm2835/raspberrypi-firmware.h | 9 +++++++++ @@ -1353,10 +1353,10 @@ index cb979ad90401e299344dd5fae38d09c489d8bd58..30fb37fe175df604a738258a2a632bca RPI_FIRMWARE_VCHIQ_INIT = 0x00048010, -From 79ad0c285374c945d7b5a97aa79e690f2f932138 Mon Sep 17 00:00:00 2001 +From d9439af751c350c29a6923da191df377a6803e76 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 15 Jun 2016 16:48:41 +0100 -Subject: [PATCH 020/197] rtc: Add SPI alias for pcf2123 driver +Subject: [PATCH 020/205] rtc: Add SPI alias for pcf2123 driver Without this alias, Device Tree won't cause the driver to be loaded. @@ -1376,10 +1376,10 @@ index 8895f77726e8da5444afcd602dceff8f25a9b3fd..1833b8853ceb0e6147cceb93a00e558c MODULE_LICENSE("GPL"); +MODULE_ALIAS("spi:rtc-pcf2123"); -From e490d9f5897fde5c25c80377270795ba9ba392c7 Mon Sep 17 00:00:00 2001 +From 278a63c53616eabd17fe4fd244c48a1e21aa917c 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 021/197] watchdog: bcm2835: Support setting reboot partition +Subject: [PATCH 021/205] watchdog: bcm2835: Support setting reboot partition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -1503,10 +1503,10 @@ index c32c45bd8b097889c8f322255fa63c8ed507d6ab..ef02dfa23aa774e1cdf75f935c5de985 register_restart_handler(&wdt->restart_handler); if (pm_power_off == NULL) -From faa9ad5e631548336033c521e84daf75075e2668 Mon Sep 17 00:00:00 2001 +From 2dd240a540383c3c885cac574a0d3ae515febe59 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 5 Apr 2016 19:40:12 +0100 -Subject: [PATCH 022/197] reboot: Use power off rather than busy spinning when +Subject: [PATCH 022/205] reboot: Use power off rather than busy spinning when halt is requested --- @@ -1529,10 +1529,10 @@ index 3fa867a2aae672755c6ce6448f4148c989dbf964..80dca8dcd6709034b643c6a3f35729e0 /* -From cc5e7688f3ed3388d9244ea43ceeb5b6ad8ea871 Mon Sep 17 00:00:00 2001 +From cfe24e5c8aaf64338cf89d2420e878962053c76c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 9 Nov 2016 13:02:52 +0000 -Subject: [PATCH 023/197] bcm: Make RASPBERRYPI_POWER depend on PM +Subject: [PATCH 023/205] bcm: Make RASPBERRYPI_POWER depend on PM --- drivers/soc/bcm/Kconfig | 1 + @@ -1551,10 +1551,10 @@ index a39b0d58ddd0fdf0ac1cc7295f8aafb12546e226..e037a6dd79d1881a09e3ca9115782709 help This enables support for the RPi power domains which can be enabled -From c677fac644961d896477a635c044a3bad411ea35 Mon Sep 17 00:00:00 2001 +From 4985db704f0037236ecc8798dedb9cdc00a55417 Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Fri, 2 Sep 2016 16:45:27 +0100 -Subject: [PATCH 024/197] Register the clocks early during the boot process, so +Subject: [PATCH 024/205] 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. @@ -1599,10 +1599,10 @@ index 0d14409097e777ce4546de30e9278fdebf74ec44..093694e00caec6e133eb26712f890691 MODULE_AUTHOR("Eric Anholt "); MODULE_DESCRIPTION("BCM2835 clock driver"); -From 79e9e0dd1a08b7ed6788e41f69d8d22d537e9acc Mon Sep 17 00:00:00 2001 +From 85c69bab8c2b75529746ece517cd4c367b1f5358 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 6 Dec 2016 17:05:39 +0000 -Subject: [PATCH 025/197] bcm2835-rng: Avoid initialising if already enabled +Subject: [PATCH 025/205] bcm2835-rng: Avoid initialising if already enabled Avoids the 0x40000 cycles of warmup again if firmware has already used it --- @@ -1628,10 +1628,10 @@ index 574211a495491d9d6021dcaefe4274a63ed02055..e66c0fca8c6090e32f72796c0877a1cf err = hwrng_register(&bcm2835_rng_ops); if (err) { -From f6cca86ac3e55c464e24a4773a0b3af2f47738ec Mon Sep 17 00:00:00 2001 +From 5e54c7da6a8c38c7fe653ef823ddf91cb67aaccd Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 24 Aug 2016 16:28:44 +0100 -Subject: [PATCH 026/197] kbuild: Ignore dtco targets when filtering symbols +Subject: [PATCH 026/205] kbuild: Ignore dtco targets when filtering symbols --- scripts/Kbuild.include | 2 +- @@ -1651,10 +1651,10 @@ index 179219845dfcdfbeb586d12c5ec1296095d9fbf4..e0743e44f84188667a0c322e8c3d36f1 esac | tr ";" "\n" | sed -rn 's/^.*=== __KSYM_(.*) ===.*$$/KSYM_\1/p' -From 1812cbce372bf050c5e7d1a88d253cfede957472 Mon Sep 17 00:00:00 2001 +From 7aec9bc7eb5ea70ad5a6e55f223a7cad989d05d1 Mon Sep 17 00:00:00 2001 From: Robert Tiemann Date: Mon, 20 Jul 2015 11:01:25 +0200 -Subject: [PATCH 027/197] BCM2835_DT: Fix I2S register map +Subject: [PATCH 027/205] BCM2835_DT: Fix I2S register map --- Documentation/devicetree/bindings/dma/brcm,bcm2835-dma.txt | 4 ++-- @@ -1692,10 +1692,10 @@ index 65783de0aedf3da79adc36fd077b7a89954ddb6b..a89fe4220fdc3f26f75ee66daf187554 dmas = <&dma 2>, <&dma 3>; -From adc6729489ef9f9916ede33bbeaafe4946fd074b Mon Sep 17 00:00:00 2001 +From ff33941a43b9ffc7e0ba4b8c61292b034bb025a7 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 12 May 2013 12:24:19 +0100 -Subject: [PATCH 028/197] Main bcm2708/bcm2709 linux port +Subject: [PATCH 028/205] Main bcm2708/bcm2709 linux port MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -1902,10 +1902,10 @@ index cfb4b4496dd9f61362dea012176c146120fada07..d9c6c217c4d6a2408abe2665bf7f2700 MODULE_AUTHOR("Lubomir Rintel "); MODULE_DESCRIPTION("BCM2835 mailbox IPC driver"); -From 15881f2e4946653aef1018d82ca9ed0552e8cb9e Mon Sep 17 00:00:00 2001 +From 2bc6c5b85262d62fbc887915b6fc9d31021a60df Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 19:46:17 +0100 -Subject: [PATCH 029/197] Add dwc_otg driver +Subject: [PATCH 029/205] Add dwc_otg driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -2607,7 +2607,7 @@ index bd3e0c5a6db25e7a162d922c6508de1ad0b68025..15c80079c97bb9eeec478932af88a293 return i; } diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c -index a56c75e09786d5fa1e064a8e56e58e4095e4d716..466eeaeee74b271946384e6bfde8a5fd1c722f4f 100644 +index 48fbf523d186e21802ad21a1590ab2e4a9fb7f87..f3dbdbe0a779490316d3c90099a1864cad71b239 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -5018,7 +5018,7 @@ static void port_event(struct usb_hub *hub, int port1) @@ -62962,10 +62962,10 @@ index 0000000000000000000000000000000000000000..cdc9963176e5a4a0d5250613b61e26c5 +test_main(); +0; -From a63fa21302176202b8f41ee457a9bb4edd884b29 Mon Sep 17 00:00:00 2001 +From e8acef74f0dd0803701ec2e6daba26319e2cfd07 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 17:06:34 +0100 -Subject: [PATCH 030/197] bcm2708 framebuffer driver +Subject: [PATCH 030/205] bcm2708 framebuffer driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -66424,10 +66424,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 aac2c0619d0960feaef0bc1f5812b94d6ca9a13a Mon Sep 17 00:00:00 2001 +From 70392df4f0ef28d386047da06706c18edde69ece Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:22:53 +0100 -Subject: [PATCH 031/197] dmaengine: Add support for BCM2708 +Subject: [PATCH 031/205] dmaengine: Add support for BCM2708 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -67058,10 +67058,10 @@ index 0000000000000000000000000000000000000000..c5bfff2765be4606077e6c8af73040ec + +#endif /* _PLAT_BCM2708_DMA_H */ -From 51c95ad27cb3690c2a437754198c68e4ae6dfa00 Mon Sep 17 00:00:00 2001 +From 37f258f53d3dace314212bd80dcd71444fdd19ae Mon Sep 17 00:00:00 2001 From: gellert Date: Fri, 15 Aug 2014 16:35:06 +0100 -Subject: [PATCH 032/197] MMC: added alternative MMC driver +Subject: [PATCH 032/205] MMC: added alternative MMC driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -68811,10 +68811,10 @@ index 0000000000000000000000000000000000000000..4fe8d1fe44578fbefcd48f8c327ba3d0 +MODULE_LICENSE("GPL v2"); +MODULE_AUTHOR("Gellert Weisz"); -From 94d5b177cba908fb269d696a9bcc7436da553feb Mon Sep 17 00:00:00 2001 +From a3ea8afe67e33f024422ef683c2d8845c371dd63 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 25 Mar 2015 17:49:47 +0000 -Subject: [PATCH 033/197] Adding bcm2835-sdhost driver, and an overlay to +Subject: [PATCH 033/205] Adding bcm2835-sdhost driver, and an overlay to enable it BCM2835 has two SD card interfaces. This driver uses the other one. @@ -71219,10 +71219,10 @@ index 0000000000000000000000000000000000000000..a9bc79bfdbb71807819dfe2d8f165144 +MODULE_LICENSE("GPL v2"); +MODULE_AUTHOR("Phil Elwell"); -From 0e5e3fbea4930f677046c8a7dcbd78dcaf1bcca7 Mon Sep 17 00:00:00 2001 +From bce534c287cea6200a54d82482d6e623df03c314 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 11 May 2016 12:50:33 +0100 -Subject: [PATCH 034/197] mmc: Add MMC_QUIRK_ERASE_BROKEN for some cards +Subject: [PATCH 034/205] 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, @@ -71251,7 +71251,7 @@ Signed-off-by: Phil Elwell 3 files changed, 41 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c -index cb1698f268f19023429df520713f20a3de6f6d25..dbf7099242bb109b9fa989f029e75e408b2e26d4 100644 +index 7f4927a05be0ab0d4054e090ea5aa6fa7dbe80a7..3114c3ba207d21aaaa612f61a22845b5eb9cc399 100644 --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c @@ -125,6 +125,13 @@ static DEFINE_MUTEX(open_lock); @@ -71268,7 +71268,7 @@ index cb1698f268f19023429df520713f20a3de6f6d25..dbf7099242bb109b9fa989f029e75e40 static inline int mmc_blk_part_switch(struct mmc_card *card, struct mmc_blk_data *md); static int get_card_status(struct mmc_card *card, u32 *status, int retries); -@@ -2164,6 +2171,17 @@ static const struct mmc_fixup blk_fixups[] = +@@ -2165,6 +2172,17 @@ static const struct mmc_fixup blk_fixups[] = MMC_FIXUP("V10016", CID_MANFID_KINGSTON, CID_OEMID_ANY, add_quirk_mmc, MMC_QUIRK_TRIM_BROKEN), @@ -71286,7 +71286,7 @@ index cb1698f268f19023429df520713f20a3de6f6d25..dbf7099242bb109b9fa989f029e75e40 END_FIXUP }; -@@ -2171,6 +2189,7 @@ static int mmc_blk_probe(struct mmc_card *card) +@@ -2172,6 +2190,7 @@ static int mmc_blk_probe(struct mmc_card *card) { struct mmc_blk_data *md, *part_md; char cap_str[10]; @@ -71294,7 +71294,7 @@ index cb1698f268f19023429df520713f20a3de6f6d25..dbf7099242bb109b9fa989f029e75e40 /* * Check that the card supports the command class(es) we need. -@@ -2178,7 +2197,16 @@ static int mmc_blk_probe(struct mmc_card *card) +@@ -2179,7 +2198,16 @@ static int mmc_blk_probe(struct mmc_card *card) if (!(card->csd.cmdclass & CCC_BLOCK_READ)) return -ENODEV; @@ -71312,7 +71312,7 @@ index cb1698f268f19023429df520713f20a3de6f6d25..dbf7099242bb109b9fa989f029e75e40 md = mmc_blk_alloc(card); if (IS_ERR(md)) -@@ -2186,9 +2214,14 @@ static int mmc_blk_probe(struct mmc_card *card) +@@ -2187,9 +2215,14 @@ static int mmc_blk_probe(struct mmc_card *card) string_get_size((u64)get_capacity(md->disk), 512, STRING_UNITS_2, cap_str, sizeof(cap_str)); @@ -71358,10 +71358,10 @@ index 95d69d4982965aa30fb65d9ffecfad13f4e7be8f..a97b881a04f4b3294cf3ede393cde717 unsigned int erase_shift; /* if erase unit is power 2 */ unsigned int pref_erase; /* in sectors */ -From 8df312e1a6eba98d14ad247e7628b955f1e5f69b Mon Sep 17 00:00:00 2001 +From c5f59dafa94e117548ea7f3909a977a155d9d4fe Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:31:47 +0100 -Subject: [PATCH 035/197] cma: Add vc_cma driver to enable use of CMA +Subject: [PATCH 035/205] 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 @@ -72697,10 +72697,10 @@ index 0000000000000000000000000000000000000000..be2819d5d41f9d5ed65daf8eedb94c9e + +#endif /* VC_CMA_H */ -From ffeb0b1fcd31a592a9ed71be2c3871b13d0671f8 Mon Sep 17 00:00:00 2001 +From f82842a4ff8a2e49239d4c2111940f1bb57c8cce Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 26 Mar 2012 22:15:50 +0100 -Subject: [PATCH 036/197] bcm2708: alsa sound driver +Subject: [PATCH 036/205] bcm2708: alsa sound driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -75435,10 +75435,10 @@ index 0000000000000000000000000000000000000000..af3e6eb690113fc32ce9e06bd2f0f294 + +#endif // _VC_AUDIO_DEFS_H_ -From 9896769c606380e6c5520a90598e66b5d4eb88a1 Mon Sep 17 00:00:00 2001 +From baa22bcf6e967f45b60f7fbb628dc65771399fac Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 28 Oct 2016 15:36:43 +0100 -Subject: [PATCH 037/197] vc_mem: Add vc_mem driver for querying firmware +Subject: [PATCH 037/205] vc_mem: Add vc_mem driver for querying firmware memory addresses MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -75962,10 +75962,10 @@ index 0000000000000000000000000000000000000000..20a475377eb3078ea1ecaef2b24efc35 + +#endif /* _VC_MEM_H */ -From 7c3f85b3981e73f257ab818c63b8dd94ab5ccbf2 Mon Sep 17 00:00:00 2001 +From 9ee16548e59667c343bf94bad5e676ae86ac81b2 Mon Sep 17 00:00:00 2001 From: Tim Gover Date: Tue, 22 Jul 2014 15:41:04 +0100 -Subject: [PATCH 038/197] vcsm: VideoCore shared memory service for BCM2835 +Subject: [PATCH 038/205] vcsm: VideoCore shared memory service for BCM2835 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -80372,10 +80372,10 @@ index 0000000000000000000000000000000000000000..334f36d0d697b047df2922b5f2db67f3 + +#endif /* __VMCS_SM_IOCTL_H__INCLUDED__ */ -From e38549e618a69e2faaac3eb316fe20c17f117a64 Mon Sep 17 00:00:00 2001 +From 517c4c7941bc3cd7e43ab67251b40769e9663b9a Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Fri, 21 Aug 2015 23:14:48 +0100 -Subject: [PATCH 039/197] Add /dev/gpiomem device for rootless user GPIO access +Subject: [PATCH 039/205] Add /dev/gpiomem device for rootless user GPIO access Signed-off-by: Luke Wren @@ -80686,10 +80686,10 @@ index 0000000000000000000000000000000000000000..911f5b7393ed48ceed8751f06967ae64 +MODULE_DESCRIPTION("gpiomem driver for accessing GPIO from userspace"); +MODULE_AUTHOR("Luke Wren "); -From 0bca5877e9dd4be533f3751b50c862218cbdcf90 Mon Sep 17 00:00:00 2001 +From c4c23afa23d4d1358466d147fcc73fec9bba2006 Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Sat, 5 Sep 2015 01:14:45 +0100 -Subject: [PATCH 040/197] Add SMI driver +Subject: [PATCH 040/205] Add SMI driver Signed-off-by: Luke Wren --- @@ -82640,10 +82640,10 @@ index 0000000000000000000000000000000000000000..ee3a75edfc033eeb0d90a687ffb68b10 + +#endif /* BCM2835_SMI_H */ -From 7d36bf1dce8271a7998fe80e0d744376b10f32f5 Mon Sep 17 00:00:00 2001 +From 654bc49c1e71c879cf8dd5fe1e9d4636bcf2bcd1 Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Tue, 26 Apr 2016 14:59:21 +0000 -Subject: [PATCH 041/197] MISC: bcm2835: smi: use clock manager and fix reload +Subject: [PATCH 041/205] MISC: bcm2835: smi: use clock manager and fix reload issues Use clock manager instead of self-made clockmanager. @@ -82813,10 +82813,10 @@ index 63a4ea08b9930a3a31a985f0a1d969b488ed49ec..1261540703127d1d63b9f3c87042c6e5 return 0; } -From ddf7f8c78189d42ee65449d597aabb2f244cd7e6 Mon Sep 17 00:00:00 2001 +From 6a81d97f657fa1f7138287877234f54860dba16b Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Sat, 5 Sep 2015 01:16:10 +0100 -Subject: [PATCH 042/197] Add SMI NAND driver +Subject: [PATCH 042/205] Add SMI NAND driver Signed-off-by: Luke Wren --- @@ -83181,10 +83181,10 @@ index 0000000000000000000000000000000000000000..02adda6da18bd0ba9ab19a104975b79d + ("Driver for NAND chips using Broadcom Secondary Memory Interface"); +MODULE_AUTHOR("Luke Wren "); -From 4e270477bca3d8027df50e2d969d5a4f37a5ba37 Mon Sep 17 00:00:00 2001 +From c17e2ec8e1908864e5b550f64c7e4f603386a58a Mon Sep 17 00:00:00 2001 From: Aron Szabo Date: Sat, 16 Jun 2012 12:15:55 +0200 -Subject: [PATCH 043/197] lirc: added support for RaspberryPi GPIO +Subject: [PATCH 043/205] 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 @@ -84047,10 +84047,10 @@ index 0000000000000000000000000000000000000000..fb69624ccef00ddbdccf8256d6baf1b1 + +#endif -From 12f7ed09796c1f3a0616fe8e1fa4b26e875323c3 Mon Sep 17 00:00:00 2001 +From f4a69cb9c42a873974c2c3f9470510d121df9c08 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:49:20 +0100 -Subject: [PATCH 044/197] Add cpufreq driver +Subject: [PATCH 044/205] Add cpufreq driver Signed-off-by: popcornmix --- @@ -84317,10 +84317,10 @@ index 0000000000000000000000000000000000000000..414fbdc10dfbfc6e4bb47870a7af3fd5 +module_init(bcm2835_cpufreq_module_init); +module_exit(bcm2835_cpufreq_module_exit); -From dd4a76860d388c27a5d27f85a8097b368168defc Mon Sep 17 00:00:00 2001 +From b047036dab5f6f764952ba3a3c0d939a3921dd2b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 19:24:24 +0000 -Subject: [PATCH 045/197] Added hwmon/thermal driver for reporting core +Subject: [PATCH 045/205] Added hwmon/thermal driver for reporting core temperature. Thanks Dorian MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -84486,10 +84486,10 @@ index 0000000000000000000000000000000000000000..c63fb9f9d143e19612a18fe530c7b2b3 +MODULE_DESCRIPTION("Thermal driver for bcm2835 chip"); +MODULE_LICENSE("GPL"); -From 41b2fd0b9636cf760025ef74e2197d7ab6ed980e Mon Sep 17 00:00:00 2001 +From c5b98d0ea429ebed3b417504e5e8f419e5d451e6 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 15:44:08 +0100 -Subject: [PATCH 046/197] Add Chris Boot's i2c driver +Subject: [PATCH 046/205] Add Chris Boot's i2c driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -85154,10 +85154,10 @@ index 0000000000000000000000000000000000000000..962f2e5c7455d91bf32925d785f5f16b +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRV_NAME); -From 2fce44a42f2b29efc3c5bf9ea842bfdd6f0d3695 Mon Sep 17 00:00:00 2001 +From a375da4ad5fa36968e60540f13fe31e55fd867f7 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 047/197] char: broadcom: Add vcio module +Subject: [PATCH 047/205] char: broadcom: Add vcio module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -85383,10 +85383,10 @@ index 0000000000000000000000000000000000000000..c19bc2075c77879563ef5e59038b5a14 +MODULE_DESCRIPTION("Mailbox userspace access"); +MODULE_LICENSE("GPL"); -From 7a4d504acd54950e46e84c8eb0ca040798f1f528 Mon Sep 17 00:00:00 2001 +From 41fe20e4956320dc3d31d1e1ee7fce61fa955d9f 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 048/197] firmware: bcm2835: Support ARCH_BCM270x +Subject: [PATCH 048/205] firmware: bcm2835: Support ARCH_BCM270x MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -85469,10 +85469,10 @@ index dd506cd3a5b874f9e1acd07efb8cd151bb6145d1..3f070bd38a91511c986e3fb114b15bd4 MODULE_AUTHOR("Eric Anholt "); MODULE_DESCRIPTION("Raspberry Pi firmware driver"); -From c0c360800fb1a70eee68c4cbbb289ff4aba520eb Mon Sep 17 00:00:00 2001 +From 5480b52dd02ff7f97da24e3c37b3f0b18eed2842 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 30 Jan 2013 12:45:18 +0000 -Subject: [PATCH 049/197] bcm2835: add v4l2 camera device +Subject: [PATCH 049/205] bcm2835: add v4l2 camera device - Supports raw YUV capture, preview, JPEG and H264. - Uses videobuf2 for data transfer, using dma_buf. @@ -93214,10 +93214,10 @@ index 0000000000000000000000000000000000000000..9d1d11e4a53e510c04a416d92d195a7d + +#endif /* MMAL_VCHIQ_H */ -From 90773b4d09637f6e80e2a6cbe6bc523918ea9ca1 Mon Sep 17 00:00:00 2001 +From 76845f0703012d6d8fb5be20b06c5a6de2182dbd Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 11 May 2015 09:00:42 +0100 -Subject: [PATCH 050/197] scripts: Add mkknlimg and knlinfo scripts from tools +Subject: [PATCH 050/205] scripts: Add mkknlimg and knlinfo scripts from tools repo The Raspberry Pi firmware looks for a trailer on the kernel image to @@ -93737,10 +93737,10 @@ index 0000000000000000000000000000000000000000..60206de7fa9a49bd027c635306674a29 + return $trailer; +} -From 7ff83ec44ca58bc5e4765baae12ea47bdb1a7a49 Mon Sep 17 00:00:00 2001 +From dfeb7241603dbc27b0e01ca7ba468e5e8aeb4a18 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 10 Aug 2015 09:49:15 +0100 -Subject: [PATCH 051/197] scripts/dtc: Update to upstream version 1.4.1 +Subject: [PATCH 051/205] scripts/dtc: Update to upstream version 1.4.1 Includes the new localfixups format. @@ -96591,10 +96591,10 @@ index ad9b05ae698b0495ecbda42ffcf4743555313a27..2595dfda020fd9e03f0beff5006f229d -#define DTC_VERSION "DTC 1.4.1-g53bf130b" +#define DTC_VERSION "DTC 1.4.1-g25efc119" -From 23510393fdc83d633c4b946d451e144ffe536756 Mon Sep 17 00:00:00 2001 +From 59665c9f14f881aa27492efc791f7a8889717d15 Mon Sep 17 00:00:00 2001 From: notro Date: Wed, 9 Jul 2014 14:46:08 +0200 -Subject: [PATCH 052/197] BCM2708: Add core Device Tree support +Subject: [PATCH 052/205] BCM2708: Add core Device Tree support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -106722,10 +106722,10 @@ index 0a07f9014944ed92a8e2e42983ae43be60b3e471..1967878a843461c3ff1f473b9a030eb0 # Bzip2 -From 933a0e277cf77743c710e317db9ae013b6f75858 Mon Sep 17 00:00:00 2001 +From 1e39c8d4a91f3b5927a22edea0fc8a9bf418e336 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 6 Feb 2015 13:50:57 +0000 -Subject: [PATCH 053/197] BCM270x_DT: Add pwr_led, and the required "input" +Subject: [PATCH 053/205] BCM270x_DT: Add pwr_led, and the required "input" trigger The "input" trigger makes the associated GPIO an input. This is to support @@ -106901,10 +106901,10 @@ index 569cb531094c20a9aa2db478aaa6f348d2afd7f4..aca292f4b0932f61b5bd864251fd05b9 /* set_brightness_work / blink_timer flags, atomic, private. */ unsigned long work_flags; -From ab9bd6ad339b9ac104759ab1bdae95230fc25c2f Mon Sep 17 00:00:00 2001 +From 4a5f70ac27cd0ff37f371cf59c88233191241bc8 Mon Sep 17 00:00:00 2001 From: Siarhei Siamashka Date: Mon, 17 Jun 2013 13:32:11 +0300 -Subject: [PATCH 054/197] fbdev: add FBIOCOPYAREA ioctl +Subject: [PATCH 054/205] fbdev: add FBIOCOPYAREA ioctl Based on the patch authored by Ali Gholami Rudi at https://lkml.org/lkml/2009/7/13/153 @@ -107156,10 +107156,10 @@ index fb795c3b3c178ad3cd7c9e9e4547ffd492bac181..703fa8a70574323abe2fb32599254582 __u32 dx; /* screen-relative */ __u32 dy; -From c7d3a532541097d12409db47d61b36dfc89b64a3 Mon Sep 17 00:00:00 2001 +From ab40d01f0b5a0502a2079a5a281ec98d497520a0 Mon Sep 17 00:00:00 2001 From: Harm Hanemaaijer Date: Thu, 20 Jun 2013 20:21:39 +0200 -Subject: [PATCH 055/197] Speed up console framebuffer imageblit function +Subject: [PATCH 055/205] 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 @@ -107368,10 +107368,10 @@ index a2bb276a8b2463eee98eb237c4647bc00cd93601..436494fba15abecb400ef28688466faf start_index, pitch_index); } else -From f8ceb872220a7cef93b78f4634f311f211c74a59 Mon Sep 17 00:00:00 2001 +From 59e3726a8991d09fc999df2ba45d1019d2ddb6ca Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 8 May 2013 11:46:50 +0100 -Subject: [PATCH 056/197] enabling the realtime clock 1-wire chip DS1307 and +Subject: [PATCH 056/205] 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 @@ -107621,10 +107621,10 @@ index d58594a3232492e33f1dd4babd3798b03e0f0203..feae94256256316fd9d850c3d83325af unsigned int ext_pullup_enable_pin; unsigned int pullup_duration; -From 32fcfece70554f45da6bb9ca9d1acc95fd322d84 Mon Sep 17 00:00:00 2001 +From b5385afea932d6a3a9d6eb70386e87431f4d42d8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 18 Dec 2013 22:16:19 +0000 -Subject: [PATCH 057/197] config: Enable CONFIG_MEMCG, but leave it disabled +Subject: [PATCH 057/205] config: Enable CONFIG_MEMCG, but leave it disabled (due to memory cost). Enable with cgroup_enable=memory. --- @@ -107674,10 +107674,10 @@ index 53bbca7c48598e44fa5e45f88626027749ca8932..62d610c934f80265a889d968c4880a71 * css_tryget_online_from_dir - get corresponding css from a cgroup dentry * @dentry: directory dentry of interest -From ee37c4f3c36a6451ed790de202ebe46e61865de0 Mon Sep 17 00:00:00 2001 +From 89a7ee13625856c0f0da3ae25f90c087ae859284 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 14 Jul 2014 22:02:09 +0100 -Subject: [PATCH 058/197] hid: Reduce default mouse polling interval to 60Hz +Subject: [PATCH 058/205] hid: Reduce default mouse polling interval to 60Hz Reduces overhead when using X --- @@ -107713,10 +107713,10 @@ index 333108ef18cf2f3f94ee3816b2ba6522017295b6..da0ee3beeeed3a223ea6859f52a81e99 ret = -ENOMEM; if (usb_endpoint_dir_in(endpoint)) { -From 9ad4fed8da424526b19222b71da9ac36427c6feb Mon Sep 17 00:00:00 2001 +From f65d5cfaa73c1bf1d8c3964238f4183e45bff419 Mon Sep 17 00:00:00 2001 From: Gordon Hollingworth Date: Tue, 12 May 2015 14:47:56 +0100 -Subject: [PATCH 059/197] rpi-ft5406: Add touchscreen driver for pi LCD display +Subject: [PATCH 059/205] 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 @@ -108074,10 +108074,10 @@ index 30fb37fe175df604a738258a2a632bca3bfff33f..4a3d79d3b48eb483a4e4bf498f617515 RPI_FIRMWARE_FRAMEBUFFER_SET_BACKLIGHT = 0x0004800f, -From 51b44a1507ec7ebec2d0b28a5ed2ba07197fa9dc Mon Sep 17 00:00:00 2001 +From 36a3450c65a1bb45b908fe0da9418a099c880ace Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 28 Nov 2016 16:50:04 +0000 -Subject: [PATCH 060/197] Improve __copy_to_user and __copy_from_user +Subject: [PATCH 060/205] Improve __copy_to_user and __copy_from_user performance Provide a __copy_from_user that uses memcpy. On BCM2708, use @@ -109652,10 +109652,10 @@ index 333dc3c2e5ffbb2c5ab8fcfb6115b6162643cf20..46b787a6474ffa857da9b663948863ec bool "Broadcom BCM63xx DSL SoC" depends on ARCH_MULTI_V7 -From 55daf505e5510bb7b3eae3d3a0c3641804297561 Mon Sep 17 00:00:00 2001 +From e138b9fd272fa5efffc546cccf56d75d50bdd380 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 25 Jun 2015 12:16:11 +0100 -Subject: [PATCH 061/197] gpio-poweroff: Allow it to work on Raspberry Pi +Subject: [PATCH 061/205] 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 @@ -109690,10 +109690,10 @@ index be3d81ff51cc3f510d85e4eed7a52960e51e7bc1..a030ae9fb1fca325061c093696e82186 "%s: pm_power_off function already registered", __func__); -From d0b54b06066be73ff95fa057466add8247737149 Mon Sep 17 00:00:00 2001 +From a53c8c0bd1cdc169608542a4935da4d8d3395868 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Jul 2015 14:32:47 +0100 -Subject: [PATCH 062/197] mfd: Add Raspberry Pi Sense HAT core driver +Subject: [PATCH 062/205] mfd: Add Raspberry Pi Sense HAT core driver --- drivers/input/joystick/Kconfig | 8 + @@ -110558,10 +110558,10 @@ index 0000000000000000000000000000000000000000..56196dc2af10e464a1e3f98b028dca1c + +#endif -From 5c6f4b2f898b4bf6b407f53338a208eb9024d445 Mon Sep 17 00:00:00 2001 +From 9cbc38ee1074b37c78d551fc381086c4d81ab190 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 19:19:08 +0100 -Subject: [PATCH 063/197] ASoC: Add support for HifiBerry DAC +Subject: [PATCH 063/205] ASoC: Add support for HifiBerry DAC This adds a machine driver for the HifiBerry DAC. It is a sound card that can @@ -110736,10 +110736,10 @@ index 0000000000000000000000000000000000000000..45f2b770ad9e67728ca599a7445d6ae9 +MODULE_DESCRIPTION("ASoC Driver for HifiBerry DAC"); +MODULE_LICENSE("GPL v2"); -From af1590bc05b31b272a8da0a8ffb9be017667eb7b Mon Sep 17 00:00:00 2001 +From 9772ec482c8a91c9e406df8e7e2548f0117336fd Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Mon, 25 Jan 2016 15:48:59 +0000 -Subject: [PATCH 064/197] ASoC: Add support for Rpi-DAC +Subject: [PATCH 064/205] ASoC: Add support for Rpi-DAC --- sound/soc/bcm/Kconfig | 7 +++ @@ -111023,10 +111023,10 @@ index 0000000000000000000000000000000000000000..afe1b419582aa40c4b2729d242bb13cd +MODULE_AUTHOR("Florian Meier "); +MODULE_LICENSE("GPL v2"); -From a733db62f4da1bf76b3736aa780331a410c79dec Mon Sep 17 00:00:00 2001 +From 0c3f035a70a8d60c296e566c7c7e0a505569f579 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Wed, 15 Jan 2014 21:41:23 +0100 -Subject: [PATCH 065/197] ASoC: wm8804: Implement MCLK configuration options, +Subject: [PATCH 065/205] 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 @@ -111075,10 +111075,10 @@ index af95d648265b3e92e345101542b332aee35191d4..513f56ba132929662802d15cdc653af3 .component_driver = { .dapm_widgets = wm8804_dapm_widgets, -From 02e39e20c4e0448aeb9f6574eaf909eca177eb61 Mon Sep 17 00:00:00 2001 +From 4907c30093b27c97f4485fe9be38b523e6d815bd Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Wed, 15 Jan 2014 21:42:08 +0100 -Subject: [PATCH 066/197] ASoC: BCM:Add support for HiFiBerry Digi. Driver is +Subject: [PATCH 066/205] ASoC: BCM:Add support for HiFiBerry Digi. Driver is based on the patched WM8804 driver. Signed-off-by: Daniel Matuschek @@ -111422,10 +111422,10 @@ index 0000000000000000000000000000000000000000..19dc953b7227ba86123fc7a2ba654499 +MODULE_DESCRIPTION("ASoC Driver for HifiBerry Digi"); +MODULE_LICENSE("GPL v2"); -From 12262407116ce8b5f90b333ae8f3081e998e6bb2 Mon Sep 17 00:00:00 2001 +From 4bd8e0800da50bd688d5787601e442070d40a809 Mon Sep 17 00:00:00 2001 From: Gordon Garrity Date: Sat, 8 Mar 2014 16:56:57 +0000 -Subject: [PATCH 067/197] Add IQaudIO Sound Card support for Raspberry Pi +Subject: [PATCH 067/205] Add IQaudIO Sound Card support for Raspberry Pi Set a limit of 0dB on Digital Volume Control @@ -111755,10 +111755,10 @@ index 0000000000000000000000000000000000000000..4e8e6dec14bcf4a1ff286c43742d4097 +MODULE_DESCRIPTION("ASoC Driver for IQAudio DAC"); +MODULE_LICENSE("GPL v2"); -From 059f91555fdf10a40dd7c05d154cdfdb55bd66f2 Mon Sep 17 00:00:00 2001 +From d2a86da7a79aa531e71456cf77e86a6315b88003 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 25 Jul 2016 17:06:50 +0100 -Subject: [PATCH 068/197] iqaudio-dac: Compile fix - untested +Subject: [PATCH 068/205] iqaudio-dac: Compile fix - untested --- sound/soc/bcm/iqaudio-dac.c | 6 +++++- @@ -111782,10 +111782,10 @@ index 4e8e6dec14bcf4a1ff286c43742d4097249d6777..aa15bc4b49ca95edec905fddd8fd0a6d if (dapm->dev != codec_dai->dev) return 0; -From 643b25c0ff9486f5372b0c936143d275b64afed1 Mon Sep 17 00:00:00 2001 +From 9f4886062969d6390ff62b8f9db2721318310ee2 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Mon, 4 Aug 2014 10:06:56 +0200 -Subject: [PATCH 069/197] Added support for HiFiBerry DAC+ +Subject: [PATCH 069/205] 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. @@ -112415,10 +112415,10 @@ index 72b19e62f6267698aea45d2410d616d91c1825cb..c6839ef6e16754ed9de2698507b8986a dev_err(dev, "No LRCLK?\n"); return -EINVAL; -From 7471add31dae58f470f81d8ba25f772c87a4a256 Mon Sep 17 00:00:00 2001 +From 4bb23e6d2f10cfa66b156479d9f1cf4853ff9ae2 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Mon, 4 Aug 2014 11:09:58 +0200 -Subject: [PATCH 070/197] Added driver for HiFiBerry Amp amplifier add-on board +Subject: [PATCH 070/205] 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. @@ -113253,10 +113253,10 @@ index 0000000000000000000000000000000000000000..8f019e04898754d2f87e9630137be9e8 + +#endif /* _TAS5713_H */ -From f12f5b557e4da937cb6c1c24d7efa4c69b3cc110 Mon Sep 17 00:00:00 2001 +From 591f148c7ce1c80eb98d5c891e9b17ba4a1318f3 Mon Sep 17 00:00:00 2001 From: Ryan Coe Date: Sat, 31 Jan 2015 18:25:49 -0700 -Subject: [PATCH 071/197] Update ds1307 driver for device-tree support +Subject: [PATCH 071/205] Update ds1307 driver for device-tree support Signed-off-by: Ryan Coe --- @@ -113283,10 +113283,10 @@ index 4ad97be480430babc3321075f2739114eaad8f04..2ac1c265dc9cea56a5949eb537949a1f .driver = { .name = "rtc-ds1307", -From 4cea306afcf6d106efed658c5e5e646ac67bad27 Mon Sep 17 00:00:00 2001 +From f0b2ded01033dea7edbebdf019c18ddb96c86811 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 25 Mar 2015 09:26:17 +0100 -Subject: [PATCH 072/197] Add driver for rpi-proto +Subject: [PATCH 072/205] 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 @@ -113502,10 +113502,10 @@ index 0000000000000000000000000000000000000000..9db678e885efd63d84d60a098a84ed67 +MODULE_DESCRIPTION("ASoC Driver for Raspberry Pi connected to PROTO board (WM8731)"); +MODULE_LICENSE("GPL"); -From d959b45ff8e5330e136317f2cabbbfd00dba5db4 Mon Sep 17 00:00:00 2001 +From ebdb4c3382c5d2d155335a30143562a6248eccde Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Mon, 24 Aug 2015 16:03:47 +0100 -Subject: [PATCH 073/197] RaspiDAC3 support +Subject: [PATCH 073/205] RaspiDAC3 support Signed-off-by: Jan Grulich @@ -113748,10 +113748,10 @@ index 0000000000000000000000000000000000000000..dd9eeea2af0382307f437e6db09d1546 +MODULE_DESCRIPTION("ASoC Driver for RaspiDAC Rev.3x"); +MODULE_LICENSE("GPL v2"); -From b70fd34dd9a81e780ce99992c372495c8f454a4d Mon Sep 17 00:00:00 2001 +From 89d9d5733bdcae14793cb1467c13bb69abdc277f Mon Sep 17 00:00:00 2001 From: Aaron Shaw Date: Thu, 7 Apr 2016 21:26:21 +0100 -Subject: [PATCH 074/197] Add Support for JustBoom Audio boards +Subject: [PATCH 074/205] Add Support for JustBoom Audio boards justboom-dac: Adjust for ALSA API change @@ -114205,10 +114205,10 @@ index 0000000000000000000000000000000000000000..91acb666380faa3c0deb2230f8a0f8bb +MODULE_DESCRIPTION("ASoC Driver for JustBoom PI Digi HAT Sound Card"); +MODULE_LICENSE("GPL v2"); -From 89d1da4431fbd896978ab9aaaf3100a383db9a1d Mon Sep 17 00:00:00 2001 +From 86561c96661655b381e4e1556616234ced342768 Mon Sep 17 00:00:00 2001 From: Andrey Grodzovsky Date: Tue, 3 May 2016 22:10:59 -0400 -Subject: [PATCH 075/197] ARM: adau1977-adc: Add basic machine driver for +Subject: [PATCH 075/205] ARM: adau1977-adc: Add basic machine driver for adau1977 codec driver. This commit adds basic support for the codec usage including: Device tree overlay, @@ -114390,10 +114390,10 @@ index 0000000000000000000000000000000000000000..6e2ee027926ee63c89222f75ceb89e3d +MODULE_DESCRIPTION("ASoC Driver for ADAU1977 ADC"); +MODULE_LICENSE("GPL v2"); -From fc30987f79066302cbb70e389f90de5dfc85dd7c Mon Sep 17 00:00:00 2001 +From a780203c09b42a6b2bc763eb123dbedadc3bafc4 Mon Sep 17 00:00:00 2001 From: Matt Flax Date: Mon, 16 May 2016 21:36:31 +1000 -Subject: [PATCH 076/197] New AudioInjector.net Pi soundcard with low jitter +Subject: [PATCH 076/205] 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. @@ -114644,10 +114644,10 @@ index 0000000000000000000000000000000000000000..ef54e0f07ea03f59e9957b5d98f3e7fd +MODULE_ALIAS("platform:audioinjector-pi-soundcard"); + -From b46fd1b8f12018501b2a4411a8ef633248232a55 Mon Sep 17 00:00:00 2001 +From 27e5b418cac8aa6274f4d480d4dbedf025d44fa9 Mon Sep 17 00:00:00 2001 From: DigitalDreamtime Date: Thu, 30 Jun 2016 18:38:42 +0100 -Subject: [PATCH 077/197] Add IQAudIO Digi WM8804 board support +Subject: [PATCH 077/205] Add IQAudIO Digi WM8804 board support Support IQAudIO Digi board with iqaudio_digi machine driver and iqaudio-digi-wm8804-audio overlay. @@ -114947,10 +114947,10 @@ index 0000000000000000000000000000000000000000..9b6e829bcb5b1762a853775e78163196 +MODULE_DESCRIPTION("ASoC Driver for IQAudIO WM8804 Digi"); +MODULE_LICENSE("GPL v2"); -From 45b9c9e8eab1eed4e37d8d7813007309ecfaf6e9 Mon Sep 17 00:00:00 2001 +From bba08c2c3f50e78a0c3435c902da2dd6f3bc1e66 Mon Sep 17 00:00:00 2001 From: escalator2015 Date: Tue, 24 May 2016 16:20:09 +0100 -Subject: [PATCH 078/197] New driver for RRA DigiDAC1 soundcard using WM8741 + +Subject: [PATCH 078/205] New driver for RRA DigiDAC1 soundcard using WM8741 + WM8804 --- @@ -115423,10 +115423,10 @@ index 0000000000000000000000000000000000000000..446796e7e4c14a7d95b2f2a01211d9a0 +MODULE_DESCRIPTION("ASoC Driver for RRA DigiDAC1"); +MODULE_LICENSE("GPL v2"); -From a6f47a99617f2ae17f3b6b36c95aa5009eff2ed7 Mon Sep 17 00:00:00 2001 +From 435fc7c959e710fa5cb7a60cb96c5fad70d9dcb7 Mon Sep 17 00:00:00 2001 From: DigitalDreamtime Date: Sat, 2 Jul 2016 16:26:19 +0100 -Subject: [PATCH 079/197] Add support for Dion Audio LOCO DAC-AMP HAT +Subject: [PATCH 079/205] Add support for Dion Audio LOCO DAC-AMP HAT Using dedicated machine driver and pcm5102a codec driver. @@ -115599,10 +115599,10 @@ index 0000000000000000000000000000000000000000..89e65317512bc774453ac8d0d5b0ff98 +MODULE_DESCRIPTION("ASoC Driver for DionAudio LOCO"); +MODULE_LICENSE("GPL v2"); -From 3cda2c2d8a841e7c56ec279da42e813df622fe72 Mon Sep 17 00:00:00 2001 +From c69093cb41abf142977a1cf13b1b8dcc0079dfd3 Mon Sep 17 00:00:00 2001 From: Clive Messer Date: Mon, 19 Sep 2016 14:01:04 +0100 -Subject: [PATCH 080/197] Allo Piano DAC boards: Initial 2 channel (stereo) +Subject: [PATCH 080/205] 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, @@ -115809,10 +115809,10 @@ index 0000000000000000000000000000000000000000..8e8e62e5a36a279b425ed4655cfbac99 +MODULE_DESCRIPTION("ALSA ASoC Machine Driver for Allo Piano DAC"); +MODULE_LICENSE("GPL v2"); -From 8310372194619ed84e789fe7991840fc350f7101 Mon Sep 17 00:00:00 2001 +From 53d6282751283889579eed544ae77360d6835286 Mon Sep 17 00:00:00 2001 From: gtrainavicius Date: Sun, 23 Oct 2016 12:06:53 +0300 -Subject: [PATCH 081/197] Support for Blokas Labs pisound board +Subject: [PATCH 081/205] Support for Blokas Labs pisound board Pisound dynamic overlay (#1760) @@ -116989,10 +116989,10 @@ index 0000000000000000000000000000000000000000..4b8545487d06e4ea70073a5d063fb231 +MODULE_DESCRIPTION("ASoC Driver for pisound, http://blokas.io/pisound"); +MODULE_LICENSE("GPL v2"); -From 22655115808f7034edf32e2c7e5b6aca16a4034f Mon Sep 17 00:00:00 2001 +From 8e740956c01af7265d2a8767a016a4cf9e57876e Mon Sep 17 00:00:00 2001 From: P33M Date: Wed, 21 Oct 2015 14:55:21 +0100 -Subject: [PATCH 082/197] rpi_display: add backlight driver and overlay +Subject: [PATCH 082/205] 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 @@ -117161,10 +117161,10 @@ index 0000000000000000000000000000000000000000..14a0d9b037395497c1fdae2961feccd5 +MODULE_DESCRIPTION("Raspberry Pi mailbox based Backlight Driver"); +MODULE_LICENSE("GPL"); -From 555f0e880c7c4e088d8b9adc3933f569e8e79830 Mon Sep 17 00:00:00 2001 +From 3d74769161a89c38af18836cd61c39336073391a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 23 Feb 2016 19:56:04 +0000 -Subject: [PATCH 083/197] bcm2835-virtgpio: Virtual GPIO driver +Subject: [PATCH 083/205] bcm2835-virtgpio: Virtual GPIO driver Add a virtual GPIO driver that uses the firmware mailbox interface to request that the VPU toggles LEDs. @@ -117438,10 +117438,10 @@ index 4a3d79d3b48eb483a4e4bf498f617515e3ad158f..5f34e1257117fb48013c9926a8a223d6 RPI_FIRMWARE_FRAMEBUFFER_SET_BACKLIGHT = 0x0004800f, -From 952e1e5704f83d895185356722f44fdb79e24c65 Mon Sep 17 00:00:00 2001 +From 96dd99c8e9f4ea6711bccf6ddd2159828e12d5a2 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 23 Feb 2016 17:26:48 +0000 -Subject: [PATCH 084/197] amba_pl011: Don't use DT aliases for numbering +Subject: [PATCH 084/205] 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 @@ -117470,10 +117470,10 @@ index d4171d71a258f2696ab2ab2109376ee5a516bfba..6beb6233a0b6132b933cf8d85d8501dc uap->old_cr = 0; uap->port.dev = dev; -From e2279451a7a696f84ebbb1a66aad1ca96e63cd80 Mon Sep 17 00:00:00 2001 +From 73b7b540c10ff8f3e258e7f57bc563a08dc82980 Mon Sep 17 00:00:00 2001 From: Pantelis Antoniou Date: Wed, 3 Dec 2014 13:23:28 +0200 -Subject: [PATCH 085/197] OF: DT-Overlay configfs interface +Subject: [PATCH 085/205] 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. @@ -117905,10 +117905,10 @@ index 0000000000000000000000000000000000000000..0037e6868a6cda8706c88194c6a4454b +} +late_initcall(of_cfs_init); -From 9d92c9515e80ac783295b8b38df3f70b0936b3c4 Mon Sep 17 00:00:00 2001 +From d93fed4764d1de72402a0841cfb5b2d68242676c Mon Sep 17 00:00:00 2001 From: Cheong2K Date: Fri, 26 Feb 2016 18:20:10 +0800 -Subject: [PATCH 086/197] brcm: adds support for BCM43341 wifi +Subject: [PATCH 086/205] brcm: adds support for BCM43341 wifi brcmfmac: Disable power management @@ -118059,10 +118059,10 @@ index d2219885071f6d718f0f26320d580c66adc26e36..d13826095c09f5b4037625371fe64890 BRCMF_FW_NVRAM_ENTRY(BRCM_CC_43362_CHIP_ID, 0xFFFFFFFE, 43362), BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4339_CHIP_ID, 0xFFFFFFFF, 4339), -From 104d762b75a58832237da688e11ba2552dcecb08 Mon Sep 17 00:00:00 2001 +From 87d510287389bae6818179724449c17875487b01 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 17 Dec 2015 13:37:07 +0000 -Subject: [PATCH 087/197] hci_h5: Don't send conf_req when ACTIVE +Subject: [PATCH 087/205] 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. @@ -118085,10 +118085,10 @@ index 90d0456b67446bcc624fab4b1542c4eaf21531b1..f9adeac3bbba6418dcca298c55706356 if (H5_HDR_LEN(hdr) > 2) h5->tx_win = (data[2] & 0x07); -From 1c2d7e0ff1f3026d80c4bae733015835e1b623c3 Mon Sep 17 00:00:00 2001 +From efcdeaa6b728e548250837f915548c0cc2c47e07 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 13 Apr 2015 17:16:29 +0100 -Subject: [PATCH 088/197] config: Add default configs +Subject: [PATCH 088/205] config: Add default configs --- arch/arm/configs/bcm2709_defconfig | 1297 +++++++++++++++++++++++++++++++++++ @@ -120715,10 +120715,10 @@ index 0000000000000000000000000000000000000000..8acee9f31202ec14f2933d92dd70831c +CONFIG_CRC_ITU_T=y +CONFIG_LIBCRC32C=y -From aa2ed0b804095f07e39a65e282a4d97d79951a2b Mon Sep 17 00:00:00 2001 +From 644e30f04aece97e2e40a137db0d50059f4ac0c0 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Wed, 24 Aug 2016 03:35:56 -0700 -Subject: [PATCH 089/197] Add arm64 configuration and device tree differences. +Subject: [PATCH 089/205] Add arm64 configuration and device tree differences. Disable MMC_BCM2835_SDHOST and MMC_BCM2835 since these drivers are crashing at the moment. @@ -122133,10 +122133,10 @@ index 0000000000000000000000000000000000000000..e6b09fafa27eed2b762e3d53b55041f7 +CONFIG_LIBCRC32C=y +CONFIG_BCM2835_VCHIQ=n -From 9dae8d9df2748592f2aaf856650b18c2b853fabe Mon Sep 17 00:00:00 2001 +From 0cad2d18e2b6b9459523e0128594632e8356dba1 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 27 Dec 2016 22:13:42 +0000 -Subject: [PATCH 090/197] Revert "staging: vc04_services: remove +Subject: [PATCH 090/205] Revert "staging: vc04_services: remove vchiq_copy_from_user" This reverts commit 49bec49fd7f273ec114e2e533c1bb8f21a654aaf. @@ -122886,10 +122886,10 @@ index d9771394a041bbb55daacd7744ac57758ae198d1..7694627b925c743552b093ce51d15c2f * * Arguments: VCHI_HELD_MSG_T *message -From 8fb026f748040ddf1d27656b064f73f03422fe91 Mon Sep 17 00:00:00 2001 +From 50c63aaaf64670394dc13cfe14363913ff6cf401 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 23 Mar 2016 14:16:25 +0000 -Subject: [PATCH 091/197] vchiq_arm: Access the dequeue_pending flag locked +Subject: [PATCH 091/205] 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. @@ -122947,10 +122947,10 @@ index 42998155eb4d7de8e49cc1ca82d84a430562a8da..74f1569097c7dd120cc68fb8d09d8c3d return add_completion(instance, reason, header, user_service, -From d0b37d061c4992ab13fe2c825faf4faa6ab4b472 Mon Sep 17 00:00:00 2001 +From 4b4ebbf1bcb63736f5eb4d882b414e5e6f6fc98e Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 23 Mar 2016 20:53:47 +0000 -Subject: [PATCH 092/197] vchiq_arm: Service callbacks must not fail +Subject: [PATCH 092/205] 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 @@ -122976,10 +122976,10 @@ index 74f1569097c7dd120cc68fb8d09d8c3d63d56977..3ba6485f0c7b32de9f2aa75164e8b1b9 DEBUG_TRACE(SERVICE_CALLBACK_LINE); } -From 82cead4851c83f42f8e5c1440c935e22163691a1 Mon Sep 17 00:00:00 2001 +From 068a3fa44b5198495792a77933e8645e5f5cfdfe Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 21 Apr 2016 13:49:32 +0100 -Subject: [PATCH 093/197] vchiq_arm: Add completion records under the mutex +Subject: [PATCH 093/205] vchiq_arm: Add completion records under the mutex An issue was observed when flushing openmax components which generate a large number of messages returning @@ -123042,10 +123042,10 @@ index 3ba6485f0c7b32de9f2aa75164e8b1b901aa74ea..07d8eadd2aa2dc997db13c80dc303673 return VCHIQ_SUCCESS; -From 72aca591f34229bbcc9018d1eb95605a299a79fc Mon Sep 17 00:00:00 2001 +From 8bbf668306772effafb0bf3231a472398354c2ce Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 20 Jun 2016 13:51:44 +0100 -Subject: [PATCH 094/197] vchiq_arm: Avoid use of mutex in add_completion +Subject: [PATCH 094/205] 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 @@ -123239,10 +123239,10 @@ index c5b06cc4ca53135ec9491116ca79beaa98f57bcc..d6757ee263fb61a689c0d38c0dbb65c5 up(&state->slot_available_event); } -From c6c9a27b6afaa63bb3f386af27cfc54416d12b83 Mon Sep 17 00:00:00 2001 +From f385495282bad46792b9d65907004607b154288d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 14 Sep 2016 09:18:09 +0100 -Subject: [PATCH 095/197] raspberrypi-firmware: Define the MBOX channel in the +Subject: [PATCH 095/205] raspberrypi-firmware: Define the MBOX channel in the header. Signed-off-by: Eric Anholt @@ -123264,10 +123264,10 @@ index 5f34e1257117fb48013c9926a8a223d64a598ab7..7f0da0727422c690947e46e891a754de enum rpi_firmware_property_status { -From 78f7c318f2c2cc625a1f7fb10b1d15a08699021f Mon Sep 17 00:00:00 2001 +From 696fa19661346de074dce8e24953988308429b23 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 14 Sep 2016 08:39:33 +0100 -Subject: [PATCH 096/197] drm/vc4: Add a mode for using the closed firmware for +Subject: [PATCH 096/205] drm/vc4: Add a mode for using the closed firmware for display. Signed-off-by: Eric Anholt @@ -123293,7 +123293,7 @@ index 7757f69a8a77b355677314dbb1380c4803b5e104..3358ec8775cf6e8738ea8cdb2246dad5 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 7aadce1f7e7a0e56b302bded53ad8c0d5977cc22..bdf32c572fc2c46932daca934dfb002d05493883 100644 +index c7e6c9839c9abfa5b4a9086024ebe3f854b13b38..c7e478f672e184974a33bb9ca72b8aa62d76e97e 100644 --- a/drivers/gpu/drm/vc4/vc4_crtc.c +++ b/drivers/gpu/drm/vc4/vc4_crtc.c @@ -162,6 +162,9 @@ int vc4_crtc_get_scanoutpos(struct drm_device *dev, unsigned int crtc_id, @@ -124034,10 +124034,10 @@ index 0000000000000000000000000000000000000000..d18a1dae51a2275846c9826b5bf1ba57 + }, +}; -From e5bb5cb463b1e5f47a24ef5ce746183defc27f54 Mon Sep 17 00:00:00 2001 +From a39f80334c05f02fce1664d3326119f2f8d8d5e7 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 097/197] i2c: bcm2835: Add debug support +Subject: [PATCH 097/205] i2c: bcm2835: Add debug support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -124226,10 +124226,10 @@ index cd07a69e2e9355540442785f95e90823b05c9d10..47167f403cc8329bd811b47c7011c299 if (i2c_dev->msg_err & BCM2835_I2C_S_ERR) return -EREMOTEIO; -From fea34021cf0e4bed605a3d4ffca68cafb1af0db6 Mon Sep 17 00:00:00 2001 +From 6c2a6f1028bf676ef0897ed67dd0539aba35bc04 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 14 Sep 2016 09:16:19 +0100 -Subject: [PATCH 098/197] raspberrypi-firmware: Export the general transaction +Subject: [PATCH 098/205] raspberrypi-firmware: Export the general transaction function. The vc4-firmware-kms module is going to be doing the MBOX FB call. @@ -124273,10 +124273,10 @@ index 7f0da0727422c690947e46e891a754de13dc1fea..280791fb9656901392ce67e44cb742c9 #endif /* __SOC_RASPBERRY_FIRMWARE_H__ */ -From b19d6fd68961ec059bb74c6ffd2e2ce7560bdf56 Mon Sep 17 00:00:00 2001 +From a3bfb87c5ecb676a2b8f31377c8d2113a7f6f368 Mon Sep 17 00:00:00 2001 From: Alex Tucker Date: Tue, 13 Dec 2016 19:50:18 +0000 -Subject: [PATCH 099/197] Add support for Silicon Labs Si7013/20/21 +Subject: [PATCH 099/205] Add support for Silicon Labs Si7013/20/21 humidity/temperature sensor. --- @@ -124351,10 +124351,10 @@ index f6d134c095af2398fc55ae7d2b0e86456c30627c..31bda8da4cb6a56bfe493a81b9189009 }; }; -From df1635583389cdbd2286da0810d5464922e09234 Mon Sep 17 00:00:00 2001 +From 55b11bec6fac9fb7d5d41d41283e84cc75967867 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 3 Jan 2017 21:27:46 +0000 -Subject: [PATCH 100/197] Document the si7020 option +Subject: [PATCH 100/205] Document the si7020 option --- arch/arm/boot/dts/overlays/README | 3 +++ @@ -124375,10 +124375,10 @@ index 81d991803be335e5a1bc3bb0a8c7a2c9f5c392bd..e8fa4ccb44c34a20485c4e6155467af9 Name: i2c0-bcm2708 Info: Enable the i2c_bcm2708 driver for the i2c0 bus. Not all pin combinations -From 3d69b2a0910c957ec466f33361b06181951b00a5 Mon Sep 17 00:00:00 2001 +From c698b16a276178c8730c425e84732d9043e748ca Mon Sep 17 00:00:00 2001 From: Giedrius Trainavicius Date: Thu, 5 Jan 2017 02:38:16 +0200 -Subject: [PATCH 101/197] pisound improvements: +Subject: [PATCH 101/205] pisound improvements: * Added a writable sysfs object to enable scripts / user space software to blink MIDI activity LEDs for variable duration. @@ -124672,10 +124672,10 @@ index 4b8545487d06e4ea70073a5d063fb2310b3b94d0..ba70734b89e61a11201657406223f0b3 }; -From 8fcab5221cb33917ea27ea39b5063ab980148d32 Mon Sep 17 00:00:00 2001 +From 27376030ff6d6ccce2803f9bfb8bb562cf2e5666 Mon Sep 17 00:00:00 2001 From: Aaron Shaw Date: Tue, 10 Jan 2017 16:05:41 +0000 -Subject: [PATCH 102/197] Add driver_name property +Subject: [PATCH 102/205] Add driver_name property Add driver name property for use with 5.1 passthrough audio in LibreElec and other Kodi based OSs --- @@ -124695,10 +124695,10 @@ index 8fd50dbe681508a2cfe8fdde1c9fedbe9a507fa7..05a224ec712d06b8b7587ab6b8bb562d .dai_link = snd_rpi_justboom_dac_dai, .num_links = ARRAY_SIZE(snd_rpi_justboom_dac_dai), -From ee9bd8fd519b5e3d09d67de175719bf9dd80633e Mon Sep 17 00:00:00 2001 +From 525a8fb0e65f81a7335c54da148f5a05506f7625 Mon Sep 17 00:00:00 2001 From: Aaron Shaw Date: Tue, 10 Jan 2017 16:11:04 +0000 -Subject: [PATCH 103/197] Add driver_name paramater +Subject: [PATCH 103/205] Add driver_name paramater Add driver_name parameter for use with 5.1 passthrough audio in LibreElec and other Kodi OSs --- @@ -124718,10 +124718,10 @@ index 91acb666380faa3c0deb2230f8a0f8bbec59417b..abfdc5c4dd5811e6847bddda4921abe3 .dai_link = snd_rpi_justboom_digi_dai, .num_links = ARRAY_SIZE(snd_rpi_justboom_digi_dai), -From c7b8b8039c2dcb7bdbb0579ead9c545e55e5574d Mon Sep 17 00:00:00 2001 +From 2dbd2e05fc268252b2cf302df8e7e0ca7021989b Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 11 Jan 2017 13:01:21 +0000 -Subject: [PATCH 104/197] BCM270X_DT: Add pi3-disable-wifi overlay +Subject: [PATCH 104/205] BCM270X_DT: Add pi3-disable-wifi overlay pi3-disable-wifi is a minimal overlay to disable the onboard WiFi. @@ -124782,10 +124782,10 @@ index 0000000000000000000000000000000000000000..017199554bf2f4e381efcc7bb71e750c + }; +}; -From eeb7250de9ab8b944d750fd210df910ffa8b3e74 Mon Sep 17 00:00:00 2001 +From 91140a2e2bae65c49ec0eecb86923fbfffc8b471 Mon Sep 17 00:00:00 2001 From: Electron752 Date: Thu, 12 Jan 2017 07:07:08 -0800 -Subject: [PATCH 105/197] ARM64: Make it work again on 4.9 (#1790) +Subject: [PATCH 105/205] 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. @@ -125189,10 +125189,10 @@ index e6b09fafa27eed2b762e3d53b55041f793683d27..c7e891d72969a388d9b135a36dbfc9c9 CONFIG_LIBCRC32C=y -CONFIG_BCM2835_VCHIQ=n -From 291afe618d7cce73bbd5cdb7b11a4e83d679ae62 Mon Sep 17 00:00:00 2001 +From e97d3f98da225eaad75dea27e93e8ad4459dc93c Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Thu, 12 Jan 2017 18:56:54 -0800 -Subject: [PATCH 106/197] ARM64: Fix bad cast in vc04_services +Subject: [PATCH 106/205] ARM64: Fix bad cast in vc04_services The function vchiq_copy_from_user contains a non-portable cast to uint32_t. Convert this to a cast to unsigned long @@ -125217,10 +125217,10 @@ index 706e7f936c1a97352f7ef3d3fbd3b4a92943165d..c2108dec3096fffd68261f0eb29a37d3 } else { memcpy(dst, src, size); -From bd2ca266693400d65b6a6ea0f1a15a892c56d2b5 Mon Sep 17 00:00:00 2001 +From c6f9dad3f09532adea67b843e1fdd24591754361 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Thu, 12 Jan 2017 19:05:46 -0800 -Subject: [PATCH 107/197] ARM64/SND_BCM2835: Port it to arm64. +Subject: [PATCH 107/205] ARM64/SND_BCM2835: Port it to arm64. In the messages sent to VCHIQ, SND_BCM2835 passes a callback and a context into two 32 bit pointers. Since this @@ -125317,10 +125317,10 @@ index af3e6eb690113fc32ce9e06bd2f0f294da7a7f00..ede6154bc09d38469a82008174d0e357 // Message header for all messages in HOST->VC direction -From e9862ccebde0968fce83bbe3add26a88e9a1e877 Mon Sep 17 00:00:00 2001 +From 3e06a71428002226afacc3bb41f5026acb0e7c45 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Thu, 12 Jan 2017 19:10:07 -0800 -Subject: [PATCH 108/197] ARM64: Enable HDMI audio and vc04_services in +Subject: [PATCH 108/205] ARM64: Enable HDMI audio and vc04_services in bcmrpi3_defconfig Signed-off-by: Michael Zoran @@ -125349,10 +125349,10 @@ index c7e891d72969a388d9b135a36dbfc9c9cb609bf8..4b90f9b64abe9f089ba56b13d5a00de3 CONFIG_BCM2835_MBOX=y # CONFIG_IOMMU_SUPPORT is not set -From 272e799baa26f382cf93be4bc173d2f8f3de7c8f Mon Sep 17 00:00:00 2001 +From 6740d51939d9e08d13682f54ca697850682a3b58 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Thu, 12 Jan 2017 19:14:03 -0800 -Subject: [PATCH 109/197] ARM64: Run bcmrpi3_defconfig through savedefconfig. +Subject: [PATCH 109/205] ARM64: Run bcmrpi3_defconfig through savedefconfig. Signed-off-by: Michael Zoran --- @@ -125397,10 +125397,10 @@ index 4b90f9b64abe9f089ba56b13d5a00de33343bfb9..dac962ca1634662ce7d966f1ffb53b5b CONFIG_FB_TFT_AGM1264K_FL=m CONFIG_FB_TFT_BD663474=m -From 3d3edbc8b83c0f3dd167e0c01512562a1115b809 Mon Sep 17 00:00:00 2001 +From 2f29500ecd02eb42cbeb09b8f0a2fa72aac8dda8 Mon Sep 17 00:00:00 2001 From: Electron752 Date: Sat, 14 Jan 2017 02:54:26 -0800 -Subject: [PATCH 110/197] ARM64: Enable Kernel Address Space Randomization +Subject: [PATCH 110/205] ARM64: Enable Kernel Address Space Randomization (#1792) Randomization allows the mapping between virtual addresses and physical @@ -125432,10 +125432,10 @@ index dac962ca1634662ce7d966f1ffb53b5bfa27c506..aae33b4b3c3e736ea7cd3ca242158ad6 CONFIG_BINFMT_MISC=y CONFIG_COMPAT=y -From aa429db9ec6e9a994ace33f50fbd9914e7a9ff28 Mon Sep 17 00:00:00 2001 +From a90c5355ad0311c020d235f1f8951f8ca96c47a8 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Sun, 15 Jan 2017 07:31:59 -0800 -Subject: [PATCH 111/197] ARM64: Enable RTL8187/RTL8192CU wifi in build config +Subject: [PATCH 111/205] 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 @@ -125460,10 +125460,10 @@ index aae33b4b3c3e736ea7cd3ca242158ad6ba558aff..b7d762df19b85e369a32cd823dfd0621 CONFIG_ZD1211RW=m CONFIG_MAC80211_HWSIM=m -From f135565596c227bb1447b48303c17947aa6b3122 Mon Sep 17 00:00:00 2001 +From 72109c487efb7dffc0435a89ae67d8290aba1ae8 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 16 Jan 2017 14:53:12 +0000 -Subject: [PATCH 112/197] BCM270X_DT: Add spi0-cs overlay +Subject: [PATCH 112/205] 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. @@ -125551,10 +125551,10 @@ index 0000000000000000000000000000000000000000..7f79029d043c04d7496c7c3480450c69 + }; +}; -From 61cc39e7d87dc4e86d46cbdfad1087eeed8d7327 Mon Sep 17 00:00:00 2001 +From c250fe68917c045c0278dc6ea3d7257f115ffd8c Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 1 Jul 2016 22:09:24 +0100 -Subject: [PATCH 113/197] spi-bcm2835: Disable forced software CS +Subject: [PATCH 113/205] 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 @@ -125580,10 +125580,10 @@ index 9a44da19089717f02462c657840ae9f24fd942ba..b710a4d67b8ec8c8c18ce8efb6f270e7 i2c0: i2c@7e205000 { -From d5254442792db04642cb143f006f3661df29a735 Mon Sep 17 00:00:00 2001 +From bb057983a110e1739a03d50083059782fb9200ec Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 17 Jan 2017 11:34:58 +0000 -Subject: [PATCH 114/197] BCM270X_DT: Enable UART0 on CM3 +Subject: [PATCH 114/205] BCM270X_DT: Enable UART0 on CM3 Signed-off-by: Phil Elwell --- @@ -125606,10 +125606,10 @@ index 41874c25a84226c0e4af92ec4059e0a571fe6123..3ba6e621856c288ae4694f758604619f sdhost_pins: sdhost_pins { brcm,pins = <48 49 50 51 52 53>; -From 77b2663a5db9a836ee882e2b8008d98d82fd5661 Mon Sep 17 00:00:00 2001 +From 054b61bb38c1da724fec77e1b03067e09b41ef27 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 17 Jan 2017 14:39:39 +0000 -Subject: [PATCH 115/197] config: Add CONFIG_MD_M25P80 and CONFIG_MD_SPI_NOR +Subject: [PATCH 115/205] config: Add CONFIG_MD_M25P80 and CONFIG_MD_SPI_NOR See: https://github.com/raspberrypi/linux/issues/1781 @@ -125714,10 +125714,10 @@ index 8acee9f31202ec14f2933d92dd70831cda8d7b51..aca8903da3156de11ba62afa64a06939 CONFIG_FB_TFT_AGM1264K_FL=m CONFIG_FB_TFT_BD663474=m -From e21c072dd1f0bfcc0c98715909ab6ee85ce1939d Mon Sep 17 00:00:00 2001 +From e75edaa9687596b2af25851d01e134570fbfe5a0 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Sat, 14 Jan 2017 21:33:51 -0800 -Subject: [PATCH 116/197] ARM64/DWC_OTG: Port dwc_otg driver to ARM64 +Subject: [PATCH 116/205] 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 @@ -126060,10 +126060,10 @@ index 6b2c7d0c93f36a63863ff4b0ecc1f3eab77e058b..d7b700ff17821ad1944e36721fe6b2db /** The OS page size */ #define DWC_OS_PAGE_SIZE PAGE_SIZE -From b40bb3e73856066e7e984b444e59cda4325abc39 Mon Sep 17 00:00:00 2001 +From 2f8e779297332362c7aa7794e2c51d10cb450f73 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Sat, 14 Jan 2017 21:43:57 -0800 -Subject: [PATCH 117/197] ARM64: Round-Robin dispatch IRQs between CPUs. +Subject: [PATCH 117/205] 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 @@ -126137,10 +126137,10 @@ index a8db33b50ad9ff83d284fa54fe4d3b65f859df0f..67dcac46cca72db4ebe2300eab04f0a8 .name = "bcm2836-gpu", .irq_mask = bcm2836_arm_irqchip_mask_gpu_irq, -From 4b46845e909db85fb6d0baff4b45bcc232b023fb Mon Sep 17 00:00:00 2001 +From c25dfaf75092d68b6da74f68c648779932b68462 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Sat, 14 Jan 2017 21:45:03 -0800 -Subject: [PATCH 118/197] ARM64: Enable DWC_OTG Driver In ARM64 Build +Subject: [PATCH 118/205] ARM64: Enable DWC_OTG Driver In ARM64 Build Config(bcmrpi3_defconfig) Signed-off-by: Michael Zoran @@ -126161,10 +126161,10 @@ index b7d762df19b85e369a32cd823dfd062145bdefa7..4d85c231c5ea0244e1b05fb4a5e3c8fd CONFIG_USB_STORAGE=y CONFIG_USB_STORAGE_REALTEK=m -From 8bc3e9709dbf1315562baa39fa7fcbdb1125c799 Mon Sep 17 00:00:00 2001 +From c5b8ec78a70520f6c97d5c10f1525734835e3f98 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Sat, 14 Jan 2017 21:46:04 -0800 -Subject: [PATCH 119/197] ARM64: Use dwc_otg driver by default for USB. +Subject: [PATCH 119/205] 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. @@ -126190,10 +126190,10 @@ index f6def5d7e5d622cf09e8f87332c7374fe28da08b..3e134a1208610b90e2d0fc22f03c6e9f -}; -#endif -From b812d809d23b0af56a47c0b6b9571a9045e69268 Mon Sep 17 00:00:00 2001 +From 9fc521b0625d3ccc2bead01c5b67280ae52a68eb Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 19 Jan 2017 11:18:55 +0000 -Subject: [PATCH 120/197] config: Add CONFIG_USB_DWC2 and CONFIG_USB_GADGET +Subject: [PATCH 120/205] config: Add CONFIG_USB_DWC2 and CONFIG_USB_GADGET The introduction of CM3 makes gadget mode on 2709 a useful option, so enable the building of the required modules. Note that these @@ -126226,10 +126226,10 @@ index c36f01d28097a513b32df092ce64a7d6b974e615..2e2b88fefdf367b2d9190ca227ea6eb3 CONFIG_MMC_BLOCK_MINORS=32 CONFIG_MMC_BCM2835=y -From 7f03c193d89e2be48040349f3eafdbe38aa071d1 Mon Sep 17 00:00:00 2001 +From 12c2ac8b3b41d55a017a69b8ee2c04cb37133731 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 23 Jan 2017 17:36:50 +0000 -Subject: [PATCH 121/197] BCM270X_DT: Add reference to audio_pins to CM dtb +Subject: [PATCH 121/205] 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 @@ -126257,10 +126257,10 @@ index eb8662f0d222b4c0a9a2bcb8bccb13e86a0006b3..10be69972bd1440f574e35d515f3d6a0 hpd-gpios = <&gpio 46 GPIO_ACTIVE_HIGH>; }; -From c68d920d461f1010670928be6290561c80a4e4fd Mon Sep 17 00:00:00 2001 +From 6a24f32ae2978d589a409cd5d12eda97d44e488c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 25 Jan 2017 11:30:38 +0000 -Subject: [PATCH 122/197] config: Add additional network scheduling modules +Subject: [PATCH 122/205] config: Add additional network scheduling modules --- arch/arm/configs/bcm2709_defconfig | 4 ++++ @@ -126312,10 +126312,10 @@ index aca8903da3156de11ba62afa64a0693900ee3611..c8c66751f263227e86cc21ad5b23861a CONFIG_NET_SCH_PLUG=m CONFIG_NET_CLS_BASIC=m -From a162baf40fa6695af69c493e27d9d8fed20b4d89 Mon Sep 17 00:00:00 2001 +From b2d2339356c26475dfe08e3e2d1747b5201e7ff3 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 16 Jan 2017 16:33:54 +0000 -Subject: [PATCH 123/197] config: Add CONFIG_TCP_CONG_BBR See: +Subject: [PATCH 123/205] config: Add CONFIG_TCP_CONG_BBR See: https://github.com/raspberrypi/linux/issues/1784 --- @@ -126350,10 +126350,10 @@ index c8c66751f263227e86cc21ad5b23861a88a636a6..e483bdb7aa869b212ef69ed779c6055e CONFIG_IPV6_ROUTER_PREF=y CONFIG_INET6_AH=m -From 58710124ab72c6abdcf6afb5559c793d57ab1566 Mon Sep 17 00:00:00 2001 +From 0569bcfbe2dde6cc3f63e341491f14b6849ec3da Mon Sep 17 00:00:00 2001 From: chris johnson Date: Sun, 22 Jan 2017 03:27:31 +0000 -Subject: [PATCH 124/197] ASoC: A simple-card overlay for ADAU7002 +Subject: [PATCH 124/205] ASoC: A simple-card overlay for ADAU7002 Usage: `dtoverlay=adau7002-simple` --- @@ -126451,10 +126451,10 @@ index 0000000000000000000000000000000000000000..e67e6625d7967abc92cf00cb604d4c12 + }; +}; -From 231bec95ca2b3aba073dad05c5c27da4a8595538 Mon Sep 17 00:00:00 2001 +From e0ec5f0cebfbffe4105bb5c83251df2f4d7111c7 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 25 Jan 2017 21:17:23 +0000 -Subject: [PATCH 125/197] config: Add SND_SOC_ADAU7002 codec module +Subject: [PATCH 125/205] config: Add SND_SOC_ADAU7002 codec module As there is now an overlay requiring it, build the codec module. @@ -126489,10 +126489,10 @@ index e483bdb7aa869b212ef69ed779c6055ef3b70e2a..1927b1671b6eced73e4b4d76352bb4b1 CONFIG_SND_SOC_WM8804_I2C=m CONFIG_SND_SIMPLE_CARD=m -From 180dd2fae5352903bf7b46dca2db341d5e5bc1e7 Mon Sep 17 00:00:00 2001 +From e6ce2230ec9cb41a1166abddf04202fa6e140174 Mon Sep 17 00:00:00 2001 From: Scott Ellis Date: Fri, 27 Jan 2017 06:42:42 -0500 -Subject: [PATCH 126/197] Add overlay for mcp3008 adc (#1818) +Subject: [PATCH 126/205] Add overlay for mcp3008 adc (#1818) Some example usage: @@ -126778,10 +126778,10 @@ index 0000000000000000000000000000000000000000..06bf4264959c380d8a9f90f74e780397 + }; +}; -From 41d52845bbfda338545b4a2e8ec2492fc03a0c94 Mon Sep 17 00:00:00 2001 +From e310829a8572def9671cae5fc9fbe23579ca8616 Mon Sep 17 00:00:00 2001 From: JamesH65 Date: Mon, 6 Feb 2017 15:24:47 +0000 -Subject: [PATCH 127/197] gpio_mem: Remove unnecessary dev_info output (#1830) +Subject: [PATCH 127/205] gpio_mem: Remove unnecessary dev_info output (#1830) The open function was spamming syslog every time called, so have removed call completely. @@ -126803,10 +126803,10 @@ index 911f5b7393ed48ceed8751f06967ae6463453f9c..f5e7f1ba8fb6f18dee77fad06a17480c dev_err(inst->dev, "Unknown minor device: %d", dev); ret = -ENXIO; -From 87205346fb8405a3e783f68d00ecba20af0000a8 Mon Sep 17 00:00:00 2001 +From b1b62c87da8a1c63ac438628c7045ceb65c5ded6 Mon Sep 17 00:00:00 2001 From: Claggy3 Date: Sat, 11 Feb 2017 14:00:30 +0000 -Subject: [PATCH 128/197] Update vfpmodule.c +Subject: [PATCH 128/205] 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 @@ -126943,10 +126943,10 @@ index 569d5a650a4a2c6266ddf8fc6d38e0cd96b985f6..5822a3f60a96510201a6d88828ac5262 /* * Save the userland NEON/VFP state. Under UP, -From 7ee01fa895606cb68923c5b4987b3980edaac9d2 Mon Sep 17 00:00:00 2001 +From 804da841f3a609420fb083b4ed86ae5ffce4c278 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Sat, 11 Feb 2017 01:18:31 -0800 -Subject: [PATCH 129/197] ARM64: Force hardware emulation of deprecated +Subject: [PATCH 129/205] ARM64: Force hardware emulation of deprecated instructions. --- @@ -126974,10 +126974,10 @@ index ecf9298a12d48f11d5833dca0584d8ab028cf422..14e9146709857124891f8a3927efec87 case INSN_OBSOLETE: insn->current_mode = INSN_UNDEF; -From e51af0162c620ae28e17caa0f2bbc6af4b15dc90 Mon Sep 17 00:00:00 2001 +From 47ba747eac45931aeeec011a676679b5beff5cff Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 13 Feb 2017 15:33:47 +0000 -Subject: [PATCH 130/197] squash: fix order of sound/soc/bcm makefile +Subject: [PATCH 130/205] squash: fix order of sound/soc/bcm makefile --- sound/soc/bcm/Makefile | 4 ++-- @@ -127016,10 +127016,10 @@ index 222a7583891f632cc2297f49aa1a58ee46507875..bb1df438540193652ec5464e8bc51f63 obj-$(CONFIG_SND_BCM2708_SOC_RPI_PROTO) += snd-soc-rpi-proto.o obj-$(CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC) += snd-soc-iqaudio-dac.o -From cffaf579cf42901869f408074dffe8b65bf280e8 Mon Sep 17 00:00:00 2001 +From b8f42d500be698354071fd7df6f7d5d025ec088e Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 22 Jan 2017 12:49:36 +0100 -Subject: [PATCH 131/197] config: Enable regulator support +Subject: [PATCH 131/205] config: Enable regulator support Signed-off-by: Matthias Reichl --- @@ -127054,10 +127054,10 @@ index 1927b1671b6eced73e4b4d76352bb4b1301d077c..5351a59b7f670985f47fdbafa2611734 CONFIG_MEDIA_CAMERA_SUPPORT=y CONFIG_MEDIA_ANALOG_TV_SUPPORT=y -From e396ee5403866da6cd13b24152c47e63c6cd88c6 Mon Sep 17 00:00:00 2001 +From da4b9bd8d41de88049cf2df895ab5dddb2a0ea36 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 22 Jan 2017 12:49:36 +0100 -Subject: [PATCH 132/197] BCM270x DT: expose 3.3V and 5V system rails +Subject: [PATCH 132/205] BCM270x DT: expose 3.3V and 5V system rails Signed-off-by: Matthias Reichl --- @@ -127090,10 +127090,10 @@ index a46cb4a8b1419edd95e0e07c18b0f373222dc2bf..36d853715f2379e1952ce3d3be58dd67 + }; }; -From 7e3e1e245f4e1ef9597d739c7ad677f1ac3ecde5 Mon Sep 17 00:00:00 2001 +From 199bc4807cdc54bc58a9a296bd782b004d243a3b Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 22 Jan 2017 12:49:36 +0100 -Subject: [PATCH 133/197] BCM270x DT: Consolidate audio card overlays +Subject: [PATCH 133/205] BCM270x DT: Consolidate audio card overlays Reference 3.3V / 5V system rails instead of instantiating local regulators. @@ -127388,10 +127388,10 @@ index 16b1247bfa618ff85936ddf78c3aea58075eaa67..f8d48233e28c7c18509b4a95692f6aff __overlay__ { compatible = "rra,digidac1-soundcard"; -From 6868b965f726f4e302279af7338878f42f116d4f Mon Sep 17 00:00:00 2001 +From cbcf2f0c2e8e4929cba5304f1672dcc61327f9c8 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 22 Jan 2017 12:49:37 +0100 -Subject: [PATCH 134/197] ASoC: Add driver for Cirrus Logic Audio Card +Subject: [PATCH 134/205] 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 @@ -128641,10 +128641,10 @@ index 0000000000000000000000000000000000000000..ac8651ddff7bd3701dffe22c7fb88352 +MODULE_DESCRIPTION("ASoC driver for Cirrus Logic Audio Card"); +MODULE_LICENSE("GPL"); -From e5c43dd06845e3c16a6ce2b97d3db2b4abf714fe Mon Sep 17 00:00:00 2001 +From ef840c3367c7fea8d1fb930969da7079d6536ff0 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 22 Jan 2017 12:49:37 +0100 -Subject: [PATCH 135/197] config: enable Cirrus Logic Audio Card +Subject: [PATCH 135/205] config: enable Cirrus Logic Audio Card Signed-off-by: Matthias Reichl --- @@ -128693,10 +128693,10 @@ index 5351a59b7f670985f47fdbafa26117346cafe87d..062a89f0e5fc723559ddc5739e19eb20 CONFIG_SND_BCM2708_SOC_RPI_PROTO=m CONFIG_SND_BCM2708_SOC_JUSTBOOM_DAC=m -From 9d2099d9a610590360c645ef1636a9b0abfe6a64 Mon Sep 17 00:00:00 2001 +From 757055fad26c6a777ce221d407fb0c5241d227b8 Mon Sep 17 00:00:00 2001 From: Martin Cerveny Date: Mon, 13 Feb 2017 17:23:47 +0100 -Subject: [PATCH 136/197] dwc_otg: fix summarize urb->actual_length for +Subject: [PATCH 136/205] dwc_otg: fix summarize urb->actual_length for isochronous transfers Kernel does not copy input data of ISO transfers to userspace @@ -128724,10 +128724,10 @@ index 162a656501988e56c9d780b7793d365fde09f801..992269d61ecf48126379a38e528f7190 dwc_otg_hcd_urb_get_iso_desc_status(dwc_otg_urb, i); } -From 690c5fc782d114baf6dba7b3e17ead6d417f36b0 Mon Sep 17 00:00:00 2001 +From abd8c79c7ad6a4945cb08ae6c717c26b685e7660 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Feb 2017 17:20:08 +0000 -Subject: [PATCH 137/197] clk-bcm2835: Mark used PLLs and dividers CRITICAL +Subject: [PATCH 137/205] 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 @@ -128755,10 +128755,10 @@ index 093694e00caec6e133eb26712f890691cad999aa..33bfa2008479153402d188d71d382f02 divider->data = data; -From 271e3591eed9606699c5b523700e3fa413c6fc5c Mon Sep 17 00:00:00 2001 +From f4329c4672193149bb33a774e5ad3fdaf58839db Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 9 Feb 2017 14:33:30 +0000 -Subject: [PATCH 138/197] irq-bcm2836: Avoid "Invalid trigger warning" +Subject: [PATCH 138/205] irq-bcm2836: Avoid "Invalid trigger warning" Initialise the level for each IRQ to avoid a warning from the arm arch timer code. @@ -128782,10 +128782,10 @@ index 67dcac46cca72db4ebe2300eab04f0a867e8e14b..9a7ee04ee0d9b7aa734cf3159ed59c19 static void -From 9fa26962fd3306e9251b8a1abbc6b3d6b4e97d43 Mon Sep 17 00:00:00 2001 +From 39e05a38ed72307573d431b136c33c8fdcf5414a Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 9 Feb 2017 14:36:44 +0000 -Subject: [PATCH 139/197] sound: Demote deferral errors to INFO level +Subject: [PATCH 139/205] 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. @@ -128820,10 +128820,10 @@ index baa1afa41e3dd57fdc36655b7d3bbd147ade820f..0ddeffcc48d6c14f275ea6409d1a7de8 goto _err_defer; } -From 90c9dd5e05686287326b7682b6b43cf238b9798d Mon Sep 17 00:00:00 2001 +From 5dc3302c4af9bf5db340f72f3ae412de3d985f23 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 9 Feb 2017 14:40:33 +0000 -Subject: [PATCH 140/197] sound: Suppress error message about deferrals +Subject: [PATCH 140/205] sound: Suppress error message about deferrals Since driver load deferrals are expected and will already have resulted in a kernel message, suppress an essentially @@ -129070,10 +129070,10 @@ index 9db678e885efd63d84d60a098a84ed6772b19a2d..fadbfade100228aaafabb0d3bdf35c01 return ret; } -From c5a64fb90245004a62ba47b2e8558ee7c7529b46 Mon Sep 17 00:00:00 2001 +From ef17af903c96643c9ca25690f0551e8e3d2c9162 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 17 Feb 2017 09:47:11 +0000 -Subject: [PATCH 141/197] BCM270X_DT: Add SMSC ethernet controller to DT +Subject: [PATCH 141/205] 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 @@ -129136,10 +129136,10 @@ index 12764a3495b2372ffaf47e32ea0d21326ca83686..2a5b512d3e1acb17c6a40bf9d370f222 / { model = "Raspberry Pi 3 Model B"; -From 0bfb7a2b942b98f18fb6035be868f4cbe3ff6265 Mon Sep 17 00:00:00 2001 +From 3318bc0830570e6913aff04ebaf543f7cc3eaade Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 17 Feb 2017 15:26:13 +0000 -Subject: [PATCH 142/197] brcmfmac: Mute expected startup 'errors' +Subject: [PATCH 142/205] 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 @@ -129178,10 +129178,10 @@ index 4051780f64f44a5ce522babe6c371a1beb79a824..b081673abcb4aa72d70d8e0834b608f6 /* locate firmware version number for ethtool */ ptr = strrchr(buf, ' ') + 1; -From 02ed8fd5a102cd38015e961f99489fa867cb7f13 Mon Sep 17 00:00:00 2001 +From 6cdf7ca77467b26d5f80bc3b94e46b197f65c9c4 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Feb 2017 17:20:08 +0000 -Subject: [PATCH 143/197] clk-bcm2835: Add claim-clocks property +Subject: [PATCH 143/205] 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, @@ -129317,10 +129317,10 @@ index 33bfa2008479153402d188d71d382f0274c104ea..0b62d20f8b718cfd03c0346af784688e if (!cprman->osc_name) return -ENODEV; -From c5b0725191e326b63bba79fa4251a210092db67f Mon Sep 17 00:00:00 2001 +From 37081d10d9efc9a65081979419a3fa5518069872 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Mon, 20 Feb 2017 20:01:16 +0100 -Subject: [PATCH 144/197] dmaengine: bcm2835: Fix cyclic DMA period splitting +Subject: [PATCH 144/205] 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, @@ -129359,10 +129359,10 @@ index 80d35f760b4a4a51e60c355a84d538bac3892a4d..599c218dc8a73172dd4bd4a058fc8f95 /* calculate the length that remains to reach period_length */ control_block->length = period_len - *total_len; -From 24bee1e922beac8df131fa7a4f2aacc27ac3d98e Mon Sep 17 00:00:00 2001 +From 7d1ca67d29af5f81e531881e50a45a81002cfa2c Mon Sep 17 00:00:00 2001 From: Scott Ellis Date: Thu, 23 Feb 2017 11:56:20 -0500 -Subject: [PATCH 145/197] config: Add ads1015 driver to config +Subject: [PATCH 145/205] config: Add ads1015 driver to config --- arch/arm/configs/bcm2709_defconfig | 1 + @@ -129394,10 +129394,10 @@ index 062a89f0e5fc723559ddc5739e19eb20c030f0f1..97b88dcbc1e6c5b16540622222715777 CONFIG_THERMAL=y CONFIG_THERMAL_BCM2835=y -From 683b8d1777370d83573ebb75d6281ff921081266 Mon Sep 17 00:00:00 2001 +From f3806a3df4befc70394a17040ac9daf1170f798f Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 27 Jan 2017 18:49:30 +0000 -Subject: [PATCH 146/197] config: add slcan kernel module +Subject: [PATCH 146/205] config: add slcan kernel module See: https://github.com/raspberrypi/linux/issues/1819 --- @@ -129430,10 +129430,10 @@ index 97b88dcbc1e6c5b165406222227157776b162801..2cfa65bc83fd4b7e802f56965543a217 CONFIG_IRDA=m CONFIG_IRLAN=m -From f0f1ee0999a452695e41ebbbbd1d9e171e224395 Mon Sep 17 00:00:00 2001 +From 542d055d729d7a61aea12d8c0c0dd6ae2b2d779a Mon Sep 17 00:00:00 2001 From: Miquel Date: Fri, 24 Feb 2017 20:51:06 +0100 -Subject: [PATCH 147/197] sound: Support for Dion Audio LOCO-V2 DAC-AMP HAT +Subject: [PATCH 147/205] sound: Support for Dion Audio LOCO-V2 DAC-AMP HAT Signed-off-by: Miquel Blauw --- @@ -129754,10 +129754,10 @@ index 0000000000000000000000000000000000000000..a009c49477972a9832175d86f201b035 +MODULE_DESCRIPTION("ASoC Driver for DionAudio LOCO-V2"); +MODULE_LICENSE("GPL v2"); -From 07ff36a24335111be199142a531719ffd3e9d0a9 Mon Sep 17 00:00:00 2001 +From 35fd1d089c90cdcb13c8b813e1ca913fff911fb4 Mon Sep 17 00:00:00 2001 From: Fe-Pi Date: Wed, 1 Mar 2017 04:42:43 -0700 -Subject: [PATCH 148/197] Add support for Fe-Pi audio sound card. (#1867) +Subject: [PATCH 148/205] 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. @@ -130106,10 +130106,10 @@ index 0000000000000000000000000000000000000000..015b56fd73cc36be5b5eecd17548fd03 +MODULE_DESCRIPTION("ASoC Driver for Fe-Pi Audio"); +MODULE_LICENSE("GPL v2"); -From 42f311f70dd9ccf86e1cac499b7f81c8aad28d07 Mon Sep 17 00:00:00 2001 +From adf9206b5b10b7166b5e135d7d77c250eebd62cf Mon Sep 17 00:00:00 2001 From: Scott Ellis Date: Wed, 1 Mar 2017 07:22:24 -0500 -Subject: [PATCH 149/197] Add overlay for ads1115 ADCs (#1864) +Subject: [PATCH 149/205] Add overlay for ads1115 ADCs (#1864) --- arch/arm/boot/dts/overlays/Makefile | 1 + @@ -130273,10 +130273,10 @@ index 0000000000000000000000000000000000000000..7c16a1af3172d14e1a976b1776b9f167 + }; +}; -From 2b926bb396128edde8fc62cf130953b2d012b4bd Mon Sep 17 00:00:00 2001 +From 3d3c58bb2c93082bd66fc2f63cbfdcc6d29289ba Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 1 Mar 2017 16:06:53 +0000 -Subject: [PATCH 150/197] clk-bcm2835: Correct the prediv logic +Subject: [PATCH 150/205] 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. @@ -130303,10 +130303,10 @@ index 0b62d20f8b718cfd03c0346af784688e26e9dcb6..ef0d05c58573f62de3632a920dfc1988 return bcm2835_pll_rate_from_divisors(parent_rate, ndiv, fdiv, pdiv); } -From 9f9d00f7d4804622c27fcee11162301a7ff66f6d Mon Sep 17 00:00:00 2001 +From 43eae625eeca47fa356a0ea47ce3a99da67054b2 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 1 Mar 2017 16:07:39 +0000 -Subject: [PATCH 151/197] amba_pl011: Round input clock up +Subject: [PATCH 151/205] 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 @@ -130392,10 +130392,10 @@ index 6beb6233a0b6132b933cf8d85d8501dc1ce2fe4c..50792f9fa8fc530e2ecbc90f92adb11b /* unregisters the driver also if no more ports are left */ static void pl011_unregister_port(struct uart_amba_port *uap) -From 1604926b0de8ab831476ec4e7dc0b670853796c7 Mon Sep 17 00:00:00 2001 +From c93cc959a79f234cd616079e0c92b6c7614c87b9 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 13 Feb 2017 11:10:50 +0000 -Subject: [PATCH 152/197] BCM2835-V4L2: Ensure H264 header bytes get a sensible +Subject: [PATCH 152/205] BCM2835-V4L2: Ensure H264 header bytes get a sensible timestamp H264 header come off VC with 0 timestamps, which means they get a @@ -130484,10 +130484,10 @@ index e6aeb7e7e381de65d6c6586205069a4c5cd33274..7f8a68916a67001bc9241bce2928519a struct vchiq_mmal_port *port; /* port being used for capture */ /* camera port being used for capture */ -From 938141cd67138cf5a809ef32063a35c1ae1e9977 Mon Sep 17 00:00:00 2001 +From b8dcca2e5f532286c765b078fba537bb0bb2f51a Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 13 Feb 2017 13:11:41 +0000 -Subject: [PATCH 153/197] BCM2835-V4L2: Correctly denote key frames in encoded +Subject: [PATCH 153/205] BCM2835-V4L2: Correctly denote key frames in encoded data Forward MMAL key frame flags to the V4L2 buffers. @@ -130512,10 +130512,10 @@ index e69731320f4e59249933bc21843913deab4a1209..6bdec0806126044cf7146d53326e4da5 "Buffer has ts %llu", dev->capture.last_timestamp); -From 0ce8ff30795374846686f9dfaeb25583386b214d Mon Sep 17 00:00:00 2001 +From 050edc69c5ae652f09a19e717bdc6e3e8a5d7db7 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 20 Feb 2017 17:01:21 +0000 -Subject: [PATCH 154/197] bcm2835-gpio-exp: Driver for GPIO expander via +Subject: [PATCH 154/205] bcm2835-gpio-exp: Driver for GPIO expander via mailbox service Pi3 and Compute Module 3 have a GPIO expander that the @@ -130933,10 +130933,10 @@ index 280791fb9656901392ce67e44cb742c96f090ed4..dc7fd58afd5dddebf9b17065bb069a1d /* Dispmanx TAGS */ RPI_FIRMWARE_FRAMEBUFFER_ALLOCATE = 0x00040001, -From cd61bb88c9a2dc9cf115c6edfc46f6c65d17f297 Mon Sep 17 00:00:00 2001 +From 4f512a78f2268d56ac83d4fd231d4e496295db50 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 24 May 2016 16:30:05 +0100 -Subject: [PATCH 155/197] BCM270X_DT: Add bcm2708-rpi-0-w.dts +Subject: [PATCH 155/205] 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. @@ -131164,10 +131164,10 @@ index 0000000000000000000000000000000000000000..db0f99ddf2f46e83827d56e21c4846dd + }; +}; -From 87cf1392c68903e1cbe10f0e1ddedd5554d8dda7 Mon Sep 17 00:00:00 2001 +From a2b0bace6b21a4bc0ad502b6462192c80e7e72a0 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 6 Mar 2017 09:06:18 +0000 -Subject: [PATCH 156/197] clk-bcm2835: Read max core clock from firmware +Subject: [PATCH 156/205] 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 @@ -131291,10 +131291,10 @@ index ef0d05c58573f62de3632a920dfc19888c019d18..41dccc4ebe6f367054822aed11cb0cd4 for (i = 0; !of_property_read_u32_index(pdev->dev.of_node, "claim-clocks", -From d60c276a7332f8694ebc5735591fe09c896c5a6b Mon Sep 17 00:00:00 2001 +From 70b2f53432c77438fabf2ba6ec9d050ef689b61d Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 7 Mar 2017 19:48:23 +0000 -Subject: [PATCH 157/197] config: Add CONFIG_CRYPTO_LZ4 +Subject: [PATCH 157/205] config: Add CONFIG_CRYPTO_LZ4 Enabling this options allows LZ4 memory compression. @@ -131331,10 +131331,10 @@ index a9c46f902eb32b364423d8bef07b6b37f798c617..e5996d77b02303c4b43e62a810e0e3e6 # CONFIG_CRYPTO_HW is not set CONFIG_ARM_CRYPTO=y -From b15ca6b6f094d80b518dfe326e94a9986a928615 Mon Sep 17 00:00:00 2001 +From c07a03823b0e3f3c32983e7dfe27756a1f43a40b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 5 Mar 2017 11:46:41 +0000 -Subject: [PATCH 158/197] config: Add RTL8XXXU wifi module +Subject: [PATCH 158/205] config: Add RTL8XXXU wifi module --- arch/arm/configs/bcm2709_defconfig | 1 + @@ -131366,10 +131366,10 @@ index e5996d77b02303c4b43e62a810e0e3e660c1e99e..a691ce8b7fb6017fcc7990cf08e8ff4a CONFIG_ZD1211RW=m CONFIG_MAC80211_HWSIM=m -From 08f59670310fa5f47fcfed4f54e31273813e2d8c Mon Sep 17 00:00:00 2001 +From da801d0435c282b9c30f48c44c17690ce5226a5b Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Fri, 10 Mar 2017 14:43:15 +0000 -Subject: [PATCH 159/197] bcm2835-v4l2: Fix buffer overflow problem +Subject: [PATCH 159/205] bcm2835-v4l2: Fix buffer overflow problem https://github.com/raspberrypi/linux/issues/1447 port_parameter_get() failed to account for the header @@ -131405,10 +131405,10 @@ index 781322542d5a8295f3d7d5a3eaaf0cac29930c30..e4b243b33f58913f3d2952c97d2a2e3f * but report true size of parameter */ -From 21997bf5858b30062b0d9647ebc237b5dda3070c Mon Sep 17 00:00:00 2001 +From 30696eebe3d3cd688bac2080d822b9147c1d30b6 Mon Sep 17 00:00:00 2001 From: Matt Flax Date: Wed, 8 Mar 2017 20:04:13 +1100 -Subject: [PATCH 160/197] Add support for the AudioInjector.net Octo sound card +Subject: [PATCH 160/205] Add support for the AudioInjector.net Octo sound card --- arch/arm/boot/dts/overlays/Makefile | 1 + @@ -131879,10 +131879,10 @@ index 0000000000000000000000000000000000000000..9effea725798640887755dfa688da453 +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:audioinjector-octo-soundcard"); -From d7be16ddcb7b4828df51e5d406ba087bbd482ce1 Mon Sep 17 00:00:00 2001 +From d4396f35aba993cb4b83698c44b1c1d6c1c661c1 Mon Sep 17 00:00:00 2001 From: Matt Flax Date: Wed, 8 Mar 2017 21:13:24 +1100 -Subject: [PATCH 161/197] ASoC: bcm2835_i2s.c: relax the ch2 register setting +Subject: [PATCH 161/205] 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. @@ -131911,10 +131911,10 @@ index 6ba20498202ed36906b52096893a88867a79269f..c8dd065aea8414b47aa2ea4fc04168b5 format |= BCM2835_I2S_CH1(BCM2835_I2S_CHPOS(ch1pos)); format |= BCM2835_I2S_CH2(BCM2835_I2S_CHPOS(ch2pos)); -From 1f840683b494f03923d5f2370079d901220ada8e Mon Sep 17 00:00:00 2001 +From da15c69893e44bafda6f581df5841347f2a3a29d Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Fri, 10 Feb 2017 17:57:08 -0800 -Subject: [PATCH 162/197] build/arm64: Add rules for .dtbo files for dts +Subject: [PATCH 162/205] build/arm64: Add rules for .dtbo files for dts overlays We now create overlays as .dtbo files. @@ -131939,10 +131939,10 @@ index b9a4a934ca057623e0ea436fd9b2c7c0f675fced..54e3c38d6fd877827541cdc798de035c dtbs: prepare scripts -From 8a8e452a6b71b0e86fb30e269c30ea051c74cc7c Mon Sep 17 00:00:00 2001 +From 6006b9d774319d07169f5371535d36a37dd4d165 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 24 Feb 2015 13:40:50 +0000 -Subject: [PATCH 163/197] pinctrl-bcm2835: Fix interrupt handling for GPIOs +Subject: [PATCH 163/205] pinctrl-bcm2835: Fix interrupt handling for GPIOs 28-31 and 46-53 Contrary to the documentation, the BCM2835 GPIO controller actually has @@ -131975,10 +131975,10 @@ index 6351fe7f8e314ac5ebb102dd20847b383fd5b857..28745af5aadf3cb91fa7ff39118385c3 }, }; -From 06163ba5e9208031b9d9795dd39fe30bad369825 Mon Sep 17 00:00:00 2001 +From 241087fd2e533f54f335d30412663fa5f5cc1b3a Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 9 May 2016 17:28:18 -0700 -Subject: [PATCH 164/197] clk: bcm2835: Mark GPIO clocks enabled at boot as +Subject: [PATCH 164/205] clk: bcm2835: Mark GPIO clocks enabled at boot as critical. These divide off of PLLD_PER and are used for the ethernet and wifi @@ -132016,10 +132016,10 @@ index 41dccc4ebe6f367054822aed11cb0cd4d985c21a..7ec0e71cbcfbcd6c86e2f6c8080e1d62 * rate changes on at least of the parents. */ -From f01a6c56050a5827716a41f369563d2e103bd977 Mon Sep 17 00:00:00 2001 +From 843f389a764aca2a65cf11e9a97a1a9a0b825804 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 7 Mar 2016 15:05:11 +0000 -Subject: [PATCH 165/197] vchiq_arm: Tweak the logging output +Subject: [PATCH 165/205] vchiq_arm: Tweak the logging output Signed-off-by: Phil Elwell --- @@ -132094,10 +132094,10 @@ index d6757ee263fb61a689c0d38c0dbb65c57a8e39bb..7fd63cf6800d7ec35fbcb215a283630c switch (type) { -From e9851e9f719ab4b7de249f235be4ed826b70c020 Mon Sep 17 00:00:00 2001 +From 5d8d385e94e0ed70b78deb80b4d76e917a87740d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 18 Jan 2017 07:31:55 +1100 -Subject: [PATCH 166/197] clk: bcm2835: Don't rate change PLLs on behalf of DSI +Subject: [PATCH 166/205] 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 @@ -132269,10 +132269,10 @@ index 7ec0e71cbcfbcd6c86e2f6c8080e1d622ca5540a..3acf61ddeda8c27e6da0fd7e2beb4634 /* the clocks */ -From 31d81092985ffcdb6356c1339d687b3e4f3088bb Mon Sep 17 00:00:00 2001 +From 9f9e42cd33e80d28d66ab491e7f64bf45827cbef Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 18 Jan 2017 07:31:56 +1100 -Subject: [PATCH 167/197] clk: bcm2835: Register the DSI0/DSI1 pixel clocks. +Subject: [PATCH 167/205] 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 @@ -132515,10 +132515,10 @@ index 360e00cefd35679b49890234b5c369fb52b89e20..a0c812b0fa391d149b4f546db39bdc4b +#define BCM2835_CLOCK_DSI0P 49 +#define BCM2835_CLOCK_DSI1P 50 -From 4270fd59389a2ba73d7fceaedc68dcbb88d2d8e4 Mon Sep 17 00:00:00 2001 +From 88280e5253dc5208761c6deb8177177c8e2f8aad Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 18 Jan 2017 07:31:57 +1100 -Subject: [PATCH 168/197] clk: bcm2835: Add leaf clock measurement support, +Subject: [PATCH 168/205] clk: bcm2835: Add leaf clock measurement support, disabled by default This proved incredibly useful during debugging of the DSI driver, to @@ -132864,10 +132864,10 @@ index 428e75c8b970897d881b570228eb85e8aef28999..fe3298b54cdfb96bd90fb4f39e13921d /* the gates */ -From a9eaa88cf27664bc98a43722bca370f9c589c219 Mon Sep 17 00:00:00 2001 +From d360cbaa24f90de7d42760f8f7de74e4cbfedad7 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 26 Apr 2016 13:46:13 -0700 -Subject: [PATCH 169/197] drm/panel: Add support for the Raspberry Pi 7" +Subject: [PATCH 169/205] drm/panel: Add support for the Raspberry Pi 7" Touchscreen. This driver communicates with the Atmel microcontroller for sequencing @@ -133448,10 +133448,10 @@ index 0000000000000000000000000000000000000000..1a536fe4d040f5fafe324baee110a622 +MODULE_DESCRIPTION("Raspberry Pi 7-inch touchscreen driver"); +MODULE_LICENSE("GPL v2"); -From f1a6ebe1eb09d90450ef7b5ac234e01866c9ddcc Mon Sep 17 00:00:00 2001 +From c5101c0993c27727c53ba280c1f5cb06a95fb9b8 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 2 Jun 2016 12:29:45 -0700 -Subject: [PATCH 170/197] BCM270X: Add the DSI panel to the defconfig. +Subject: [PATCH 170/205] BCM270X: Add the DSI panel to the defconfig. Signed-off-by: Eric Anholt --- @@ -133500,10 +133500,10 @@ index 4d85c231c5ea0244e1b05fb4a5e3c8fd3e651ddf..baf316e3a69d421d79ec098c7ad2603c CONFIG_DRM_VC4=m CONFIG_FB=y -From c2a0900ac553fd17b120aa5edf378c3eaf043b27 Mon Sep 17 00:00:00 2001 +From d6049f3593bfd89125a0fb61a3c1e5873fa65308 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 13 Dec 2016 15:15:10 -0800 -Subject: [PATCH 171/197] ARM: bcm2835: dt: Add the DSI module nodes and +Subject: [PATCH 171/205] ARM: bcm2835: dt: Add the DSI module nodes and clocks. The modules stay disabled by default, and if you want to enable DSI @@ -133607,10 +133607,10 @@ index b710a4d67b8ec8c8c18ce8efb6f270e7cfb68e52..304dd291a9ae94700e8e628c0c9ebd3f compatible = "brcm,bcm2835-i2c"; reg = <0x7e804000 0x1000>; -From 8ff9e9e38fa39b3dc41db7cc3ce0a6f3912ccd94 Mon Sep 17 00:00:00 2001 +From 8e0d7ffe0ef3d438eb3e0a5ef1867cc6c88a0bc0 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 2 Jun 2016 15:09:35 -0700 -Subject: [PATCH 172/197] BCM270X: Enable the DSI panel node in the VC4 +Subject: [PATCH 172/205] BCM270X: Enable the DSI panel node in the VC4 overlay. Signed-off-by: Eric Anholt @@ -133763,10 +133763,10 @@ index fb45c6456b181b047d6cff8784f7696eb75da3c7..05faf1bfa1b7c73fd60b1efb813b969e __overlay__ { claim-clocks = < -From 4b1c5c59cf7ac3c7574aae4ffca9b690739376ff Mon Sep 17 00:00:00 2001 +From e0ad51b3f5630c4a2b2891d72c61d38a04aa37c3 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 15 Sep 2016 15:25:23 +0100 -Subject: [PATCH 173/197] drm/vc4: Set up SCALER_DISPCTRL at boot. +Subject: [PATCH 173/205] 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 @@ -133826,10 +133826,10 @@ index 39f6886b24100c43b590e47e0c7bc44846721d65..b3b297fba7097bc495fa8916292c5479 * SCALER_DISPSTAT_IRQDISP0. Note that short frame contributions are * always enabled. -From 4a3a136f2479c0be485de16bff864a4bc9d1cbe4 Mon Sep 17 00:00:00 2001 +From 93a7172e9edfe359fa4b4b9c002c0a2324347235 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 10 Feb 2016 16:17:29 -0800 -Subject: [PATCH 174/197] drm/vc4: Add support for feeding DSI encoders from +Subject: [PATCH 174/205] 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 @@ -133843,7 +133843,7 @@ Signed-off-by: Eric Anholt 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c -index bdf32c572fc2c46932daca934dfb002d05493883..0a861158740586836d2d47cccae4109ad4ec968d 100644 +index c7e478f672e184974a33bb9ca72b8aa62d76e97e..a4937e261202748924a5a327995b6f700afd5a97 100644 --- a/drivers/gpu/drm/vc4/vc4_crtc.c +++ b/drivers/gpu/drm/vc4/vc4_crtc.c @@ -352,38 +352,40 @@ static u32 vc4_get_fifo_full_level(u32 format) @@ -133944,10 +133944,10 @@ index b3b297fba7097bc495fa8916292c547925720199..385405a2df05eb3dd86d4f687aa82053 # define PV_VCONTROL_VIDEN BIT(0) -From 5e29efaaac02d8f6e6ac681123f14eb5e2cee999 Mon Sep 17 00:00:00 2001 +From 5cc0c887f8f855807eb0ed4788a287b17c3023b9 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 10 Feb 2016 11:42:32 -0800 -Subject: [PATCH 175/197] drm/vc4: Add DSI driver +Subject: [PATCH 175/205] 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, @@ -135775,10 +135775,10 @@ index 0000000000000000000000000000000000000000..17fcac381dbb37cd9a5ff210ad8578f4 + }, +}; -From 0b5165a947e2dc9717831e3db9085ffa8aaab2ea Mon Sep 17 00:00:00 2001 +From 95dd80652c49816379b9022b3a712f2ebef958c1 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Fri, 2 Dec 2016 14:48:12 +0100 -Subject: [PATCH 176/197] ARM: dts: bcm283x: Add VEC node in bcm283x.dtsi +Subject: [PATCH 176/205] ARM: dts: bcm283x: Add VEC node in bcm283x.dtsi Add the VEC (Video EnCoder) node definition in bcm283x.dtsi. @@ -135809,10 +135809,10 @@ index 304dd291a9ae94700e8e628c0c9ebd3fb98abb19..ee69fd481fabd22d8f45ecdcffacdbb1 compatible = "brcm,bcm2835-pixelvalve2"; reg = <0x7e807000 0x100>; -From 158f7af7923525d853ee08ee73cd6f8d42b370ef Mon Sep 17 00:00:00 2001 +From 8b3c5ccc22f7a4ae27dc91bb481c3bdfa1d0ae51 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Fri, 2 Dec 2016 14:48:13 +0100 -Subject: [PATCH 177/197] ARM: dts: bcm283x: Enable the VEC IP on all +Subject: [PATCH 177/205] ARM: dts: bcm283x: Enable the VEC IP on all RaspberryPi boards Enable the VEC IP on all RaspberryPi boards. @@ -135838,10 +135838,10 @@ index 58f7d874c70a9cf965e10ae3f14fe3bb00846b71..023630efa7c1d8601ba5e83d2fdb38a7 + status = "okay"; +}; -From 492a998d11954099bcdc47d5b4a62f8188ea9ef5 Mon Sep 17 00:00:00 2001 +From 16989487bc5e3c46301c9011df30234745f7f832 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 23 Jan 2017 11:41:54 -0800 -Subject: [PATCH 178/197] BCM270X: Disable VEC unless vc4-kms-v3d is present. +Subject: [PATCH 178/205] BCM270X: Disable VEC unless vc4-kms-v3d is present. Signed-off-by: Eric Anholt --- @@ -135880,10 +135880,10 @@ index 05faf1bfa1b7c73fd60b1efb813b969e10bbfefa..c57e795824e9261e0f60bcb40d6a5724 __overlay__ { claim-clocks = < -From 2512acef7ff8b8f73a593ba353f4d9b2240deeb7 Mon Sep 17 00:00:00 2001 +From 2e9eca32000d2f285410684372be193dad6a3243 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 1 Feb 2017 17:09:18 -0800 -Subject: [PATCH 179/197] drm/vc4: Name the primary and cursor planes in fkms. +Subject: [PATCH 179/205] drm/vc4: Name the primary and cursor planes in fkms. This makes debugging nicer, compared to trying to remember what the IDs are. @@ -135907,10 +135907,10 @@ index d18a1dae51a2275846c9826b5bf1ba57ae97b55c..e49ce68b607a7ffc2329e3235362f3bc if (type == DRM_PLANE_TYPE_PRIMARY) { vc4_plane->fbinfo = -From a6456a1a39189763359aed8155e68dc12ec56300 Mon Sep 17 00:00:00 2001 +From 41e1bdd573c73ae7e92816aa3ead8e773fc43c74 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 1 Feb 2017 17:10:09 -0800 -Subject: [PATCH 180/197] drm/vc4: Add DRM_DEBUG_ATOMIC for the insides of +Subject: [PATCH 180/205] drm/vc4: Add DRM_DEBUG_ATOMIC for the insides of fkms. Trying to debug weston on fkms involved figuring out what calls I was @@ -135980,10 +135980,10 @@ index e49ce68b607a7ffc2329e3235362f3bc21ed5cbb..dbf065677202fbebf8e3a0cffbe880aa RPI_FIRMWARE_SET_CURSOR_STATE, &packet_state, -From e31cbcb760fc049c33c8a34abdd123659df0fbe8 Mon Sep 17 00:00:00 2001 +From 97ea26709858bbfe01b27a15fc32b0a3676551d2 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 2 Feb 2017 09:42:18 -0800 -Subject: [PATCH 181/197] drm/vc4: Fix sending of page flip completion events +Subject: [PATCH 181/205] 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 @@ -136025,10 +136025,10 @@ index dbf065677202fbebf8e3a0cffbe880aa42daef3f..da818a207bfa639b8cea48d94bcf4566 static void vc4_crtc_handle_page_flip(struct vc4_crtc *vc4_crtc) -From 65e62cb794fd4c6fb359193793b45781209788bd Mon Sep 17 00:00:00 2001 +From d43138fbb9983b0c48a797e47c56031f0f896856 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 8 Feb 2017 15:00:54 -0800 -Subject: [PATCH 182/197] drm/vc4: Fulfill user BO creation requests from the +Subject: [PATCH 182/205] drm/vc4: Fulfill user BO creation requests from the kernel BO cache. The from_cache flag was actually "the BO is invisible to userspace", @@ -136081,10 +136081,10 @@ index 3f6704cf6608d7be47637c6aa585de087b7f74ee..5ec14f25625dde6fd61e10415092fa25 cma_obj = drm_gem_cma_create(dev, size); -From df3ee0ab14430cc4f86fae34415d78f93514fe11 Mon Sep 17 00:00:00 2001 +From 67acfa696e366610218724d8916c4d1de88da936 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 9 Feb 2017 09:23:34 -0800 -Subject: [PATCH 183/197] drm/vc4: Fix OOPSes from trying to cache a partially +Subject: [PATCH 183/205] drm/vc4: Fix OOPSes from trying to cache a partially constructed BO. If a CMA allocation failed, the partially constructed BO would be @@ -136118,10 +136118,10 @@ index 5ec14f25625dde6fd61e10415092fa25527cc151..fd83a28076564b9ea5cf0f2ba29b884e if (!cache_list) { vc4_bo_destroy(bo); -From 9d8c2ea8add7ba44d67db3848b5c75590942d951 Mon Sep 17 00:00:00 2001 +From 4ee40c73bb65066ed4e12ae9b26955abc74935ff Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 12 Oct 2015 08:58:08 -0700 -Subject: [PATCH 184/197] drm/vc4: Verify at boot that CMA doesn't cross a +Subject: [PATCH 184/205] 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 @@ -136204,10 +136204,10 @@ index c960459eda7e640ea55be1d4ed80c6a9125a8877..b50245282a18bc790da0f901944c2e67 static unsigned long cma_bitmap_aligned_mask(const struct cma *cma, int align_order) -From 33f13fae17a4f46e876b3e892285a50c8f82197e Mon Sep 17 00:00:00 2001 +From 5dc532d4756ce409c6e1f9673c6f8e4787e8444a Mon Sep 17 00:00:00 2001 From: Scott Ellis Date: Thu, 23 Feb 2017 11:56:20 -0500 -Subject: [PATCH 185/197] Add ads1015 driver to config +Subject: [PATCH 185/205] Add ads1015 driver to config --- arch/arm/configs/bcm2709_defconfig | 2 +- @@ -136245,10 +136245,10 @@ index 0768998e5cbcc96714d546f656ff59eafe2dc754..efc4898aca911d5c97426a38b0f1808b CONFIG_FB=y CONFIG_FB_BCM2708=y -From e226a1850da6a8b3fb1dfa2595e03233d37ff71b Mon Sep 17 00:00:00 2001 +From 9e458e70eeb9ecae5c0f0ec7ddcbe8fe87c32d0a Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Thu, 23 Feb 2017 17:54:31 -0800 -Subject: [PATCH 186/197] drm/vc4: Don't wait for vblank when updating the +Subject: [PATCH 186/205] drm/vc4: Don't wait for vblank when updating the cursor Commonly used desktop environments such as xfce4 and gnome @@ -136305,10 +136305,10 @@ index 686cdd3c86f2e9178768282a0dd173850e0bf063..7bdbb0e2b50f9202efe1177df761b379 * expected change from the drm_mode_cursor_universal() * helper. -From 57b2948e9950caaddd1823054c23d2db92afb07d Mon Sep 17 00:00:00 2001 +From e0f85d10d7ed31141d7e7be16a32f49126ea4a1c Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 6 Mar 2017 12:17:16 -0800 -Subject: [PATCH 187/197] panel-raspberrypi-touchscreen: Round up clk rate to +Subject: [PATCH 187/205] panel-raspberrypi-touchscreen: Round up clk rate to fix DSI panel. Commit 488f9bc8e3def93e0baef53cee2026c2cb0d8956 slightly increased the @@ -136343,10 +136343,10 @@ index 1a536fe4d040f5fafe324baee110a6225dd0be08..7f315f04b109621ca7f3861fdd8acf95 .hsync_start = HACT + HFP, .hsync_end = HACT + HFP + HSW, -From 5335d957a10678c82e61c9cb0ae3e31e3aa7cc5f Mon Sep 17 00:00:00 2001 +From 1659209e09cb980be0ce9355594cb82708b12d44 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Mar 2017 12:30:37 +0000 -Subject: [PATCH 188/197] thermal: Compatible strings for bcm2836, bcm2837 +Subject: [PATCH 188/205] thermal: Compatible strings for bcm2836, bcm2837 The upstream dt-bindings documentation for bcm2835-thermal (which exists even though the driver isn't upstreamed) says to use @@ -136378,10 +136378,10 @@ index c63fb9f9d143e19612a18fe530c7b2b3518a22a4..25b78c3eac1503fbc9e679b963a6284b }; MODULE_DEVICE_TABLE(of, bcm2835_thermal_of_match_table); -From d0d24daf11037423e131e6436db672cf6d140906 Mon Sep 17 00:00:00 2001 +From 6d74a91a6cf9071b6b85768dd248c08ececef46e Mon Sep 17 00:00:00 2001 From: John Greb Date: Wed, 8 Mar 2017 15:12:29 +0000 -Subject: [PATCH 189/197] Match dwc2 device-tree fifo sizes to the hardware +Subject: [PATCH 189/205] 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. @@ -136412,10 +136412,10 @@ index 527abc9f0ddf71f4dc7d58336d87684c931cc2f3..265a16bab008453edba198cf2366c423 }; }; -From bd67a15c2205d93622832289054bd8f567040ca8 Mon Sep 17 00:00:00 2001 +From a5ee8a6256c58fadd572d12b509d01dcc6b8f25b Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 7 Mar 2017 12:18:20 +0000 -Subject: [PATCH 190/197] BCM270X_DT: Invert Pi3 power LED to match fw change +Subject: [PATCH 190/205] BCM270X_DT: Invert Pi3 power LED to match fw change Firmware expgpio driver reworked due to complaint over hotplug detect. @@ -136441,10 +136441,10 @@ index 173103aaca503833b5e29530ed94e14c7cab0444..b21d2866d204adc533b46d581028f290 }; -From 627fcf02cbfe9ae343103e3f022aafea90bea33b Mon Sep 17 00:00:00 2001 +From 4a722f8e4fb8a0eb65333a7e6e9534c56c193dc0 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Mar 2017 09:10:05 +0000 -Subject: [PATCH 191/197] BCM270X_DT: Add lm75 to i2c-sensor overlay +Subject: [PATCH 191/205] BCM270X_DT: Add lm75 to i2c-sensor overlay See: https://www.raspberrypi.org/forums/viewtopic.php?f=107&t=177236 @@ -136507,10 +136507,10 @@ index 31bda8da4cb6a56bfe493a81b918900995fb0589..606b2d5012abf2e85712be631c42ea40 }; }; -From 17867d6c9127f1fb240ebd9b2c00889b05808801 Mon Sep 17 00:00:00 2001 +From 36a11ec05fd2f955b4f38133300f19875f5f1a87 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Tue, 14 Mar 2017 14:23:06 +0000 -Subject: [PATCH 192/197] bcm2835-gpio-exp: Copy/paste error adding base twice +Subject: [PATCH 192/205] 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. @@ -136536,10 +136536,10 @@ index 681a91492d4c33bdfd42416e069218e8611cc4d9..d68adafaee4ad406f45f4ff0d6b7c1ad set.state = val; /* Output state */ -From c3c664d85ff314c2c31382ca220f82816ec2be9d Mon Sep 17 00:00:00 2001 +From 349f0d4c98004520df476c04a7d994222227ac52 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Wed, 15 Mar 2017 11:12:40 +0000 -Subject: [PATCH 193/197] bcm2835-camera: Correct port_parameter_get return +Subject: [PATCH 193/205] bcm2835-camera: Correct port_parameter_get return value The API for port_parameter_get() requires that the @@ -136597,10 +136597,10 @@ index e4b243b33f58913f3d2952c97d2a2e3fbbbd0ae8..ec2853ba9d4b1b0cd6e07a495a424e15 pr_debug("%s:result:%d component:0x%x port:%d parameter:%d\n", __func__, ret, port->component->handle, port->handle, parameter_id); -From 4840a0047b424de53447dc9b30c0ccc09b5c7266 Mon Sep 17 00:00:00 2001 +From 207a9a8733dd04a5d2e636e11b786bf1f9bf9f3d Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 17 Mar 2017 12:24:41 +0000 -Subject: [PATCH 194/197] config: Make spidev a loadable module +Subject: [PATCH 194/205] 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. @@ -136656,10 +136656,10 @@ index efc4898aca911d5c97426a38b0f1808b3c0d4baa..e65b2106d97ea9351c1d85166d2bff39 CONFIG_SND_SIMPLE_CARD=m CONFIG_SOUND_PRIME=m -From d91d15636de3afbd8002a9bf63a28e614effa4a4 Mon Sep 17 00:00:00 2001 +From d39ab68e32800b114134ce5d3a6c799c96e39423 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 23 Mar 2017 10:06:56 +0000 -Subject: [PATCH 195/197] ASoC: Add prompt for ICS43432 codec +Subject: [PATCH 195/205] 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 @@ -136684,10 +136684,10 @@ index cd02edde708f860ba90ef7892339ef311c898746..fbcc1516af4f463e5e0a1a8ced04b82c config SND_SOC_INNO_RK3036 tristate "Inno codec driver for RK3036 SoC" -From ba04d1c5fe2935f995a828d69f1af824e03d59e4 Mon Sep 17 00:00:00 2001 +From 7b71cfa31c62d0c70b94edeb14dfa59ae14e903b Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 23 Mar 2017 16:34:46 +0000 -Subject: [PATCH 196/197] bcm2835-aux: Add aux interrupt controller +Subject: [PATCH 196/205] 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 @@ -136851,10 +136851,10 @@ index bd750cf2238d61489811e7d7bd3b5f9950ed53c8..41e0702fae4692221980b0d02aed1ba6 BCM2835_AUX_CLOCK_COUNT, GFP_KERNEL); if (!onecell) -From 578d17464a0579290e8c83992944eaa506e8ee1f Mon Sep 17 00:00:00 2001 +From e501ecad1072bc180e1ce90c47addacfed96de5c Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 23 Mar 2017 17:08:44 +0000 -Subject: [PATCH 197/197] BCM270X_DT: Enable AUX interrupt controller in DT +Subject: [PATCH 197/205] BCM270X_DT: Enable AUX interrupt controller in DT See: https://github.com/raspberrypi/linux/issues/1484 https://github.com/raspberrypi/linux/issues/1573 @@ -136906,3 +136906,3493 @@ index ee69fd481fabd22d8f45ecdcffacdbb185e11f55..278e7a94a79d01e600f85daa6ec86cd0 clocks = <&aux BCM2835_AUX_CLOCK_SPI2>; #address-cells = <1>; #size-cells = <0>; + +From 178e5e6085d6093f9fe9285923216127e1815279 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 28 Mar 2017 14:22:20 +0100 +Subject: [PATCH 198/205] 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 5422d772d134eb455c1fe9927df9373d5c2e755e Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 28 Mar 2017 17:41:30 +0100 +Subject: [PATCH 199/205] 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 9b109ee9fdf12c7e33ed89beed25fab81bee580c Mon Sep 17 00:00:00 2001 +From: Matt Flax +Date: Mon, 27 Mar 2017 22:26:49 +1100 +Subject: [PATCH 200/205] AudioInjector Octo: sample rates, regulators, reset + +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 + +Reference the bcm270x DT regulators in the overlay. + +This patch adds a reset GPIO for the AudioInjector.net octo sound card. +--- + .../dts/overlays/audioinjector-addons-overlay.dts | 5 ++ + sound/soc/bcm/audioinjector-octo-soundcard.c | 81 ++++++++++++++++++---- + 2 files changed, 72 insertions(+), 14 deletions(-) + +diff --git a/arch/arm/boot/dts/overlays/audioinjector-addons-overlay.dts b/arch/arm/boot/dts/overlays/audioinjector-addons-overlay.dts +index dbf2f3cacc2e6bf5b7116fbadd97f2781580a79c..a40bb1193a4cebc5672709e8db861e1167d3a699 100644 +--- a/arch/arm/boot/dts/overlays/audioinjector-addons-overlay.dts ++++ b/arch/arm/boot/dts/overlays/audioinjector-addons-overlay.dts +@@ -25,6 +25,10 @@ + reg = <0x48>; + clocks = <&cs42448_mclk>; + clock-names = "mclk"; ++ VA-supply = <&vdd_5v0_reg>; ++ VD-supply = <&vdd_3v3_reg>; ++ VLS-supply = <&vdd_3v3_reg>; ++ VLC-supply = <&vdd_3v3_reg>; + status = "okay"; + }; + +@@ -42,6 +46,7 @@ + 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"; +diff --git a/sound/soc/bcm/audioinjector-octo-soundcard.c b/sound/soc/bcm/audioinjector-octo-soundcard.c +index 9effea725798640887755dfa688da45338718afc..dcf403ab37639ba79e38278d7e4b1ade452c292a 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, 32000, 24000, 16000, 8000, 88200, 44100, 29400, 22050, 14700, ++}; ++ ++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,43 @@ 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 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; ++ } + } + + static int audioinjector_octo_trigger(struct snd_pcm_substream *substream, +@@ -92,25 +143,12 @@ 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: +@@ -231,6 +269,21 @@ 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, 1); ++ msleep(500); ++ if (codec_rst_gpio) ++ gpiod_set_value(codec_rst_gpio, 0); ++ msleep(500); ++ if (codec_rst_gpio) ++ gpiod_set_value(codec_rst_gpio, 1); ++ msleep(500); ++ + if (i2s_node && codec_node) { + dai->cpu_dai_name = NULL; + dai->cpu_of_node = i2s_node; + +From e89ed7afe044ecc9348a1eb4962750ff9589dac1 Mon Sep 17 00:00:00 2001 +From: Peter Malkin +Date: Mon, 27 Mar 2017 16:38:21 -0700 +Subject: [PATCH 201/205] 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 8ce1707b537e9e21589887b93c0dbf9302cb5974..a58ef95ea4ef28946d51f717d96f9be63115de3f 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -884,6 +884,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 e65b2106d97ea9351c1d85166d2bff39d458ded3..cdf52529d8b5176303a60217eb28dc0b6f2f7184 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -877,6 +877,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 706c500b5303ac3a0fd8687d23dc9f06c7d08388..cb9edcc96247e47855907da06b14a13695d408df 100644 +--- a/sound/soc/bcm/Kconfig ++++ b/sound/soc/bcm/Kconfig +@@ -18,6 +18,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 1476b44f72b915f2560f2028f6cabe44323206f9 Mon Sep 17 00:00:00 2001 +From: Raashid Muhammed +Date: Mon, 27 Mar 2017 12:35:00 +0530 +Subject: [PATCH 202/205] 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 cb9edcc96247e47855907da06b14a13695d408df..ee59713344b3d0385c4d659d6dab3da8c2a60633 100644 +--- a/sound/soc/bcm/Kconfig ++++ b/sound/soc/bcm/Kconfig +@@ -162,6 +162,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 2b4910f7fe43fe626198930d0378ddc5a90e7ca0 Mon Sep 17 00:00:00 2001 +From: BabuSubashChandar +Date: Tue, 28 Mar 2017 20:04:42 +0530 +Subject: [PATCH 203/205] 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 ee59713344b3d0385c4d659d6dab3da8c2a60633..be474a58151889f145ca5aeb789ea6c116c4fd44 100644 +--- a/sound/soc/bcm/Kconfig ++++ b/sound/soc/bcm/Kconfig +@@ -176,6 +176,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 8cd4113164673d7421a4575e5486ba269788982d Mon Sep 17 00:00:00 2001 +From: BabuSubashChandar C +Date: Thu, 30 Mar 2017 20:17:27 +0530 +Subject: [PATCH 204/205] 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 a58ef95ea4ef28946d51f717d96f9be63115de3f..4afe1a8ee36e62f33bfef7d76f2a460e7187eaff 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -890,6 +890,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 be474a58151889f145ca5aeb789ea6c116c4fd44..c472f67b6167fecbdc099c1ceaa96b10555e8039 100644 +--- a/sound/soc/bcm/Kconfig ++++ b/sound/soc/bcm/Kconfig +@@ -177,11 +177,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 9305d406ac71a4c9f18a8ff9855156c5f8e341d9 Mon Sep 17 00:00:00 2001 +From: BabuSubashChandar +Date: Sat, 1 Apr 2017 00:46:52 +0530 +Subject: [PATCH 205/205] 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 4afe1a8ee36e62f33bfef7d76f2a460e7187eaff..d2ed09d05f9db97fd1f8e4e12595a24521c48749 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -892,6 +892,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 cdf52529d8b5176303a60217eb28dc0b6f2f7184..83f81127ac464cfd527e52d7893ce6f0c73d231a 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -883,7 +883,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); + } +