From f8851738fe3ea4baed9db0e1100a2a0d53e03fc7 Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Fri, 24 Nov 2017 19:42:55 +0000 Subject: [PATCH] RPi: update linux support patch for linux 4.14.1 --- .../patches/linux/linux-01-RPi_support.patch | 5052 ++++++++++++++++- 1 file changed, 4774 insertions(+), 278 deletions(-) diff --git a/projects/RPi/patches/linux/linux-01-RPi_support.patch b/projects/RPi/patches/linux/linux-01-RPi_support.patch index addc4e1eaf..f3680572b7 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 1e941cd6e8d9f3f65ce9ddee60ec26fb84c0bbb6 Mon Sep 17 00:00:00 2001 +From ffdbe5dea5f7cab618a31f12a28dcf41e7ce5800 Mon Sep 17 00:00:00 2001 From: Dan Pasanen Date: Thu, 21 Sep 2017 09:55:42 -0500 -Subject: [PATCH 001/139] arm: partially revert +Subject: [PATCH 001/171] arm: partially revert 702b94bff3c50542a6e4ab9a4f4cef093262fe65 * Re-expose some dmi APIs for use in VCSM @@ -106,10 +106,10 @@ index 054b491ff7649ca067ff821770aec80a4da42102..70e8b7d3443467ae9595924f1a9d043b EXPORT_SYMBOL(cpu_cache); #endif -From 47c46ebd6f0dd53587525c5abf3a2dda3fd9c97b Mon Sep 17 00:00:00 2001 +From 1b9bdc2b6f47f337b57808008916226b05267c68 Mon Sep 17 00:00:00 2001 From: Steve Glendinning Date: Thu, 19 Feb 2015 18:47:12 +0000 -Subject: [PATCH 002/139] smsx95xx: fix crimes against truesize +Subject: [PATCH 002/171] 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. @@ -156,10 +156,10 @@ index 309b88acd3d0b6ca1528dde7b27a23926f9be952..25e37195ceb00cfc0ced7638e8b571a1 usbnet_skb_return(dev, ax_skb); } -From feaf60838d05a13c2dfcfb9bacebc6b2ded6a7f3 Mon Sep 17 00:00:00 2001 +From 96676133f1fefad511de277796bb875867664502 Mon Sep 17 00:00:00 2001 From: Sam Nazarko Date: Fri, 1 Apr 2016 17:27:21 +0100 -Subject: [PATCH 003/139] smsc95xx: Experimental: Enable turbo_mode and +Subject: [PATCH 003/171] smsc95xx: Experimental: Enable turbo_mode and packetsize=2560 by default See: http://forum.kodi.tv/showthread.php?tid=285288 @@ -202,10 +202,10 @@ index 25e37195ceb00cfc0ced7638e8b571a1b0b8e6f1..09c7d4a07299e70b1cdc9df2c2c4cb39 netif_dbg(dev, ifup, dev->net, "rx_urb_size=%ld\n", -From 3af16ca93ebb7063c822ca7023b4d4d679098024 Mon Sep 17 00:00:00 2001 +From cc7be48ab264d6de7b2443d69355f682739493b5 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 17:26:38 +0000 -Subject: [PATCH 004/139] Allow mac address to be set in smsc95xx +Subject: [PATCH 004/171] Allow mac address to be set in smsc95xx Signed-off-by: popcornmix --- @@ -301,10 +301,10 @@ index 09c7d4a07299e70b1cdc9df2c2c4cb39d2207c37..4d9704d0b184df9bd7ddbe6769e40a75 eth_hw_addr_random(dev->net); netif_dbg(dev, ifup, dev->net, "MAC address set to eth_random_addr\n"); -From 831c59492cd83cff2141ab26b90790063e0e4b41 Mon Sep 17 00:00:00 2001 +From 2f057ba29280f02205021d2ef223ce34fa2a3484 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 13 Mar 2015 12:43:36 +0000 -Subject: [PATCH 005/139] Protect __release_resource against resources without +Subject: [PATCH 005/171] Protect __release_resource against resources without parents Without this patch, removing a device tree overlay can crash here. @@ -332,10 +332,10 @@ index 9b5f04404152c296af3a96132f27cfc80ffa9af9..f8a9af6e6b915812be2ba2c1c2b40106 for (;;) { tmp = *p; -From 083a9d562254f9c2d23505a9765db84d64a278df Mon Sep 17 00:00:00 2001 +From 65321a6df45520b9d2a6950fe2776718aea752fb Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 4 Dec 2015 17:41:50 +0000 -Subject: [PATCH 006/139] irq-bcm2836: Prevent spurious interrupts, and trap +Subject: [PATCH 006/171] irq-bcm2836: Prevent spurious interrupts, and trap them early The old arch-specific IRQ macros included a dsb to ensure the @@ -362,10 +362,10 @@ index dc8c1e3eafe794a3af83dd987a6d6362d14dd5ee..e8204d9af58f1b893505c06902a83390 #endif } else if (stat) { -From 4a3fb8e5b929c9606bc5503a2a1c997652ff4c54 Mon Sep 17 00:00:00 2001 +From b7bb2ac8343a5aac4b611775d74ca4dd8059b732 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 9 Feb 2017 14:33:30 +0000 -Subject: [PATCH 007/139] irq-bcm2836: Avoid "Invalid trigger warning" +Subject: [PATCH 007/171] irq-bcm2836: Avoid "Invalid trigger warning" Initialise the level for each IRQ to avoid a warning from the arm arch timer code. @@ -389,10 +389,10 @@ index e8204d9af58f1b893505c06902a83390c2ea8509..6e3fab9587b782e026c01fa6b6e40338 static void -From 8f81dbb6e19dfebfbd4aefbf412bae6b90a9e1f5 Mon Sep 17 00:00:00 2001 +From 6bec0ebccee77ce36fa0412144a9bfd0234d0145 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 008/139] irqchip: bcm2835: Add FIQ support +Subject: [PATCH 008/171] irqchip: bcm2835: Add FIQ support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -521,10 +521,10 @@ index d2da8a1e6b1b71381e382d034e7a94e865a6c3da..c4903360eabc2bef04f8e745782cea26 } -From edb3aa3fc2dde0a024b3c474e44604c8938b5098 Mon Sep 17 00:00:00 2001 +From 54840f675e73f0be60961752f3a49f53ee17c7f6 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 009/139] irqchip: irq-bcm2835: Add 2836 FIQ support +Subject: [PATCH 009/171] irqchip: irq-bcm2835: Add 2836 FIQ support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -623,10 +623,10 @@ index c4903360eabc2bef04f8e745782cea268fb22897..13356d3b7bcd508f058c6a9e3c4b0b38 for (b = 0; b < NR_BANKS; b++) { for (i = 0; i < bank_irqs[b]; i++) { -From aeacb7e940567c94b1f453d9db7ae56d0e626f5f Mon Sep 17 00:00:00 2001 +From df41939f6f62261df588cd500ac141d80a906f37 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 8 May 2017 16:43:40 +0100 -Subject: [PATCH 010/139] irq_bcm2836: Send event when onlining sleeping cores +Subject: [PATCH 010/171] irq_bcm2836: Send event when onlining sleeping cores In order to reduce power consumption and bus traffic, it is sensible for secondary cores to enter a low-power idle state when waiting to @@ -662,10 +662,10 @@ index 6e3fab9587b782e026c01fa6b6e40338ef0c8d0a..86b357ae027bf8ba1ac32cd150a8cf21 } -From 42b26334d34a98a3c654ff1e7c588ebc7258eeb7 Mon Sep 17 00:00:00 2001 +From 0a33a8e2173511bbb6b028905c8b672752ea976a Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Jul 2015 10:26:09 +0100 -Subject: [PATCH 011/139] spidev: Add "spidev" compatible string to silence +Subject: [PATCH 011/171] spidev: Add "spidev" compatible string to silence warning See: https://github.com/raspberrypi/linux/issues/1054 @@ -686,10 +686,10 @@ index cda10719d1d1b21b32866d2b79363faa461ab8e1..4f3779d3aa0960640506725bde918075 }; MODULE_DEVICE_TABLE(of, spidev_dt_ids); -From 49751f519fc2e642a96f30c0cd0a5429a10e1cfb Mon Sep 17 00:00:00 2001 +From 96d0d81b8e0473fccb4243d419cfe09d6e42aeb5 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 24 Jun 2015 14:10:44 +0100 -Subject: [PATCH 012/139] spi-bcm2835: Support pin groups other than 7-11 +Subject: [PATCH 012/171] 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 @@ -770,10 +770,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 25f128fc8eb74b24abf45dc45ffd5a111e5e03b9 Mon Sep 17 00:00:00 2001 +From 275b756f8ffe662021eb6a9425b3fba8b1887ca5 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 1 Jul 2016 22:09:24 +0100 -Subject: [PATCH 013/139] spi-bcm2835: Disable forced software CS +Subject: [PATCH 013/171] 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 @@ -807,10 +807,10 @@ index 5dfe20ffc2866fa6789825016c585175a29705b6..8493474d286f7a1ac6454a22c61c8c2c return 0; } -From 8e9d73bae6e82562fe5a568b439b0e622c84b04e Mon Sep 17 00:00:00 2001 +From 744da6a613d37db9e995021716d8034bf0493bd3 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 8 Nov 2016 21:35:38 +0000 -Subject: [PATCH 014/139] spi-bcm2835: Remove unused code +Subject: [PATCH 014/171] spi-bcm2835: Remove unused code --- drivers/spi/spi-bcm2835.c | 61 ----------------------------------------------- @@ -898,10 +898,10 @@ index 8493474d286f7a1ac6454a22c61c8c2cef9121bf..33d75ad38a7f77d085321ace9101900a } -From a4f1dd5281118bb8ead36808d4098819483906d7 Mon Sep 17 00:00:00 2001 +From d386fd68c19b4c5242b6b40face1cfc5de7da143 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 015/139] ARM: bcm2835: Set Serial number and Revision +Subject: [PATCH 015/171] ARM: bcm2835: Set Serial number and Revision MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -954,10 +954,10 @@ index 0c1edfc98696da0e0bb7f4a18cdfbcdd27a9795d..8f152266ba9b470df2eaaed9ebcf158e static const char * const bcm2835_compat[] = { -From a35fdb6acb8644a56c8b61d1d664f12515268329 Mon Sep 17 00:00:00 2001 +From 1485912c60e05d97928c95d268cb6e1e29c2d204 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 016/139] dmaengine: bcm2835: Load driver early and support +Subject: [PATCH 016/171] dmaengine: bcm2835: Load driver early and support legacy API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -1060,10 +1060,10 @@ index 6204cc32d09c5096df8aec304c3c37b3bcb6be44..599c218dc8a73172dd4bd4a058fc8f95 MODULE_ALIAS("platform:bcm2835-dma"); MODULE_DESCRIPTION("BCM2835 DMA engine driver"); -From 11af9b9720d1fc69009b49137832791886abed46 Mon Sep 17 00:00:00 2001 +From 02ae3430c2d825e534b5c6cf54dc9584c6c55c46 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 25 Jan 2016 17:25:12 +0000 -Subject: [PATCH 017/139] firmware: Updated mailbox header +Subject: [PATCH 017/171] firmware: Updated mailbox header --- include/soc/bcm2835/raspberrypi-firmware.h | 9 +++++++++ @@ -1124,10 +1124,10 @@ index cb979ad90401e299344dd5fae38d09c489d8bd58..30fb37fe175df604a738258a2a632bca RPI_FIRMWARE_VCHIQ_INIT = 0x00048010, -From d0695bb98c4c15c10bedec0f85b6dd093760eb47 Mon Sep 17 00:00:00 2001 +From 4b93992df85ec095f52d1575ea09ea9a59206d10 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 15 Jun 2016 16:48:41 +0100 -Subject: [PATCH 018/139] rtc: Add SPI alias for pcf2123 driver +Subject: [PATCH 018/171] rtc: Add SPI alias for pcf2123 driver Without this alias, Device Tree won't cause the driver to be loaded. @@ -1147,10 +1147,10 @@ index 8895f77726e8da5444afcd602dceff8f25a9b3fd..1833b8853ceb0e6147cceb93a00e558c MODULE_LICENSE("GPL"); +MODULE_ALIAS("spi:rtc-pcf2123"); -From 51a256cabd5de176564f0de12f31e396c1c39663 Mon Sep 17 00:00:00 2001 +From d8906c0d2fddf3c5fb854c85bd5ec7b5191d28ea 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 019/139] watchdog: bcm2835: Support setting reboot partition +Subject: [PATCH 019/171] watchdog: bcm2835: Support setting reboot partition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -1252,10 +1252,10 @@ index b339e0e67b4c1275fd4992fea4f1e24c0575b783..26b7177573fac2af1cd4ab5488d2686f static int bcm2835_wdt_probe(struct platform_device *pdev) -From cd8a202b50670965c1d32aedc36cf0f8c5f96326 Mon Sep 17 00:00:00 2001 +From 5c78e89047cb6d132c81bd8e5d29f272b42c045a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 5 Apr 2016 19:40:12 +0100 -Subject: [PATCH 020/139] reboot: Use power off rather than busy spinning when +Subject: [PATCH 020/171] reboot: Use power off rather than busy spinning when halt is requested --- @@ -1278,10 +1278,10 @@ index 3b2aa9a9fe268d45335f781c4aa22cf573753a1b..0180d89a34af45c56243fe0f17fbe209 /* -From e44c3831a3963bd3fbea3828c6d3548af8d90aa3 Mon Sep 17 00:00:00 2001 +From 71959d17f83da8d145ce8b38b8fdf106c750b0a9 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 9 Nov 2016 13:02:52 +0000 -Subject: [PATCH 021/139] bcm: Make RASPBERRYPI_POWER depend on PM +Subject: [PATCH 021/171] bcm: Make RASPBERRYPI_POWER depend on PM --- drivers/soc/bcm/Kconfig | 1 + @@ -1300,10 +1300,10 @@ index 49f1e2a75d614bc21db152327c7b425ae2504f8d..dccd2374ed00631abd441e3e9d78ee74 help This enables support for the RPi power domains which can be enabled -From 145d3d2b90b0714a74b4a61f9cea26590e81d8e1 Mon Sep 17 00:00:00 2001 +From 043ddc1488751d22dc70e03a16fd27b63ccc4768 Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Fri, 2 Sep 2016 16:45:27 +0100 -Subject: [PATCH 022/139] Register the clocks early during the boot process, so +Subject: [PATCH 022/171] 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. @@ -1348,10 +1348,10 @@ index 58ce6af8452db9ca8b4d3c380a06e448919f6a8d..11d89d106026f15719ea25047d6f357b MODULE_AUTHOR("Eric Anholt "); MODULE_DESCRIPTION("BCM2835 clock driver"); -From 16f903d2e857e9a7ab9eaf0b10a0ca7e2ccf0599 Mon Sep 17 00:00:00 2001 +From e18886dde5a3eb02ff298cad2ff4fdb8087d4fac Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 6 Dec 2016 17:05:39 +0000 -Subject: [PATCH 023/139] bcm2835-rng: Avoid initialising if already enabled +Subject: [PATCH 023/171] bcm2835-rng: Avoid initialising if already enabled Avoids the 0x40000 cycles of warmup again if firmware has already used it --- @@ -1377,10 +1377,10 @@ index 574211a495491d9d6021dcaefe4274a63ed02055..e66c0fca8c6090e32f72796c0877a1cf err = hwrng_register(&bcm2835_rng_ops); if (err) { -From 58a18d3a7097df54c34a3286b66ad9dcd6fb60c7 Mon Sep 17 00:00:00 2001 +From 9128a5ad996d474cc5d562368485d86e5432a6f8 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 24 Aug 2016 16:28:44 +0100 -Subject: [PATCH 024/139] kbuild: Ignore dtco targets when filtering symbols +Subject: [PATCH 024/171] kbuild: Ignore dtco targets when filtering symbols --- scripts/Kbuild.include | 2 +- @@ -1400,10 +1400,10 @@ index 9ffd3dda3889c56a7a72229bed21ff5c49d62856..00da6c9bacbf33334233e22ca5209ade esac | tr ";" "\n" | sed -rn 's/^.*=== __KSYM_(.*) ===.*$$/KSYM_\1/p' -From c5573503ce6661533cd8521fba980080c8eface0 Mon Sep 17 00:00:00 2001 +From 65f161e58c52ad2b826eb0f197671ea642467714 Mon Sep 17 00:00:00 2001 From: Robert Tiemann Date: Mon, 20 Jul 2015 11:01:25 +0200 -Subject: [PATCH 025/139] BCM2835_DT: Fix I2S register map +Subject: [PATCH 025/171] BCM2835_DT: Fix I2S register map --- Documentation/devicetree/bindings/dma/brcm,bcm2835-dma.txt | 4 ++-- @@ -1441,10 +1441,10 @@ index 65783de0aedf3da79adc36fd077b7a89954ddb6b..a89fe4220fdc3f26f75ee66daf187554 dmas = <&dma 2>, <&dma 3>; -From 3665b63741d4e6e19a6a04f231ee8ceb16f56e95 Mon Sep 17 00:00:00 2001 +From c8361539e9aaa2d5d6fe519d38aed564eff743c8 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Feb 2017 17:20:08 +0000 -Subject: [PATCH 026/139] clk-bcm2835: Mark used PLLs and dividers CRITICAL +Subject: [PATCH 026/171] 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 @@ -1472,10 +1472,10 @@ index 11d89d106026f15719ea25047d6f357b4bfcb2c5..fe8f5d65f2749cb3ddc878df61664826 divider->data = data; -From b0edca19a6e012620cb8936d0cd3d2d5e79dcf50 Mon Sep 17 00:00:00 2001 +From 50d508151cd5e0b5c6271b78102bef460a6c5cc4 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Feb 2017 17:20:08 +0000 -Subject: [PATCH 027/139] clk-bcm2835: Add claim-clocks property +Subject: [PATCH 027/171] 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, @@ -1577,10 +1577,10 @@ index fe8f5d65f2749cb3ddc878df616648267441e0ee..92b5e0f5145b32d3bfc3592fe381e8be sizeof(cprman_parent_names)); of_clk_parent_fill(dev->of_node, cprman->real_parent_names, -From cdf411154053a81e8cdcad3c3f78fe98d10efb1c Mon Sep 17 00:00:00 2001 +From 1dccd7e71b262d31be374e4ae5f9286efaa75fc4 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 6 Mar 2017 09:06:18 +0000 -Subject: [PATCH 028/139] clk-bcm2835: Read max core clock from firmware +Subject: [PATCH 028/171] 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 @@ -1695,10 +1695,10 @@ index 92b5e0f5145b32d3bfc3592fe381e8be3cd90c72..336f8c9c44325d0a94e591a8557f7af2 for (i = 0; !of_property_read_u32_index(pdev->dev.of_node, "claim-clocks", -From 09e5a954456bed9e3c31a40d2f5dec4c34b08384 Mon Sep 17 00:00:00 2001 +From 56bfb9dc7cc8bfe89336fcca9d64ba64e292454e Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 9 May 2016 17:28:18 -0700 -Subject: [PATCH 029/139] clk: bcm2835: Mark GPIO clocks enabled at boot as +Subject: [PATCH 029/171] clk: bcm2835: Mark GPIO clocks enabled at boot as critical. These divide off of PLLD_PER and are used for the ethernet and wifi @@ -1736,10 +1736,10 @@ index 336f8c9c44325d0a94e591a8557f7af246adc857..caa05e5ad0b7b5cd683e04fb3591a3df * Pass the CLK_SET_RATE_PARENT flag if we are allowed to propagate * rate changes on at least of the parents. -From 36e3b4914e3d2657373d715c53c51f7bc4a788bd Mon Sep 17 00:00:00 2001 +From ead53d0751edd7eba7235b2fbce6acff30733f49 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 9 Feb 2017 14:36:44 +0000 -Subject: [PATCH 030/139] sound: Demote deferral errors to INFO level +Subject: [PATCH 030/171] 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. @@ -1774,10 +1774,10 @@ index fee4b0ef5566cf9e8de0bf5c568706da9cab2ea2..c728a4148903e983d61b6ae65765ba11 goto _err_defer; } -From 72438d9062bf39515667c5118870918dc462c5cd Mon Sep 17 00:00:00 2001 +From b2ba41242a4807791092757ec9b6bdb57ac8b450 Mon Sep 17 00:00:00 2001 From: Claggy3 Date: Sat, 11 Feb 2017 14:00:30 +0000 -Subject: [PATCH 031/139] Update vfpmodule.c +Subject: [PATCH 031/171] 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 @@ -1914,10 +1914,10 @@ index a71a48e71fffa8626fe90106815376c44bbe679b..d6c0a5a0a5ae3510db3ace5e3f5d3410 /* * Save the userland NEON/VFP state. Under UP, -From bff55366201129cb031f195f9932f5bc0532e4b9 Mon Sep 17 00:00:00 2001 +From 4a7d6413847d7f589f9a22a8d0d5ef34e752c6e1 Mon Sep 17 00:00:00 2001 From: Matt Flax Date: Wed, 8 Mar 2017 21:13:24 +1100 -Subject: [PATCH 032/139] ASoC: bcm2835_i2s.c: relax the ch2 register setting +Subject: [PATCH 032/171] 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. @@ -1938,10 +1938,10 @@ index 6ba20498202ed36906b52096893a88867a79269f..56df7d8a43d0aac055a91b0d24aca8e1 format |= BCM2835_I2S_CH1(BCM2835_I2S_CHPOS(ch1pos)); format |= BCM2835_I2S_CH2(BCM2835_I2S_CHPOS(ch2pos)); -From 7568e8242b976ed5edb7d5ca06867b7da6f2004d Mon Sep 17 00:00:00 2001 +From c25dbbdb9a5890de12bbe59f24dd1ae3a265b782 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 033/139] i2c: bcm2835: Add debug support +Subject: [PATCH 033/171] i2c: bcm2835: Add debug support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -2130,10 +2130,10 @@ index cd07a69e2e9355540442785f95e90823b05c9d10..47167f403cc8329bd811b47c7011c299 if (i2c_dev->msg_err & BCM2835_I2C_S_ERR) return -EREMOTEIO; -From 510dfefc1e34ae1c7fefe09889f4851fe3e8b416 Mon Sep 17 00:00:00 2001 +From ba7e13058fb50e30408b00b4c1670c584eb8e228 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 18 Dec 2014 16:07:15 -0800 -Subject: [PATCH 034/139] mm: Remove the PFN busy warning +Subject: [PATCH 034/171] mm: Remove the PFN busy warning See commit dae803e165a11bc88ca8dbc07a11077caf97bbcb -- the warning is expected sometimes when using CMA. However, that commit still spams @@ -2158,10 +2158,10 @@ index 77e4d3c5c57b72dcd7e411a03707c26dc85c7c04..3f2f09b590dbfaf592749e8f901893c2 goto done; } -From ae4ce15cb0cd59821f07941b73b746cf5be7a89a Mon Sep 17 00:00:00 2001 +From 14270a2ad5c3c12c2010a053f62bf960b718891c Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 23 Mar 2017 10:06:56 +0000 -Subject: [PATCH 035/139] ASoC: Add prompt for ICS43432 codec +Subject: [PATCH 035/171] 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 @@ -2186,10 +2186,10 @@ index c367d11079bc90feec2ad0fa748d7ffc3035faba..91d5b531b69b49db97f7febbc60d33a2 config SND_SOC_INNO_RK3036 tristate "Inno codec driver for RK3036 SoC" -From b6fd9b6973aba3028e994fa09f8b61c4465e64ac Mon Sep 17 00:00:00 2001 +From 7b8b5a5d55032dceb567524cfcecfba3f0693f0c Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 12 May 2013 12:24:19 +0100 -Subject: [PATCH 036/139] Main bcm2708/bcm2709 linux port +Subject: [PATCH 036/171] Main bcm2708/bcm2709 linux port MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -2377,10 +2377,10 @@ index cfb4b4496dd9f61362dea012176c146120fada07..d9c6c217c4d6a2408abe2665bf7f2700 MODULE_AUTHOR("Lubomir Rintel "); MODULE_DESCRIPTION("BCM2835 mailbox IPC driver"); -From aff611b081ee35b491926d0e3f03fdc7df62820e Mon Sep 17 00:00:00 2001 +From b1ec4367c822051a778b5defc0dec2bd1f938926 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 19:46:17 +0100 -Subject: [PATCH 037/139] Add dwc_otg driver +Subject: [PATCH 037/171] Add dwc_otg driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -63653,10 +63653,10 @@ index 0000000000000000000000000000000000000000..cdc9963176e5a4a0d5250613b61e26c5 +test_main(); +0; -From 6e3637dd9f7c3453da675ff6d80067603afcc442 Mon Sep 17 00:00:00 2001 +From 08092c3316e4edcf3cbcf791f75de3f14ef2a41a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 17:06:34 +0100 -Subject: [PATCH 038/139] bcm2708 framebuffer driver +Subject: [PATCH 038/171] bcm2708 framebuffer driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -67115,10 +67115,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 ea66272cf0111f3f822fb05f73db83417cdc6ff1 Mon Sep 17 00:00:00 2001 +From cde94e247f6d8aac78c1161c2eac2f4c3435d497 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:22:53 +0100 -Subject: [PATCH 039/139] dmaengine: Add support for BCM2708 +Subject: [PATCH 039/171] dmaengine: Add support for BCM2708 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -67749,10 +67749,10 @@ index 0000000000000000000000000000000000000000..c5bfff2765be4606077e6c8af73040ec + +#endif /* _PLAT_BCM2708_DMA_H */ -From 6f981ed615b7b5b131b56163f7dced05532d6755 Mon Sep 17 00:00:00 2001 +From e6065bc98a8977c6fa8a53e6fb71eca8f0c25c56 Mon Sep 17 00:00:00 2001 From: gellert Date: Fri, 15 Aug 2014 16:35:06 +0100 -Subject: [PATCH 040/139] MMC: added alternative MMC driver +Subject: [PATCH 040/171] MMC: added alternative MMC driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -69632,10 +69632,10 @@ index 279b39008a33bb68745d9ea55ea5dd7ed522fd1c..49bdea5791a289251019a89419804dde unsigned int erase_size; /* erase size in sectors */ -From 6b89a5b54960deb2e41ee88c527f7e8a0e53cc2c Mon Sep 17 00:00:00 2001 +From a9595899b1a94e458fbc6f4492298bcb2db6de8f Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 25 Mar 2015 17:49:47 +0000 -Subject: [PATCH 041/139] Adding bcm2835-sdhost driver, and an overlay to +Subject: [PATCH 041/171] Adding bcm2835-sdhost driver, and an overlay to enable it BCM2835 has two SD card interfaces. This driver uses the other one. @@ -72041,10 +72041,10 @@ index 0000000000000000000000000000000000000000..9c6f199a7830959f31012d86bc1f8b1a +MODULE_LICENSE("GPL v2"); +MODULE_AUTHOR("Phil Elwell"); -From 7fd150f632e4d2f3353eb9fd17fc35e9fe9df275 Mon Sep 17 00:00:00 2001 +From 2d6fbaeeaaa708fb4de0214441758c738678b58d Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 28 Oct 2016 15:36:43 +0100 -Subject: [PATCH 042/139] vc_mem: Add vc_mem driver for querying firmware +Subject: [PATCH 042/171] vc_mem: Add vc_mem driver for querying firmware memory addresses MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -72569,10 +72569,10 @@ index 0000000000000000000000000000000000000000..20a475377eb3078ea1ecaef2b24efc35 + +#endif /* _VC_MEM_H */ -From 8098d04465c6171a90dfa173ad550b96562146c7 Mon Sep 17 00:00:00 2001 +From 7ca0d203e6f998cfc8f7b20ff758b08b106769a8 Mon Sep 17 00:00:00 2001 From: Tim Gover Date: Tue, 22 Jul 2014 15:41:04 +0100 -Subject: [PATCH 043/139] vcsm: VideoCore shared memory service for BCM2835 +Subject: [PATCH 043/171] vcsm: VideoCore shared memory service for BCM2835 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -77449,10 +77449,10 @@ index 0000000000000000000000000000000000000000..b75729d762f25aace133f7a008633b40 + +#endif /* __VMCS_SM_IOCTL_H__INCLUDED__ */ -From 26ba5248426b1f9dbf6ca36114e51af3fb2d9b5d Mon Sep 17 00:00:00 2001 +From 16ac00ea2fc08eba7e2f85dffdf501a34f882416 Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Fri, 21 Aug 2015 23:14:48 +0100 -Subject: [PATCH 044/139] Add /dev/gpiomem device for rootless user GPIO access +Subject: [PATCH 044/171] Add /dev/gpiomem device for rootless user GPIO access Signed-off-by: Luke Wren @@ -77760,10 +77760,10 @@ index 0000000000000000000000000000000000000000..f5e7f1ba8fb6f18dee77fad06a17480c +MODULE_DESCRIPTION("gpiomem driver for accessing GPIO from userspace"); +MODULE_AUTHOR("Luke Wren "); -From 9f80a7da9daac12cb0ad19ec07b508faca68be11 Mon Sep 17 00:00:00 2001 +From e16a09590bcc6b008fd7787d5598605ee55cc040 Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Sat, 5 Sep 2015 01:14:45 +0100 -Subject: [PATCH 045/139] Add SMI driver +Subject: [PATCH 045/171] Add SMI driver Signed-off-by: Luke Wren --- @@ -79714,10 +79714,10 @@ index 0000000000000000000000000000000000000000..ee3a75edfc033eeb0d90a687ffb68b10 + +#endif /* BCM2835_SMI_H */ -From e8cf054cad9464a69a77501e296b9e5482692bfc Mon Sep 17 00:00:00 2001 +From 4ee68705e30396f13bb8d3bf2b7ce8a6f90b5378 Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Tue, 26 Apr 2016 14:59:21 +0000 -Subject: [PATCH 046/139] MISC: bcm2835: smi: use clock manager and fix reload +Subject: [PATCH 046/171] MISC: bcm2835: smi: use clock manager and fix reload issues Use clock manager instead of self-made clockmanager. @@ -79886,10 +79886,10 @@ index 63a4ea08b9930a3a31a985f0a1d969b488ed49ec..1261540703127d1d63b9f3c87042c6e5 return 0; } -From 02a53be2da9e8ac406753830a8b07a81ed35cc57 Mon Sep 17 00:00:00 2001 +From 290bd72c5e6741da6e34138f94548624c44dd3fd Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Sat, 5 Sep 2015 01:16:10 +0100 -Subject: [PATCH 047/139] Add SMI NAND driver +Subject: [PATCH 047/171] Add SMI NAND driver Signed-off-by: Luke Wren --- @@ -80254,10 +80254,10 @@ index 0000000000000000000000000000000000000000..c4826ea1c2bae555ce780e61f1076ddd + ("Driver for NAND chips using Broadcom Secondary Memory Interface"); +MODULE_AUTHOR("Luke Wren "); -From 75412f99e572ad64a7d68d2843fd80aae3c5cd48 Mon Sep 17 00:00:00 2001 +From 52e7dfc4f7d44b656d8f349427194c8e4b137b00 Mon Sep 17 00:00:00 2001 From: Aron Szabo Date: Sat, 16 Jun 2012 12:15:55 +0200 -Subject: [PATCH 048/139] lirc: added support for RaspberryPi GPIO +Subject: [PATCH 048/171] 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 @@ -81117,10 +81117,10 @@ index 0000000000000000000000000000000000000000..fb69624ccef00ddbdccf8256d6baf1b1 + +#endif -From 5d32eaf96920a1bb3f839dcd12e34a3be808d73f Mon Sep 17 00:00:00 2001 +From d0893cdc372cbfd0bd53c4558fd7d309fc6f25cc Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:49:20 +0100 -Subject: [PATCH 049/139] Add cpufreq driver +Subject: [PATCH 049/171] Add cpufreq driver Signed-off-by: popcornmix @@ -81384,10 +81384,10 @@ index 0000000000000000000000000000000000000000..99345969b0e4d651fd9033d67de2febb +module_init(bcm2835_cpufreq_module_init); +module_exit(bcm2835_cpufreq_module_exit); -From eacd5a1f9e30d888699b70391b01b95d74afbba1 Mon Sep 17 00:00:00 2001 +From 9cabdc81eb1c02c4dd81de1b5d71fbca7883ef7e Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 15:44:08 +0100 -Subject: [PATCH 050/139] Add Chris Boot's i2c driver +Subject: [PATCH 050/171] Add Chris Boot's i2c driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -82052,10 +82052,10 @@ index 0000000000000000000000000000000000000000..962f2e5c7455d91bf32925d785f5f16b +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRV_NAME); -From 9aef997de325b1be7f3e5efe36f2eec6e1527a4f Mon Sep 17 00:00:00 2001 +From 68d42b698e2b758665bd6048632425e55417bd67 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 051/139] char: broadcom: Add vcio module +Subject: [PATCH 051/171] char: broadcom: Add vcio module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -82280,10 +82280,10 @@ index 0000000000000000000000000000000000000000..c19bc2075c77879563ef5e59038b5a14 +MODULE_DESCRIPTION("Mailbox userspace access"); +MODULE_LICENSE("GPL"); -From b5f53770adf4418a39b0b87410b4661a5488a4f7 Mon Sep 17 00:00:00 2001 +From cac50d3799ccdb7efbb9cc24442144fac0566abb 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 052/139] firmware: bcm2835: Support ARCH_BCM270x +Subject: [PATCH 052/171] firmware: bcm2835: Support ARCH_BCM270x MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -82366,10 +82366,10 @@ index dd506cd3a5b874f9e1acd07efb8cd151bb6145d1..3f070bd38a91511c986e3fb114b15bd4 MODULE_AUTHOR("Eric Anholt "); MODULE_DESCRIPTION("Raspberry Pi firmware driver"); -From 544c03b373c82975faa1f5ed16cc5ad87fe75f25 Mon Sep 17 00:00:00 2001 +From cc5c2469911c7361d20d62d75c421d86cad89548 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 11 May 2015 09:00:42 +0100 -Subject: [PATCH 053/139] scripts: Add mkknlimg and knlinfo scripts from tools +Subject: [PATCH 053/171] scripts: Add mkknlimg and knlinfo scripts from tools repo The Raspberry Pi firmware looks for a trailer on the kernel image to @@ -82896,10 +82896,10 @@ index 0000000000000000000000000000000000000000..84be2593ec1de8f97b0167ff06b3e05d + return $trailer; +} -From 7070ee4707d19d947a043b2febd98c337bfa70c4 Mon Sep 17 00:00:00 2001 +From 4e19e2811c92c95dc41e4d21932234b1f545ca69 Mon Sep 17 00:00:00 2001 From: notro Date: Wed, 9 Jul 2014 14:46:08 +0200 -Subject: [PATCH 054/139] BCM2708: Add core Device Tree support +Subject: [PATCH 054/171] BCM2708: Add core Device Tree support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -95137,10 +95137,10 @@ index 04b5633df1cfafa316f9086c4bf98a9ecf9d0939..d523d1e14220a369c4c766ca3a01208e # Bzip2 -From dbaf82cd6d4640fba9bfcb969eecc621b2d6e24c Mon Sep 17 00:00:00 2001 +From 72abb99925dbbf647b17f3b6739a32bfdc5ccb12 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 6 Feb 2015 13:50:57 +0000 -Subject: [PATCH 055/139] BCM270x_DT: Add pwr_led, and the required "input" +Subject: [PATCH 055/171] BCM270x_DT: Add pwr_led, and the required "input" trigger The "input" trigger makes the associated GPIO an input. This is to support @@ -95315,10 +95315,10 @@ index bf6db4fe895bcd67e04ee65e8f76ea104af6299f..8741dca6dba65e2d72fbdbc1702139c2 /* set_brightness_work / blink_timer flags, atomic, private. */ unsigned long work_flags; -From eb2ffa2fae8e3d9e3061d3fff0d58a42b5512585 Mon Sep 17 00:00:00 2001 +From 58a4848351e6564d18ca8b806da6b9d08640490a Mon Sep 17 00:00:00 2001 From: Siarhei Siamashka Date: Mon, 17 Jun 2013 13:32:11 +0300 -Subject: [PATCH 056/139] fbdev: add FBIOCOPYAREA ioctl +Subject: [PATCH 056/171] fbdev: add FBIOCOPYAREA ioctl Based on the patch authored by Ali Gholami Rudi at https://lkml.org/lkml/2009/7/13/153 @@ -95586,10 +95586,10 @@ index 6cd9b198b7c64eb94821f2e3f2c5201e6c6d25eb..f36c92c2da7487437c33f7a4e2c6e09e __u32 dx; /* screen-relative */ __u32 dy; -From 57ec73d9bef98ae27411ffffe3d7ba3c34e02bbf Mon Sep 17 00:00:00 2001 +From ba309de12dfbb66bb504fa7dc07f54eaf1eb578e Mon Sep 17 00:00:00 2001 From: Harm Hanemaaijer Date: Thu, 20 Jun 2013 20:21:39 +0200 -Subject: [PATCH 057/139] Speed up console framebuffer imageblit function +Subject: [PATCH 057/171] 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 @@ -95798,10 +95798,10 @@ index a2bb276a8b2463eee98eb237c4647bc00cd93601..436494fba15abecb400ef28688466faf start_index, pitch_index); } else -From f26199707fc9bf88f391323528c9e4ad62c5ddc5 Mon Sep 17 00:00:00 2001 +From 3a0c0e0da8c90d879f57059f70d110f679c39bf9 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 8 May 2013 11:46:50 +0100 -Subject: [PATCH 058/139] enabling the realtime clock 1-wire chip DS1307 and +Subject: [PATCH 058/171] 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 @@ -96051,10 +96051,10 @@ index 5b2972946dda5f9ad415f1eaeaab67743a5cc0f0..b3558b7c9efb2484b40e31312aee197b u8, w1_slave_found_callback); }; -From d78821aeda0e275611f66f93663fb5e1dcb7ba6f Mon Sep 17 00:00:00 2001 +From 8735d851ec665574a4310b9c7768da6fbd8f685b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 14 Jul 2014 22:02:09 +0100 -Subject: [PATCH 059/139] hid: Reduce default mouse polling interval to 60Hz +Subject: [PATCH 059/171] hid: Reduce default mouse polling interval to 60Hz Reduces overhead when using X --- @@ -96086,10 +96086,10 @@ index 045b5da9b992873ce74f5d401de34855b93a6f8e..45abcbab4efe561a3829e9a6b6014abe break; case HID_GD_JOYSTICK: -From 83a5a422577be4b19bfb1baca21e27d63e4895c4 Mon Sep 17 00:00:00 2001 +From 9733b2260884366ac4e714d90ca9e6808d17bf63 Mon Sep 17 00:00:00 2001 From: Gordon Hollingworth Date: Tue, 12 May 2015 14:47:56 +0100 -Subject: [PATCH 060/139] rpi-ft5406: Add touchscreen driver for pi LCD display +Subject: [PATCH 060/171] 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 @@ -96447,10 +96447,10 @@ index 30fb37fe175df604a738258a2a632bca3bfff33f..4a3d79d3b48eb483a4e4bf498f617515 RPI_FIRMWARE_FRAMEBUFFER_SET_BACKLIGHT = 0x0004800f, -From 3537f434772cdf0d843e834c0ceb0cd58e6fa888 Mon Sep 17 00:00:00 2001 +From ebbaa67928cc7e59e07b99ae4afbae49af6244a6 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 28 Nov 2016 16:50:04 +0000 -Subject: [PATCH 061/139] Improve __copy_to_user and __copy_from_user +Subject: [PATCH 061/171] Improve __copy_to_user and __copy_from_user performance Provide a __copy_from_user that uses memcpy. On BCM2708, use @@ -98030,10 +98030,10 @@ index 971bc298f63eeeed418131b7b7200ac91b0d73f1..78e9f6e8c6fdebdb754cb703095d1726 bool "Broadcom BCM63xx DSL SoC" depends on ARCH_MULTI_V7 -From 2006ab8cc5b743fc83ca3e24363803638d63561a Mon Sep 17 00:00:00 2001 +From 1d0fa0a4e385a8906fefdbc41df393603df8aad6 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 25 Jun 2015 12:16:11 +0100 -Subject: [PATCH 062/139] gpio-poweroff: Allow it to work on Raspberry Pi +Subject: [PATCH 062/171] 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 @@ -98068,10 +98068,10 @@ index be3d81ff51cc3f510d85e4eed7a52960e51e7bc1..a030ae9fb1fca325061c093696e82186 "%s: pm_power_off function already registered", __func__); -From 4bef86e88f84c826d95f91a6858e432b5395e006 Mon Sep 17 00:00:00 2001 +From 9b2f52aecce84e15518d8084db5ff399895086cd Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Jul 2015 14:32:47 +0100 -Subject: [PATCH 063/139] mfd: Add Raspberry Pi Sense HAT core driver +Subject: [PATCH 063/171] mfd: Add Raspberry Pi Sense HAT core driver --- drivers/input/joystick/Kconfig | 8 + @@ -98936,10 +98936,10 @@ index 0000000000000000000000000000000000000000..56196dc2af10e464a1e3f98b028dca1c + +#endif -From 418d79c4fb85f25393537c1682e1b9fd4ff1ba6e Mon Sep 17 00:00:00 2001 +From d6f2735add635db5ee318ac2c82d06b7e1c2d090 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 19:19:08 +0100 -Subject: [PATCH 064/139] ASoC: Add support for HifiBerry DAC +Subject: [PATCH 064/171] ASoC: Add support for HifiBerry DAC This adds a machine driver for the HifiBerry DAC. It is a sound card that can @@ -99114,10 +99114,10 @@ index 0000000000000000000000000000000000000000..ee9f133953544629282631e5ef3f73fe +MODULE_DESCRIPTION("ASoC Driver for HifiBerry DAC"); +MODULE_LICENSE("GPL v2"); -From f1c5786c8bc1659c5f7e965a4574978cc94e8f88 Mon Sep 17 00:00:00 2001 +From c53109d6ee4ab56d002edc60bfa885cda89400fe Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Mon, 25 Jan 2016 15:48:59 +0000 -Subject: [PATCH 065/139] ASoC: Add support for Rpi-DAC +Subject: [PATCH 065/171] ASoC: Add support for Rpi-DAC --- sound/soc/bcm/Kconfig | 7 +++ @@ -99401,10 +99401,10 @@ index 0000000000000000000000000000000000000000..afe1b419582aa40c4b2729d242bb13cd +MODULE_AUTHOR("Florian Meier "); +MODULE_LICENSE("GPL v2"); -From 1912661ef4642214ddf6be8843aec5ec1524f40c Mon Sep 17 00:00:00 2001 +From 73c8f1fd66348138023993f7d16822749811bd96 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Wed, 15 Jan 2014 21:41:23 +0100 -Subject: [PATCH 066/139] ASoC: wm8804: Implement MCLK configuration options, +Subject: [PATCH 066/171] 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 @@ -99453,10 +99453,10 @@ index fc69b87443d80489382b97332de6d5ad12a58ec8..d8fdce81b297dcf02e144bdead0c6193 .component_driver = { .dapm_widgets = wm8804_dapm_widgets, -From 0fc607e938a063c915b0651bd0711a49bd19b53e Mon Sep 17 00:00:00 2001 +From eb1e0bb6f3892721bd568cd914d26cfc9ac818db Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Wed, 15 Jan 2014 21:42:08 +0100 -Subject: [PATCH 067/139] ASoC: BCM:Add support for HiFiBerry Digi. Driver is +Subject: [PATCH 067/171] ASoC: BCM:Add support for HiFiBerry Digi. Driver is based on the patched WM8804 driver. Signed-off-by: Daniel Matuschek @@ -99800,10 +99800,10 @@ index 0000000000000000000000000000000000000000..7620dd02de40b6d644ff038b445d375d +MODULE_DESCRIPTION("ASoC Driver for HifiBerry Digi"); +MODULE_LICENSE("GPL v2"); -From eb34569a063d8d430c63da84a68a84becca03dd8 Mon Sep 17 00:00:00 2001 +From 55b3efde8898070807eba85c2e7a6bf8483f7768 Mon Sep 17 00:00:00 2001 From: Gordon Garrity Date: Sat, 8 Mar 2014 16:56:57 +0000 -Subject: [PATCH 068/139] Add IQaudIO Sound Card support for Raspberry Pi +Subject: [PATCH 068/171] Add IQaudIO Sound Card support for Raspberry Pi Set a limit of 0dB on Digital Volume Control @@ -100138,10 +100138,10 @@ index 0000000000000000000000000000000000000000..1ee4097c846376666775272ed692ca33 +MODULE_DESCRIPTION("ASoC Driver for IQAudio DAC"); +MODULE_LICENSE("GPL v2"); -From 21e9727536c6eb7a5d39cbb210d042858c20da2a Mon Sep 17 00:00:00 2001 +From d52e7b67d2f2af41398559dac1e19457e4eef6a3 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Mon, 4 Aug 2014 10:06:56 +0200 -Subject: [PATCH 069/139] Added support for HiFiBerry DAC+ +Subject: [PATCH 069/171] 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. @@ -100771,10 +100771,10 @@ index 68feae262476492ae3a0b30855dbb09e96fa187e..f7b0977017ed5a6c02eafa0147d49d66 dev_err(dev, "No LRCLK?\n"); return -EINVAL; -From c09f8b72b7c8001d45839f0965fc86128fa46ead Mon Sep 17 00:00:00 2001 +From eab84c59cbd77816d64f20a947c71ebb95eb5d10 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Mon, 4 Aug 2014 11:09:58 +0200 -Subject: [PATCH 070/139] Added driver for HiFiBerry Amp amplifier add-on board +Subject: [PATCH 070/171] 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. @@ -101609,10 +101609,10 @@ index 0000000000000000000000000000000000000000..8f019e04898754d2f87e9630137be9e8 + +#endif /* _TAS5713_H */ -From db5eeeb3d722207967a0d06934e2cd91693e5a2d Mon Sep 17 00:00:00 2001 +From e2e0503e722439969e0d3aae1259b447447b583b Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 25 Mar 2015 09:26:17 +0100 -Subject: [PATCH 071/139] Add driver for rpi-proto +Subject: [PATCH 071/171] 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 @@ -101827,10 +101827,10 @@ index 0000000000000000000000000000000000000000..fadbfade100228aaafabb0d3bdf35c01 +MODULE_DESCRIPTION("ASoC Driver for Raspberry Pi connected to PROTO board (WM8731)"); +MODULE_LICENSE("GPL"); -From ea44e8cbfd0a45143da794cb02d5d1b6d86f5715 Mon Sep 17 00:00:00 2001 +From 165212c29290282db099b688e4db62f809ad329c Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Mon, 24 Aug 2015 16:03:47 +0100 -Subject: [PATCH 072/139] RaspiDAC3 support +Subject: [PATCH 072/171] RaspiDAC3 support Signed-off-by: Jan Grulich @@ -102073,10 +102073,10 @@ index 0000000000000000000000000000000000000000..ad2b5b89bc8213dc2e277306ef50d6e3 +MODULE_DESCRIPTION("ASoC Driver for RaspiDAC Rev.3x"); +MODULE_LICENSE("GPL v2"); -From 8c3910e280b205856ff4c64c59122881d59c2d77 Mon Sep 17 00:00:00 2001 +From 0ae0f723b705645c4a354f0d8ce5da4c4e5137a5 Mon Sep 17 00:00:00 2001 From: Aaron Shaw Date: Thu, 7 Apr 2016 21:26:21 +0100 -Subject: [PATCH 073/139] Add Support for JustBoom Audio boards +Subject: [PATCH 073/171] Add Support for JustBoom Audio boards justboom-dac: Adjust for ALSA API change @@ -102532,10 +102532,10 @@ index 0000000000000000000000000000000000000000..909cf8928f2f4313982316f9c5b8a709 +MODULE_DESCRIPTION("ASoC Driver for JustBoom PI Digi HAT Sound Card"); +MODULE_LICENSE("GPL v2"); -From c9042852d4073c897c5219c58037eaefb1de2d96 Mon Sep 17 00:00:00 2001 +From 56cfbdbcb917a516682d1a550052f39115598ef0 Mon Sep 17 00:00:00 2001 From: Andrey Grodzovsky Date: Tue, 3 May 2016 22:10:59 -0400 -Subject: [PATCH 074/139] ARM: adau1977-adc: Add basic machine driver for +Subject: [PATCH 074/171] ARM: adau1977-adc: Add basic machine driver for adau1977 codec driver. This commit adds basic support for the codec usage including: Device tree overlay, @@ -102717,10 +102717,10 @@ index 0000000000000000000000000000000000000000..f3d7e5db7bb912e1d7ca6f8e8d42df5f +MODULE_DESCRIPTION("ASoC Driver for ADAU1977 ADC"); +MODULE_LICENSE("GPL v2"); -From 7f581b1c4c5b845755ef46aade72f55d59587922 Mon Sep 17 00:00:00 2001 +From 59f601ebcba6d9dd570da3f9ee8692c7dc5fbc4e Mon Sep 17 00:00:00 2001 From: Matt Flax Date: Mon, 16 May 2016 21:36:31 +1000 -Subject: [PATCH 075/139] New AudioInjector.net Pi soundcard with low jitter +Subject: [PATCH 075/171] 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. @@ -102971,10 +102971,10 @@ index 0000000000000000000000000000000000000000..491906bbf446826e55dd843f28e4860f +MODULE_ALIAS("platform:audioinjector-pi-soundcard"); + -From 3733e2210732053fc112e35b4b0985062455cc7d Mon Sep 17 00:00:00 2001 +From 5f3934edcd4d39ccc438283d46d3a160e3cc9056 Mon Sep 17 00:00:00 2001 From: DigitalDreamtime Date: Thu, 30 Jun 2016 18:38:42 +0100 -Subject: [PATCH 076/139] Add IQAudIO Digi WM8804 board support +Subject: [PATCH 076/171] Add IQAudIO Digi WM8804 board support Support IQAudIO Digi board with iqaudio_digi machine driver and iqaudio-digi-wm8804-audio overlay. @@ -103274,10 +103274,10 @@ index 0000000000000000000000000000000000000000..33aa2be8a43a12a12cfb5d844dd9732c +MODULE_DESCRIPTION("ASoC Driver for IQAudIO WM8804 Digi"); +MODULE_LICENSE("GPL v2"); -From cd021f1dc06ed6e993173bcba978052ee51c3033 Mon Sep 17 00:00:00 2001 +From e83869ba576093e3e4350977827416a24c419af2 Mon Sep 17 00:00:00 2001 From: escalator2015 Date: Tue, 24 May 2016 16:20:09 +0100 -Subject: [PATCH 077/139] New driver for RRA DigiDAC1 soundcard using WM8741 + +Subject: [PATCH 077/171] New driver for RRA DigiDAC1 soundcard using WM8741 + WM8804 --- @@ -103750,10 +103750,10 @@ index 0000000000000000000000000000000000000000..f200688bb4ae32b90a0ced555aed94b0 +MODULE_DESCRIPTION("ASoC Driver for RRA DigiDAC1"); +MODULE_LICENSE("GPL v2"); -From efec931eef6b6f442c3107caca96e8c985b6a669 Mon Sep 17 00:00:00 2001 +From 4ee943006115849706f5f6a1b4b66173f72aaf22 Mon Sep 17 00:00:00 2001 From: DigitalDreamtime Date: Sat, 2 Jul 2016 16:26:19 +0100 -Subject: [PATCH 078/139] Add support for Dion Audio LOCO DAC-AMP HAT +Subject: [PATCH 078/171] Add support for Dion Audio LOCO DAC-AMP HAT Using dedicated machine driver and pcm5102a codec driver. @@ -103926,10 +103926,10 @@ index 0000000000000000000000000000000000000000..65e03741d349a2dc5bd91f69855ea952 +MODULE_DESCRIPTION("ASoC Driver for DionAudio LOCO"); +MODULE_LICENSE("GPL v2"); -From b77b2060d6de30c489c69a5a05e81032d9bc4fd6 Mon Sep 17 00:00:00 2001 +From 089ce8838663db4a7b708bc3643f929528dc1653 Mon Sep 17 00:00:00 2001 From: Clive Messer Date: Mon, 19 Sep 2016 14:01:04 +0100 -Subject: [PATCH 079/139] Allo Piano DAC boards: Initial 2 channel (stereo) +Subject: [PATCH 079/171] 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, @@ -104136,10 +104136,10 @@ index 0000000000000000000000000000000000000000..eaf50fb6dbca1970ae1c6f8662088b0f +MODULE_DESCRIPTION("ALSA ASoC Machine Driver for Allo Piano DAC"); +MODULE_LICENSE("GPL v2"); -From 1d53781b679cc8c1f55da0ebaf3ec21ac10eae17 Mon Sep 17 00:00:00 2001 +From 26435fa6f7c927dd828f918b484d62c26cd8e71f Mon Sep 17 00:00:00 2001 From: Raashid Muhammed Date: Mon, 27 Mar 2017 12:35:00 +0530 -Subject: [PATCH 080/139] Add support for Allo Piano DAC 2.1 plus add-on board +Subject: [PATCH 080/171] 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. @@ -105008,10 +105008,10 @@ index 0000000000000000000000000000000000000000..d4e99e3c6a383d92fb0cf9e8c1cd1e76 +MODULE_DESCRIPTION("ALSA ASoC Machine Driver for Allo Piano DAC Plus"); +MODULE_LICENSE("GPL v2"); -From 8a552200bc9ef0af355ccf3c08f6f7efbfa4f1ab Mon Sep 17 00:00:00 2001 +From 3360f265f514f3f167e59d9d83b1cabf08b2b044 Mon Sep 17 00:00:00 2001 From: BabuSubashChandar Date: Tue, 28 Mar 2017 20:04:42 +0530 -Subject: [PATCH 081/139] Add support for Allo Boss DAC add-on board for +Subject: [PATCH 081/171] Add support for Allo Boss DAC add-on board for Raspberry Pi. (#1924) Signed-off-by: Baswaraj K @@ -105714,10 +105714,10 @@ index 0000000000000000000000000000000000000000..203ab76c7045b081578e23bda1099dd1 +MODULE_DESCRIPTION("ALSA ASoC Machine Driver for Allo Boss DAC"); +MODULE_LICENSE("GPL v2"); -From 4cebaa3a383e9ac5be3baadab14b7108809cca84 Mon Sep 17 00:00:00 2001 +From 125b70279dde4ab69f50d5ed504678b415cce009 Mon Sep 17 00:00:00 2001 From: gtrainavicius Date: Sun, 23 Oct 2016 12:06:53 +0300 -Subject: [PATCH 082/139] Support for Blokas Labs pisound board +Subject: [PATCH 082/171] Support for Blokas Labs pisound board Pisound dynamic overlay (#1760) @@ -106916,10 +106916,10 @@ index 0000000000000000000000000000000000000000..06ff1e53dc9d860946965b6303577762 +MODULE_DESCRIPTION("ASoC Driver for pisound, http://blokas.io/pisound"); +MODULE_LICENSE("GPL v2"); -From dcf4aa02b046e8ceb0226a34611cc3566222266d Mon Sep 17 00:00:00 2001 +From aaef824db5abcf8a0152de293cf0db628b51e720 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 22 Jan 2017 12:49:37 +0100 -Subject: [PATCH 083/139] ASoC: Add driver for Cirrus Logic Audio Card +Subject: [PATCH 083/171] 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 @@ -107984,10 +107984,10 @@ index 0000000000000000000000000000000000000000..ac8651ddff7bd3701dffe22c7fb88352 +MODULE_DESCRIPTION("ASoC driver for Cirrus Logic Audio Card"); +MODULE_LICENSE("GPL"); -From 993df028d013ab24e5874f2e09863036f7cc8e9f Mon Sep 17 00:00:00 2001 +From 77922a0852070271032adac3175e85c73fedfa4e Mon Sep 17 00:00:00 2001 From: Miquel Date: Fri, 24 Feb 2017 20:51:06 +0100 -Subject: [PATCH 084/139] sound: Support for Dion Audio LOCO-V2 DAC-AMP HAT +Subject: [PATCH 084/171] sound: Support for Dion Audio LOCO-V2 DAC-AMP HAT Signed-off-by: Miquel Blauw --- @@ -108182,10 +108182,10 @@ index 0000000000000000000000000000000000000000..a009c49477972a9832175d86f201b035 +MODULE_DESCRIPTION("ASoC Driver for DionAudio LOCO-V2"); +MODULE_LICENSE("GPL v2"); -From 4953597842d981e3bdc544bbaab855a73aaa9993 Mon Sep 17 00:00:00 2001 +From 3b85e40c9ac200a948f4a3b07dcfb451b79d0c3a Mon Sep 17 00:00:00 2001 From: Fe-Pi Date: Wed, 1 Mar 2017 04:42:43 -0700 -Subject: [PATCH 085/139] Add support for Fe-Pi audio sound card. (#1867) +Subject: [PATCH 085/171] 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. @@ -108399,10 +108399,10 @@ index 0000000000000000000000000000000000000000..015b56fd73cc36be5b5eecd17548fd03 +MODULE_DESCRIPTION("ASoC Driver for Fe-Pi Audio"); +MODULE_LICENSE("GPL v2"); -From 07d5714c1cf7a2757a92784dcbb5c68958b8b367 Mon Sep 17 00:00:00 2001 +From 4d0fef842d0122f852ba3bfac3781bde447669b1 Mon Sep 17 00:00:00 2001 From: Matt Flax Date: Wed, 8 Mar 2017 20:04:13 +1100 -Subject: [PATCH 086/139] Add support for the AudioInjector.net Octo sound card +Subject: [PATCH 086/171] Add support for the AudioInjector.net Octo sound card AudioInjector Octo: sample rates, regulators, reset @@ -108811,10 +108811,10 @@ index 0000000000000000000000000000000000000000..5e79f4eff93a21ed3495c77a90f73525 +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:audioinjector-octo-soundcard"); -From 30b4b0a6101e198680fc59e334e3257523ee678b Mon Sep 17 00:00:00 2001 +From 35ae9f768b96494c5291b980dc70f432ddc1cbca Mon Sep 17 00:00:00 2001 From: Peter Malkin Date: Mon, 27 Mar 2017 16:38:21 -0700 -Subject: [PATCH 087/139] Driver support for Google voiceHAT soundcard. +Subject: [PATCH 087/171] Driver support for Google voiceHAT soundcard. --- sound/soc/bcm/Kconfig | 7 ++ @@ -109205,10 +109205,10 @@ index 0000000000000000000000000000000000000000..225854b8e5298b3c3018f59a49404354 +MODULE_DESCRIPTION("ASoC Driver for Google voiceHAT SoundCard"); +MODULE_LICENSE("GPL v2"); -From 46fcde8be7acb096fe547b8e6c19614f0edfad8b Mon Sep 17 00:00:00 2001 +From 97d64fc21b4f123746fdc86bc696ea737834dfe7 Mon Sep 17 00:00:00 2001 From: sandeepal Date: Fri, 2 Jun 2017 18:59:46 +0530 -Subject: [PATCH 088/139] Allo Digione Driver (#2048) +Subject: [PATCH 088/171] Allo Digione Driver (#2048) Driver for the Allo Digione soundcard --- @@ -109530,10 +109530,10 @@ index 0000000000000000000000000000000000000000..e3664e44c699d0102120ecf99e8b780a +MODULE_DESCRIPTION("ASoC Driver for Allo DigiOne"); +MODULE_LICENSE("GPL v2"); -From b5934c4e6d113e68923aff4b4363fd96002af80e Mon Sep 17 00:00:00 2001 +From 0363444458cb033e5bd167c75deeaffb52d057f6 Mon Sep 17 00:00:00 2001 From: P33M Date: Wed, 21 Oct 2015 14:55:21 +0100 -Subject: [PATCH 089/139] rpi_display: add backlight driver and overlay +Subject: [PATCH 089/171] 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 @@ -109702,10 +109702,10 @@ index 0000000000000000000000000000000000000000..14a0d9b037395497c1fdae2961feccd5 +MODULE_DESCRIPTION("Raspberry Pi mailbox based Backlight Driver"); +MODULE_LICENSE("GPL"); -From 5e52a2f445b5f1098663e59049d7c4f02c6ee707 Mon Sep 17 00:00:00 2001 +From 3fd3bc35962d0a9f0ec8bbda5bafb218a2ef78e7 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 23 Feb 2016 19:56:04 +0000 -Subject: [PATCH 090/139] bcm2835-virtgpio: Virtual GPIO driver +Subject: [PATCH 090/171] bcm2835-virtgpio: Virtual GPIO driver Add a virtual GPIO driver that uses the firmware mailbox interface to request that the VPU toggles LEDs. @@ -109979,10 +109979,10 @@ index 4a3d79d3b48eb483a4e4bf498f617515e3ad158f..5f34e1257117fb48013c9926a8a223d6 RPI_FIRMWARE_FRAMEBUFFER_SET_BACKLIGHT = 0x0004800f, -From 2c9ecc9e76d1d6b60db9dcded01a5b1e5f950b6a Mon Sep 17 00:00:00 2001 +From 2a87bc0c5b885896e8c31f359868095a69c00a36 Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 20 Feb 2017 17:01:21 +0000 -Subject: [PATCH 091/139] bcm2835-gpio-exp: Driver for GPIO expander via +Subject: [PATCH 091/171] bcm2835-gpio-exp: Driver for GPIO expander via mailbox service Pi3 and Compute Module 3 have a GPIO expander that the @@ -110308,10 +110308,10 @@ index 5f34e1257117fb48013c9926a8a223d64a598ab7..c819c21b0158a59c1308882e5a40e3f3 /* Dispmanx TAGS */ RPI_FIRMWARE_FRAMEBUFFER_ALLOCATE = 0x00040001, -From 6ee595ea1c14f890f2d7dcc203e87cca269b1b05 Mon Sep 17 00:00:00 2001 +From a3359318a064d9e8d5a953f3aea4478448360a9a Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 23 Feb 2016 17:26:48 +0000 -Subject: [PATCH 092/139] amba_pl011: Don't use DT aliases for numbering +Subject: [PATCH 092/171] 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 @@ -110340,10 +110340,10 @@ index 111e6a95077978c2c30bfe2a2de4a0d095e8d76e..584471add0962c0e26eb814fc0ef43ee uap->old_cr = 0; uap->port.dev = dev; -From 21bd3b645a2a38fe4150e489f0c266a3d4f308e1 Mon Sep 17 00:00:00 2001 +From 943056e7c5eeba1e644adb6e96078f2e445f0925 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 1 Mar 2017 16:07:39 +0000 -Subject: [PATCH 093/139] amba_pl011: Round input clock up +Subject: [PATCH 093/171] 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 @@ -110429,10 +110429,10 @@ index 584471add0962c0e26eb814fc0ef43eea99b2d29..bfbc845d7be9ef804468d0a82da18d9b /* unregisters the driver also if no more ports are left */ static void pl011_unregister_port(struct uart_amba_port *uap) -From 21a243b198486d23d2192adf6d916f853499183b Mon Sep 17 00:00:00 2001 +From f0bfbdc845b9731164be210a6b9fbb1af2f0a37a Mon Sep 17 00:00:00 2001 From: Pantelis Antoniou Date: Wed, 3 Dec 2014 13:23:28 +0200 -Subject: [PATCH 094/139] OF: DT-Overlay configfs interface +Subject: [PATCH 094/171] 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. @@ -110865,10 +110865,10 @@ index 0000000000000000000000000000000000000000..0037e6868a6cda8706c88194c6a4454b +} +late_initcall(of_cfs_init); -From fd9f2860f0f32120e014e6314a29536dfe7b9727 Mon Sep 17 00:00:00 2001 +From 92c7083c4df13fc3ebde9ad0880481c5d1d86376 Mon Sep 17 00:00:00 2001 From: Cheong2K Date: Fri, 26 Feb 2016 18:20:10 +0800 -Subject: [PATCH 095/139] brcm: adds support for BCM43341 wifi +Subject: [PATCH 095/171] brcm: adds support for BCM43341 wifi brcmfmac: Disable power management @@ -111000,10 +111000,10 @@ index 613caca7dc020a78985b22521422700022c37473..971c68a261f2d041806655dd66636aee BRCMF_FW_NVRAM_ENTRY(BRCM_CC_43362_CHIP_ID, 0xFFFFFFFE, 43362), BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4339_CHIP_ID, 0xFFFFFFFF, 4339), -From 962b6d8ee6370e778e45f4fe00ba7a05bbf908c2 Mon Sep 17 00:00:00 2001 +From 29e6c6499e43b074e8eeb4446af66967da060188 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 17 Feb 2017 15:26:13 +0000 -Subject: [PATCH 096/139] brcmfmac: Mute expected startup 'errors' +Subject: [PATCH 096/171] brcmfmac: Mute expected startup 'errors' The brcmfmac WiFi driver always complains about the '00' country code. Modify the driver to ignore '00' silently. @@ -111027,10 +111027,10 @@ index 2d3b5e2a3ef7cd6186487b48665b401249380d18..e417454f5d6ec136cda29e65af5449f2 req->alpha2[0], req->alpha2[1]); return; -From e33b81237d0020f61b4f3dcac53d3500aade2093 Mon Sep 17 00:00:00 2001 +From e364d57d8a9c9f1261bb68c69cc25a9ceba4f819 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 17 Dec 2015 13:37:07 +0000 -Subject: [PATCH 097/139] hci_h5: Don't send conf_req when ACTIVE +Subject: [PATCH 097/171] 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. @@ -111053,10 +111053,10 @@ index c0e4e26dc30d7c3c6a771b7b86df88c8cf763646..7308287259eedcaf229f8a496a0e3826 if (H5_HDR_LEN(hdr) > 2) h5->tx_win = (data[2] & 0x07); -From 619ff1e23f24a45187d076ae0b6ac8e0e3e405d6 Mon Sep 17 00:00:00 2001 +From 181b3d643aacca16db379b49703be3dc56b07a45 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 13 Apr 2015 17:16:29 +0100 -Subject: [PATCH 098/139] config: Add default configs +Subject: [PATCH 098/171] config: Add default configs --- arch/arm/configs/bcm2709_defconfig | 1326 +++++++++++++++++++++++++++++++++++ @@ -113735,10 +113735,10 @@ index 0000000000000000000000000000000000000000..e0dd8723047ff488e81a03ef42fdbc68 +CONFIG_CRC_ITU_T=y +CONFIG_LIBCRC32C=y -From c189cce32c82b717fc774cb6fe14b3592f45978a Mon Sep 17 00:00:00 2001 +From 7566692d432a0e8610def088514844ef9dd84220 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Wed, 24 Aug 2016 03:35:56 -0700 -Subject: [PATCH 099/139] Add arm64 configuration and device tree differences. +Subject: [PATCH 099/171] Add arm64 configuration and device tree differences. Disable MMC_BCM2835_SDHOST and MMC_BCM2835 since these drivers are crashing at the moment. @@ -115152,10 +115152,10 @@ index 0000000000000000000000000000000000000000..e6b09fafa27eed2b762e3d53b55041f7 +CONFIG_LIBCRC32C=y +CONFIG_BCM2835_VCHIQ=n -From 8be8288237bb4a963a776a3896d86b3836e2f93d Mon Sep 17 00:00:00 2001 +From 884be0b94f117c28aab72117ffe02215738586a2 Mon Sep 17 00:00:00 2001 From: Electron752 Date: Thu, 12 Jan 2017 07:07:08 -0800 -Subject: [PATCH 100/139] ARM64: Make it work again on 4.9 (#1790) +Subject: [PATCH 100/171] 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. @@ -115566,10 +115566,10 @@ index e6b09fafa27eed2b762e3d53b55041f793683d27..c7e891d72969a388d9b135a36dbfc9c9 CONFIG_LIBCRC32C=y -CONFIG_BCM2835_VCHIQ=n -From 9e7c45cb35f1bcc9c1b65695fb0e4afc7abd9262 Mon Sep 17 00:00:00 2001 +From c6a4e3da93b691f122053e6eb0ab6d72f7a719bd Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Thu, 12 Jan 2017 19:10:07 -0800 -Subject: [PATCH 101/139] ARM64: Enable HDMI audio and vc04_services in +Subject: [PATCH 101/171] ARM64: Enable HDMI audio and vc04_services in bcmrpi3_defconfig Signed-off-by: Michael Zoran @@ -115598,10 +115598,10 @@ index c7e891d72969a388d9b135a36dbfc9c9cb609bf8..4b90f9b64abe9f089ba56b13d5a00de3 CONFIG_BCM2835_MBOX=y # CONFIG_IOMMU_SUPPORT is not set -From 85a92c1f3201d6e5ec5dc87655d3f0b0b0e86cf5 Mon Sep 17 00:00:00 2001 +From 8d2dc6b2e61e94337556351587691c3759feffda Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Thu, 12 Jan 2017 19:14:03 -0800 -Subject: [PATCH 102/139] ARM64: Run bcmrpi3_defconfig through savedefconfig. +Subject: [PATCH 102/171] ARM64: Run bcmrpi3_defconfig through savedefconfig. Signed-off-by: Michael Zoran --- @@ -115646,10 +115646,10 @@ index 4b90f9b64abe9f089ba56b13d5a00de33343bfb9..dac962ca1634662ce7d966f1ffb53b5b CONFIG_FB_TFT_AGM1264K_FL=m CONFIG_FB_TFT_BD663474=m -From 13a8e13e0f715bc23c11c8e8cb610fffb21cba18 Mon Sep 17 00:00:00 2001 +From a9d2f13f59431c63166d1a89c78eb6258a794906 Mon Sep 17 00:00:00 2001 From: Electron752 Date: Sat, 14 Jan 2017 02:54:26 -0800 -Subject: [PATCH 103/139] ARM64: Enable Kernel Address Space Randomization +Subject: [PATCH 103/171] ARM64: Enable Kernel Address Space Randomization (#1792) Randomization allows the mapping between virtual addresses and physical @@ -115681,10 +115681,10 @@ index dac962ca1634662ce7d966f1ffb53b5bfa27c506..aae33b4b3c3e736ea7cd3ca242158ad6 CONFIG_BINFMT_MISC=y CONFIG_COMPAT=y -From 400805b8d90d9c85bcb5f3278b8e9751b8ae8532 Mon Sep 17 00:00:00 2001 +From ae400d05f5e8cb9c573c2100e0abee7ba3baf941 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Sun, 15 Jan 2017 07:31:59 -0800 -Subject: [PATCH 104/139] ARM64: Enable RTL8187/RTL8192CU wifi in build config +Subject: [PATCH 104/171] 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 @@ -115709,10 +115709,10 @@ index aae33b4b3c3e736ea7cd3ca242158ad6ba558aff..b7d762df19b85e369a32cd823dfd0621 CONFIG_ZD1211RW=m CONFIG_MAC80211_HWSIM=m -From fdadb39f56139510a97c8117592b8dd2720ed49c Mon Sep 17 00:00:00 2001 +From 3d87d577857ca93f3cfb1fd69167cece96e1a0cc Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Sat, 14 Jan 2017 21:33:51 -0800 -Subject: [PATCH 105/139] ARM64/DWC_OTG: Port dwc_otg driver to ARM64 +Subject: [PATCH 105/171] 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 @@ -116055,10 +116055,10 @@ index 6b2c7d0c93f36a63863ff4b0ecc1f3eab77e058b..d7b700ff17821ad1944e36721fe6b2db /** The OS page size */ #define DWC_OS_PAGE_SIZE PAGE_SIZE -From 17391ea759a6ef89933dccf35d2bc8e619dc932f Mon Sep 17 00:00:00 2001 +From c932a2dc05a0704d9449d34efbe2fc1bf8d4cc46 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Sat, 14 Jan 2017 21:43:57 -0800 -Subject: [PATCH 106/139] ARM64: Round-Robin dispatch IRQs between CPUs. +Subject: [PATCH 106/171] 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 @@ -116132,10 +116132,10 @@ index 86b357ae027bf8ba1ac32cd150a8cf21e36597e2..05b17ca993f405c4c8e61a782ec58149 .name = "bcm2836-gpu", .irq_mask = bcm2836_arm_irqchip_mask_gpu_irq, -From 615be16b02245d67e23e5f874fe8933511445f14 Mon Sep 17 00:00:00 2001 +From 1e86cb5da528dfe5e2f1a321ce12b184477f0fa4 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Sat, 14 Jan 2017 21:45:03 -0800 -Subject: [PATCH 107/139] ARM64: Enable DWC_OTG Driver In ARM64 Build +Subject: [PATCH 107/171] ARM64: Enable DWC_OTG Driver In ARM64 Build Config(bcmrpi3_defconfig) Signed-off-by: Michael Zoran @@ -116156,10 +116156,10 @@ index b7d762df19b85e369a32cd823dfd062145bdefa7..4d85c231c5ea0244e1b05fb4a5e3c8fd CONFIG_USB_STORAGE=y CONFIG_USB_STORAGE_REALTEK=m -From 3d16bb3949322a4512ea216df5ac10c80cb34c5c Mon Sep 17 00:00:00 2001 +From a16b627cd1dc05a268244932770ba067b44c7d9c Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Sat, 11 Feb 2017 01:18:31 -0800 -Subject: [PATCH 108/139] ARM64: Force hardware emulation of deprecated +Subject: [PATCH 108/171] ARM64: Force hardware emulation of deprecated instructions. --- @@ -116187,10 +116187,10 @@ index d06fbe4cd38d7423c900aff64b0e728f995478d3..877b7c90f9555203d5d55d739359a256 case INSN_OBSOLETE: insn->current_mode = INSN_UNDEF; -From c3537844a84464e8190dce3d9be083f43ac33964 Mon Sep 17 00:00:00 2001 +From 9f36678c4e96bccedee28215830cf015cae94e73 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Fri, 10 Feb 2017 17:57:08 -0800 -Subject: [PATCH 109/139] build/arm64: Add rules for .dtbo files for dts +Subject: [PATCH 109/171] build/arm64: Add rules for .dtbo files for dts overlays We now create overlays as .dtbo files. @@ -116215,10 +116215,10 @@ index 939b310913cf38cd7ca3136128fb5440340d7d12..8d90800c10f96efa428f5ed348fe7047 dtbs: prepare scripts -From f153c4882197440e31ed8772321dab1da0ca6282 Mon Sep 17 00:00:00 2001 +From b9eb12b3a3f5a893cd477890dbbf911c8955e6b7 Mon Sep 17 00:00:00 2001 From: Bilal Amarni Date: Wed, 24 May 2017 10:52:50 +0200 -Subject: [PATCH 110/139] enable drivers for GPIO expander and vcio +Subject: [PATCH 110/171] enable drivers for GPIO expander and vcio --- arch/arm64/configs/bcmrpi3_defconfig | 3 +++ @@ -116246,10 +116246,10 @@ index 4d85c231c5ea0244e1b05fb4a5e3c8fd3e651ddf..9dcb58a519d041fadae99c81a7bda621 CONFIG_GPIO_ARIZONA=m CONFIG_GPIO_STMPE=y -From d60170a6873c953953c35e448f35dbe108f8d122 Mon Sep 17 00:00:00 2001 +From 99d8c601d55e046b959ce67538fb9886da2fce4f Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 23 Mar 2017 16:34:46 +0000 -Subject: [PATCH 111/139] bcm2835-aux: Add aux interrupt controller +Subject: [PATCH 111/171] 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 @@ -116413,10 +116413,10 @@ index bd750cf2238d61489811e7d7bd3b5f9950ed53c8..41e0702fae4692221980b0d02aed1ba6 BCM2835_AUX_CLOCK_COUNT, GFP_KERNEL); if (!onecell) -From cc8f478164b89d953363f56ae83ed971b16d502d Mon Sep 17 00:00:00 2001 +From 4390be7137d2f6d3b2143ee7725ba531d962dab1 Mon Sep 17 00:00:00 2001 From: Yasunari Takiguchi Date: Fri, 14 Apr 2017 10:43:57 +0100 -Subject: [PATCH 112/139] This is the driver for Sony CXD2880 DVB-T2/T tuner + +Subject: [PATCH 112/171] This is the driver for Sony CXD2880 DVB-T2/T tuner + demodulator. It includes the CXD2880 driver and the CXD2880 SPI adapter. The current CXD2880 driver version is 1.4.1 - 1.0.1 released on April 13, 2017. @@ -132548,10 +132548,10 @@ index 0000000000000000000000000000000000000000..82e122349055be817eb74ed5bbcd7560 +MODULE_AUTHOR("Sony Semiconductor Solutions Corporation"); +MODULE_LICENSE("GPL v2"); -From 7012d01d94d0dbd56f47210efb8cbd73b00adf13 Mon Sep 17 00:00:00 2001 +From 2e6dac907d75cff2f82a8961817494ef334ddcc1 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 14 Sep 2016 09:18:09 +0100 -Subject: [PATCH 113/139] raspberrypi-firmware: Define the MBOX channel in the +Subject: [PATCH 113/171] raspberrypi-firmware: Define the MBOX channel in the header. Signed-off-by: Eric Anholt @@ -132573,10 +132573,10 @@ index c819c21b0158a59c1308882e5a40e3f3fe73cbdf..de2a3dcd562beb752266eaf0070e5586 enum rpi_firmware_property_status { -From f54ab1aa9e8a5d0e918495c027d0e991e062eb09 Mon Sep 17 00:00:00 2001 +From 7696595c9d7c8a98648c5c08876e493665faed00 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 14 Sep 2016 09:16:19 +0100 -Subject: [PATCH 114/139] raspberrypi-firmware: Export the general transaction +Subject: [PATCH 114/171] raspberrypi-firmware: Export the general transaction function. The vc4-firmware-kms module is going to be doing the MBOX FB call. @@ -132620,10 +132620,10 @@ index de2a3dcd562beb752266eaf0070e55861d553f5f..dc7fd58afd5dddebf9b17065bb069a1d #endif /* __SOC_RASPBERRY_FIRMWARE_H__ */ -From a5463732a75a008828b4f963c2a108af3e22800f Mon Sep 17 00:00:00 2001 +From 388f2abcbe0487e606e625a80f610446ca779e20 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 14 Sep 2016 08:39:33 +0100 -Subject: [PATCH 115/139] drm/vc4: Add a mode for using the closed firmware for +Subject: [PATCH 115/171] drm/vc4: Add a mode for using the closed firmware for display. Signed-off-by: Eric Anholt @@ -133394,10 +133394,10 @@ index 0000000000000000000000000000000000000000..78c34305935501248b1ca548a1ee0175 + }, +}; -From 35d3a53a9185bb528407d0df813979a3b04e9731 Mon Sep 17 00:00:00 2001 +From b5860470429be1b4ce257aa8cda0e3142e68a2af Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 1 Feb 2017 17:09:18 -0800 -Subject: [PATCH 116/139] drm/vc4: Name the primary and cursor planes in fkms. +Subject: [PATCH 116/171] drm/vc4: Name the primary and cursor planes in fkms. This makes debugging nicer, compared to trying to remember what the IDs are. @@ -133421,10 +133421,10 @@ index 78c34305935501248b1ca548a1ee01753b8fa099..d9a5551d01a2155e3df1bbbd78a1ee2b if (type == DRM_PLANE_TYPE_PRIMARY) { vc4_plane->fbinfo = -From 1f931d536b161e23d2544b79f488a7e69051b670 Mon Sep 17 00:00:00 2001 +From 9da31c721225a5c1f9cee4569f69bce4c73d1f56 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 1 Feb 2017 17:10:09 -0800 -Subject: [PATCH 117/139] drm/vc4: Add DRM_DEBUG_ATOMIC for the insides of +Subject: [PATCH 117/171] drm/vc4: Add DRM_DEBUG_ATOMIC for the insides of fkms. Trying to debug weston on fkms involved figuring out what calls I was @@ -133494,10 +133494,10 @@ index d9a5551d01a2155e3df1bbbd78a1ee2b961be946..e372666af0119b1876bad5167e6d0ff8 RPI_FIRMWARE_SET_CURSOR_STATE, &packet_state, -From 9e8b8ba2c9632a747973c0cefe91db5af37ecfb9 Mon Sep 17 00:00:00 2001 +From bb5aae20e848de6107cd2aaaff21ef2973540072 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 2 Feb 2017 09:42:18 -0800 -Subject: [PATCH 118/139] drm/vc4: Fix sending of page flip completion events +Subject: [PATCH 118/171] 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 @@ -133539,10 +133539,10 @@ index e372666af0119b1876bad5167e6d0ff8945d1b80..4d7b7f218cbbc9e7abcaa37743978060 static void vc4_crtc_handle_page_flip(struct vc4_crtc *vc4_crtc) -From e555518439ecdd47ccb9505eab880a84b8d3834f Mon Sep 17 00:00:00 2001 +From 15c755dcf81db92e88e94be50ff148a9fdede543 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 18 Apr 2017 21:43:46 +0100 -Subject: [PATCH 119/139] vc4_fkms: Apply firmware overscan offset to hardware +Subject: [PATCH 119/171] vc4_fkms: Apply firmware overscan offset to hardware cursor --- @@ -133599,10 +133599,10 @@ index 4d7b7f218cbbc9e7abcaa37743978060b73fbdd1..d170775ccc985637ff018804f510a500 return 0; -From 06cb69d8d747600325f40d4e846f0e8c6520a64a Mon Sep 17 00:00:00 2001 +From 550c692520da0b7a988df2bbf89983320185c860 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 7 May 2017 11:34:26 +0200 -Subject: [PATCH 120/139] ASoC: bcm2835: Add support for TDM modes +Subject: [PATCH 120/171] ASoC: bcm2835: Add support for TDM modes bcm2835 supports arbitrary positioning of channel data within a frame and thus is capable of supporting TDM modes. Since @@ -134004,10 +134004,10 @@ index 56df7d8a43d0aac055a91b0d24aca8e1b4e308e4..dcacf7f83c9371df539a788ea33fedcf dev->dev = &pdev->dev; dev_set_drvdata(&pdev->dev, dev); -From fd5dad2c72082d7f6e56b7d77ddc8e9bf5078f39 Mon Sep 17 00:00:00 2001 +From 63a9418190c06057d7282d16cd7232126de240d4 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 7 May 2017 15:30:50 +0200 -Subject: [PATCH 121/139] ASoC: bcm2835: Support left/right justified and DSP +Subject: [PATCH 121/171] ASoC: bcm2835: Support left/right justified and DSP modes DSP modes and left/right justified modes can be supported @@ -134253,10 +134253,10 @@ index dcacf7f83c9371df539a788ea33fedcf97d64690..3a706fda4f39e42efbe12f19d87af9b1 } -From 0e2b47ef61372ef5156d06c0104d3f0631c2b956 Mon Sep 17 00:00:00 2001 +From 618dde4ab5358bae6516a478cda1ea0a63ed9995 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 7 May 2017 16:19:54 +0200 -Subject: [PATCH 122/139] ASoC: bcm2835: Support additional samplerates up to +Subject: [PATCH 122/171] ASoC: bcm2835: Support additional samplerates up to 384kHz Sample rates are only restricted by the capabilities of the @@ -134299,10 +134299,10 @@ index 3a706fda4f39e42efbe12f19d87af9b100a348a5..43f5715a0d5dda851731ecf7ff27e76c | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE -From f5d4d5767f0ac074db1208ab187212e777e5604f Mon Sep 17 00:00:00 2001 +From 1302bad8e2f755cedf02b33d57cce91e137b1b54 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 7 May 2017 16:24:57 +0200 -Subject: [PATCH 123/139] ASoC: bcm2835: Enforce full symmetry +Subject: [PATCH 123/171] ASoC: bcm2835: Enforce full symmetry bcm2835's configuration registers can't be changed when a stream is running, which means asymmetric configurations aren't supported. @@ -134338,10 +134338,10 @@ index 43f5715a0d5dda851731ecf7ff27e76c48fb6e57..2e449d7173fcecbcd647f90a26bd58b6 static bool bcm2835_i2s_volatile_reg(struct device *dev, unsigned int reg) -From 3341c9f5323e164c742d3a6cb68618d3abe2c8cc Mon Sep 17 00:00:00 2001 +From b1d2f481c540b4b1f5126a101814108c68755cf3 Mon Sep 17 00:00:00 2001 From: Andrei Gherzan Date: Mon, 5 Jun 2017 16:40:38 +0100 -Subject: [PATCH 124/139] dma-bcm2708: Fix module compilation of +Subject: [PATCH 124/171] dma-bcm2708: Fix module compilation of CONFIG_DMA_BCM2708 bcm2708-dmaengine.c defines functions like bcm_dma_start which are @@ -134384,10 +134384,10 @@ index c5bfff2765be4606077e6c8af73040ec13ee8974..6ca874d332a8bc666b1c9576ac51f479 #endif /* _PLAT_BCM2708_DMA_H */ -From 99f05ae9388329e244308733a4de7f1753979b68 Mon Sep 17 00:00:00 2001 +From e7ed189150a3e0d25135ea0f284b97d1460c4266 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 25 Aug 2017 19:18:13 +0100 -Subject: [PATCH 125/139] cache: export clean and invalidate +Subject: [PATCH 125/171] cache: export clean and invalidate --- arch/arm/mm/cache-v6.S | 4 ++-- @@ -134439,10 +134439,10 @@ index de78109d002db1a5e7c94a6c1bc8bb94161d07b8..4c850aa3af2b2439fced4e130441329a sub r3, r2, #1 bic r0, r0, r3 -From c3d122f3596add1b481b8b0e80f43787eed8fd0b Mon Sep 17 00:00:00 2001 +From 2dcb3544989e979d3d52cc4c9d81260eebfc933d Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Wed, 20 Sep 2017 11:52:41 +0200 -Subject: [PATCH 126/139] config: enable upstream IR TX drivers +Subject: [PATCH 126/171] config: enable upstream IR TX drivers Signed-off-by: Matthias Reichl --- @@ -134477,10 +134477,10 @@ index e0dd8723047ff488e81a03ef42fdbc68c43dc721..b397818f4a69d04c708101ea3f65e885 CONFIG_USB_VIDEO_CLASS=m CONFIG_USB_M5602=m -From a23bdd737312dd674ec493a85485a308153f1c27 Mon Sep 17 00:00:00 2001 +From bbe1b8d0ced651ed18a557d6683d82a61857d576 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Wed, 20 Sep 2017 11:52:42 +0200 -Subject: [PATCH 127/139] overlays: add gpio-ir-tx and pwm-ir-tx +Subject: [PATCH 127/171] overlays: add gpio-ir-tx and pwm-ir-tx Signed-off-by: Matthias Reichl --- @@ -134641,10 +134641,10 @@ index 0000000000000000000000000000000000000000..141c126fe33b90a16fea396b8e27692d + }; +}; -From ae1125e6d40b82f57af86d6bede24fba2378ed6f Mon Sep 17 00:00:00 2001 +From f7d3fa484e4decd4ca872aac25c0d29a6063b35e Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 29 Sep 2017 10:32:19 +0100 -Subject: [PATCH 128/139] amba_pl011: Insert mb() for correct FIFO handling +Subject: [PATCH 128/171] amba_pl011: Insert mb() for correct FIFO handling The pl011 register accessor functions use the _relaxed versions of the standard readl() and writel() functions, meaning that there are no @@ -134671,10 +134671,10 @@ index bfbc845d7be9ef804468d0a82da18d9b67857216..424bdc500864a86e5d431763ba416b52 return true; -From 2a6f454dfb8304ab4338a2d021737798ea9deffa Mon Sep 17 00:00:00 2001 +From 1a6a756f5c4a3200afa1665a03a3983f969509da Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 13 Oct 2017 00:21:48 +0100 -Subject: [PATCH 129/139] dwc_otg: Fixup change to DRIVER_ATTR interface +Subject: [PATCH 129/171] dwc_otg: Fixup change to DRIVER_ATTR interface --- drivers/usb/host/dwc_otg/dwc_otg_driver.c | 9 ++++----- @@ -134721,10 +134721,10 @@ index 95943e07528276b26b51ea2d57a1f433f280aaef..af123d01f3ef9f99450c78efdf766ca3 /** * This function is called during module intialization -From 035d1f2405099e40d103969732a573d204e9127a Mon Sep 17 00:00:00 2001 +From 8370147efd61ed7ebd711068db3772a11f5237f9 Mon Sep 17 00:00:00 2001 From: Chung-Hsien Hsu Date: Sun, 14 May 2017 20:11:05 -0500 -Subject: [PATCH 130/139] brcmfmac: add CLM download support +Subject: [PATCH 130/171] brcmfmac: add CLM download support Future firmwares will be provided with minimal built-in CLM - the NULL region (#n/0) becomes the initial country. It cannot be changed @@ -135152,10 +135152,10 @@ index 11ffaa01599eb4b343b7f675dc275fc8572d127e..b27170c12482de0ca4115b4bc9484c21 static int brcmf_usb_bus_setup(struct brcmf_usbdev_info *devinfo) -From 89fe12177446ca8c0a1e9ddbbe9dd57b62a7efeb Mon Sep 17 00:00:00 2001 +From 2d27dd9718836152e04b9ac6bc6ca90605efbd8d Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 6 Oct 2017 13:23:32 +0100 -Subject: [PATCH 131/139] brcmfmac: request_firmware_direct is quieter +Subject: [PATCH 131/171] brcmfmac: request_firmware_direct is quieter Since we don't have any CLM-capable firmware yet, silence the warning of its absence by using request_firmware_direct, which should also @@ -135180,10 +135180,10 @@ index f0309e039592ba6e388084a13f052c03f99cf1ef..b5889360da96096775db6425337a7215 if (err == -ENOENT) return 0; -From 365815729ef33f15bb2dc1b7c0942bc3a3b603e0 Mon Sep 17 00:00:00 2001 +From 9b5acb83b866e73937bf23c93429be39775a6115 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 29 Sep 2017 10:32:19 +0100 -Subject: [PATCH 132/139] amba_pl011: Add cts-event-workaround DT property +Subject: [PATCH 132/171] amba_pl011: Add cts-event-workaround DT property The BCM2835 PL011 implementation seems to have a bug that can lead to a transmission lockup if CTS changes frequently. A workaround was added to @@ -135249,10 +135249,10 @@ index 424bdc500864a86e5d431763ba416b5298c777dc..b224306633f62c398ef904734a903d4e uap->vendor = vendor; uap->fifosize = vendor->get_fifosize(dev); -From 384cb12b3bbdfea3863ed2d0ac983f30354d7c0e Mon Sep 17 00:00:00 2001 +From ed8889f1c47146f18a417a695791ffb0091932f2 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 11 Oct 2017 13:48:04 +0100 -Subject: [PATCH 133/139] amba-pl011: Report AUTOCTS capability to framework +Subject: [PATCH 133/171] amba-pl011: Report AUTOCTS capability to framework The PL011 has full hardware RTS/CTS support which is enabled by the driver when flow control is requested. However, it doesn't @@ -135295,10 +135295,10 @@ index b224306633f62c398ef904734a903d4e75df65c3..3b743cf8a94c279ff8d0b747f98062d0 if (uap->vendor->oversampling) { -From 83fa77cc49e984b3b8d68d215408f0f0814adf14 Mon Sep 17 00:00:00 2001 +From 26e43bf834562f784f5ac9cbca030c0902e7d615 Mon Sep 17 00:00:00 2001 From: neilneil2000 <31366098+neilneil2000@users.noreply.github.com> Date: Thu, 12 Oct 2017 17:29:43 +0100 -Subject: [PATCH 134/139] GPIO and gpio-poweroff clarifications +Subject: [PATCH 134/171] GPIO and gpio-poweroff clarifications Notes added: 1) All GPIO references use the hardware numbering scheme @@ -135332,10 +135332,10 @@ index eafbf530acdab53c74656e409319c6dcaefbfd4e..705c4ae77e5c5c36a9c05666e1d39476 Params: gpiopin GPIO for signalling (default 26) -From c4fb18de4672320d0e09b72313f66678abf2eccd Mon Sep 17 00:00:00 2001 +From c4b719506b2378c5007ee91d8f071e4fdfabe0ef Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 17 Oct 2017 17:17:20 +0100 -Subject: [PATCH 135/139] config: Add CONFIG_USB_LAN78XX=m +Subject: [PATCH 135/171] config: Add CONFIG_USB_LAN78XX=m Signed-off-by: Phil Elwell --- @@ -135368,10 +135368,10 @@ index b397818f4a69d04c708101ea3f65e885e24181eb..d4f9c4f270e52c574149813b853de062 CONFIG_USB_NET_AX8817X=m CONFIG_USB_NET_AX88179_178A=m -From ce1b1238dd740fa3d22ce7d97884dfdd086f7362 Mon Sep 17 00:00:00 2001 +From b17e3d12481d413f72978897dd49729d9f80aa0e Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 25 Oct 2017 09:20:56 +0100 -Subject: [PATCH 136/139] scripts: Update mkknlimg, just in case +Subject: [PATCH 136/171] scripts: Update mkknlimg, just in case With the removal of the vc_cma driver, mkknlimg lost an indication that the user had built a downstream kernel. Update the script, adding a few @@ -135414,10 +135414,10 @@ index 84be2593ec1de8f97b0167ff06b3e05d231c4ba0..d72e15224232d5164374e93be48949bf my $res = try_extract($kernel_file, $tmpfile1); -From 8fde87098234197c0f22d38055e84b828f069dd7 Mon Sep 17 00:00:00 2001 +From 84aea417601b910d26c5c8f742dacf51f6304426 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 30 Oct 2017 15:06:42 +0000 -Subject: [PATCH 137/139] ARM: dts: Swap serial aliases for BT-enabled Pis +Subject: [PATCH 137/171] ARM: dts: Swap serial aliases for BT-enabled Pis The upstream base dts files now define serial0 and serial1 [1]. This appears to the firmware like a user-specified preference via an overlay, @@ -135503,10 +135503,10 @@ index 634add7ab8bc0aa5501508c97050b101aa0e94f4..e032516ffd351a4099d150767a112f19 __overrides__ { act_led_gpio = <&act_led>,"gpios:4"; -From 11187924b3cbada3a22e3dfb735284e2107305df Mon Sep 17 00:00:00 2001 +From 11e58b9b2061a26c113ea8be13061fbec14f0d47 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 2 Nov 2017 09:16:17 +0000 -Subject: [PATCH 138/139] bcm2710: Refactor bcm2710.dtsi using bcm2837.dtsi +Subject: [PATCH 138/171] bcm2710: Refactor bcm2710.dtsi using bcm2837.dtsi (#2236) The 4.14 tree includes bcm2837.dtsi - use it as a basis for @@ -135687,10 +135687,10 @@ index 3e134a1208610b90e2d0fc22f03c6e9f372bfcd7..df4a91e266422eec15fd7e27d509309a -}; - -From b914eb26b80cad8d0f35292ab4bf8418efad0f16 Mon Sep 17 00:00:00 2001 +From d466eec351d6c282db91112a137993ab3ce8a85a Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 3 Nov 2017 09:45:12 +0000 -Subject: [PATCH 139/139] bcm2710: Fix compatible string in bcm2710.dtsi +Subject: [PATCH 139/171] bcm2710: Fix compatible string in bcm2710.dtsi The minimal "bcm2835" board support, used for some clock setup and serial/revision numbers, needs a compatible string of @@ -135719,3 +135719,4499 @@ index df4a91e266422eec15fd7e27d509309afcdbe809..d5ce5b60fb3b63a76831504c53145f82 soc { arm-pmu { + +From accd343d2170aa0df7803547d730f4110f977a88 Mon Sep 17 00:00:00 2001 +From: James Hughes +Date: Tue, 14 Nov 2017 15:13:15 +0000 +Subject: [PATCH 140/171] AXI performance monitor driver (#2222) + +Uses the debugfs I/F to provide access to the AXI +bus performance monitors. + +Requires the new mailbox peripheral access for access +to the VPU performance registers, system bus access +is done using direct register reads. + +Signed-off-by: James Hughes +--- + arch/arm/boot/dts/bcm2708-rpi.dtsi | 2 + + arch/arm/boot/dts/bcm270x.dtsi | 8 + + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + drivers/perf/Kconfig | 7 + + drivers/perf/Makefile | 1 + + drivers/perf/raspberrypi_axi_monitor.c | 637 +++++++++++++++++++++++++++++ + include/soc/bcm2835/raspberrypi-firmware.h | 3 + + 8 files changed, 660 insertions(+) + create mode 100644 drivers/perf/raspberrypi_axi_monitor.c + +diff --git a/arch/arm/boot/dts/bcm2708-rpi.dtsi b/arch/arm/boot/dts/bcm2708-rpi.dtsi +index 54fadb5543d09c848a9959302765b404c34910cc..46a4d33e148438e4ca7c8cc17a328705000b1b3a 100644 +--- a/arch/arm/boot/dts/bcm2708-rpi.dtsi ++++ b/arch/arm/boot/dts/bcm2708-rpi.dtsi +@@ -37,6 +37,7 @@ + fb = &fb; + vchiq = &vchiq; + thermal = &thermal; ++ axiperf = &axiperf; + }; + + leds: leds { +@@ -119,6 +120,7 @@ + sd_force_pio = <&sdhost>,"brcm,force-pio?"; + sd_pio_limit = <&sdhost>,"brcm,pio-limit:0"; + sd_debug = <&sdhost>,"brcm,debug"; ++ axiperf = <&axiperf>,"status"; + }; + }; + +diff --git a/arch/arm/boot/dts/bcm270x.dtsi b/arch/arm/boot/dts/bcm270x.dtsi +index d312c2739624eca57b218b26e272e187012cb7d1..6bb6fd2b16b661dcd48983c0df5626a6fe769dff 100644 +--- a/arch/arm/boot/dts/bcm270x.dtsi ++++ b/arch/arm/boot/dts/bcm270x.dtsi +@@ -130,6 +130,14 @@ + /* Add alias */ + status = "disabled"; + }; ++ ++ axiperf: axiperf { ++ compatible = "brcm,bcm2835-axiperf"; ++ reg = <0x7e009800 0x100>, ++ <0x7ee08000 0x100>; ++ firmware = <&firmware>; ++ status = "disabled"; ++ }; + }; + + vdd_5v0_reg: fixedregulator_5v0 { +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 6e75c2856190a7b072bb0a3780ca856a40b09a16..4efa95b70464215c257a03f95166e4cb0a0f5cc6 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -1181,6 +1181,7 @@ CONFIG_INV_MPU6050_I2C=m + CONFIG_BMP280=m + CONFIG_PWM_BCM2835=m + CONFIG_PWM_PCA9685=m ++CONFIG_RPI_AXIPERF=m + CONFIG_RASPBERRYPI_FIRMWARE=y + CONFIG_EXT4_FS=y + CONFIG_EXT4_FS_POSIX_ACL=y +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index d4f9c4f270e52c574149813b853de06240e32045..3845e3ddd220946a960e94222c3dc4773a1da42d 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -1187,6 +1187,7 @@ CONFIG_INV_MPU6050_I2C=m + CONFIG_BMP280=m + CONFIG_PWM_BCM2835=m + CONFIG_PWM_PCA9685=m ++CONFIG_RPI_AXIPERF=m + CONFIG_RASPBERRYPI_FIRMWARE=y + CONFIG_EXT4_FS=y + CONFIG_EXT4_FS_POSIX_ACL=y +diff --git a/drivers/perf/Kconfig b/drivers/perf/Kconfig +index e5197ffb74229e580c9f088a3a5f609c72d253b5..736c22e00e8f8447e538229e502fb4eec917ddd9 100644 +--- a/drivers/perf/Kconfig ++++ b/drivers/perf/Kconfig +@@ -43,4 +43,11 @@ config XGENE_PMU + help + Say y if you want to use APM X-Gene SoC performance monitors. + ++config RPI_AXIPERF ++ depends on ARCH_BCM2835 ++ tristate "RaspberryPi AXI Performance monitors" ++ default n ++ help ++ Say y if you want to use Raspberry Pi AXI performance monitors, m if ++ you want to build it as a module. + endmenu +diff --git a/drivers/perf/Makefile b/drivers/perf/Makefile +index 9402dc8ff22c6704be251beb7665513d6916ffdd..6f358671af46e61de4771b36b6a677affefa8cca 100644 +--- a/drivers/perf/Makefile ++++ b/drivers/perf/Makefile +@@ -4,3 +4,4 @@ obj-$(CONFIG_ARM_PMU_ACPI) += arm_pmu_acpi.o + obj-$(CONFIG_QCOM_L2_PMU) += qcom_l2_pmu.o + obj-$(CONFIG_QCOM_L3_PMU) += qcom_l3_pmu.o + obj-$(CONFIG_XGENE_PMU) += xgene_pmu.o ++obj-$(CONFIG_RPI_AXIPERF) += raspberrypi_axi_monitor.o +diff --git a/drivers/perf/raspberrypi_axi_monitor.c b/drivers/perf/raspberrypi_axi_monitor.c +new file mode 100644 +index 0000000000000000000000000000000000000000..bafe03b6c000060e78404d65a0aa96d86ee77ea9 +--- /dev/null ++++ b/drivers/perf/raspberrypi_axi_monitor.c +@@ -0,0 +1,637 @@ ++/* ++ * raspberrypi_axi_monitor.c ++ * ++ * Author: james.hughes@raspberrypi.org ++ * ++ * Raspberry Pi AXI performance counters. ++ * ++ * Copyright (C) 2017 Raspberry Pi Trading Ltd. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++ ++#define NUM_MONITORS 2 ++#define NUM_BUS_WATCHERS_PER_MONITOR 3 ++ ++#define SYSTEM_MONITOR 0 ++#define VPU_MONITOR 1 ++ ++#define MAX_BUSES 16 ++#define DEFAULT_SAMPLE_TIME 100 ++ ++#define NUM_BUS_WATCHER_RESULTS 9 ++ ++struct bus_watcher_data { ++ union { ++ u32 results[NUM_BUS_WATCHER_RESULTS]; ++ struct { ++ u32 atrans; ++ u32 atwait; ++ u32 amax; ++ u32 wtrans; ++ u32 wtwait; ++ u32 wmax; ++ u32 rtrans; ++ u32 rtwait; ++ u32 rmax; ++ }; ++ }; ++}; ++ ++ ++struct rpi_axiperf { ++ struct platform_device *dev; ++ struct dentry *root_folder; ++ ++ struct task_struct *monitor_thread; ++ struct mutex lock; ++ ++ struct rpi_firmware *firmware; ++ ++ /* Sample time spent on for each bus */ ++ int sample_time; ++ ++ /* Now storage for the per monitor settings and the resulting ++ * performance figures ++ */ ++ struct { ++ /* Bit field of buses we want to monitor */ ++ int bus_enabled; ++ /* Bit field of buses to filter by */ ++ int bus_filter; ++ /* The current buses being monitored on this monitor */ ++ int current_bus[NUM_BUS_WATCHERS_PER_MONITOR]; ++ /* The last bus monitored on this monitor */ ++ int last_monitored; ++ ++ /* Set true if this mailbox must use the mailbox interface ++ * rather than access registers directly. ++ */ ++ int use_mailbox_interface; ++ ++ /* Current result values */ ++ struct bus_watcher_data results[MAX_BUSES]; ++ ++ struct dentry *debugfs_entry; ++ void __iomem *base_address; ++ ++ } monitor[NUM_MONITORS]; ++ ++}; ++ ++static struct rpi_axiperf *state; ++ ++/* Two monitors, System and VPU, each with the following register sets. ++ * Each monitor can only monitor one bus at a time, so we time share them, ++ * giving each bus 100ms (default, settable via debugfs) of time on its ++ * associated monitor ++ * Record results from the three Bus watchers per monitor and push to the sysfs ++ */ ++ ++/* general registers */ ++const int GEN_CTRL; ++ ++const int GEN_CTL_ENABLE_BIT = BIT(0); ++const int GEN_CTL_RESET_BIT = BIT(1); ++ ++/* Bus watcher registers */ ++const int BW_PITCH = 0x40; ++ ++const int BW0_CTRL = 0x40; ++const int BW1_CTRL = 0x80; ++const int BW2_CTRL = 0xc0; ++ ++const int BW_ATRANS_OFFSET = 0x04; ++const int BW_ATWAIT_OFFSET = 0x08; ++const int BW_AMAX_OFFSET = 0x0c; ++const int BW_WTRANS_OFFSET = 0x10; ++const int BW_WTWAIT_OFFSET = 0x14; ++const int BW_WMAX_OFFSET = 0x18; ++const int BW_RTRANS_OFFSET = 0x1c; ++const int BW_RTWAIT_OFFSET = 0x20; ++const int BW_RMAX_OFFSET = 0x24; ++ ++const int BW_CTRL_RESET_BIT = BIT(31); ++const int BW_CTRL_ENABLE_BIT = BIT(30); ++const int BW_CTRL_ENABLE_ID_FILTER_BIT = BIT(29); ++const int BW_CTRL_LIMIT_HALT_BIT = BIT(28); ++ ++const int BW_CTRL_SOURCE_SHIFT = 8; ++const int BW_CTRL_SOURCE_MASK = GENMASK(12, 8); // 5 bits ++const int BW_CTRL_BUS_WATCH_SHIFT; ++const int BW_CTRL_BUS_WATCH_MASK = GENMASK(5, 0); // 6 bits ++const int BW_CTRL_BUS_FILTER_SHIFT = 8; ++ ++const static char *bus_filter_strings[] = { ++ "", ++ "CORE0_V", ++ "ICACHE0", ++ "DCACHE0", ++ "CORE1_V", ++ "ICACHE1", ++ "DCACHE1", ++ "L2_MAIN", ++ "HOST_PORT", ++ "HOST_PORT2", ++ "HVS", ++ "ISP", ++ "VIDEO_DCT", ++ "VIDEO_SD2AXI", ++ "CAM0", ++ "CAM1", ++ "DMA0", ++ "DMA1", ++ "DMA2_VPU", ++ "JPEG", ++ "VIDEO_CME", ++ "TRANSPOSER", ++ "VIDEO_FME", ++ "CCP2TX", ++ "USB", ++ "V3D0", ++ "V3D1", ++ "V3D2", ++ "AVE", ++ "DEBUG", ++ "CPU", ++ "M30" ++}; ++ ++const int num_bus_filters = ARRAY_SIZE(bus_filter_strings); ++ ++const static char *system_bus_string[] = { ++ "DMA_L2", ++ "TRANS", ++ "JPEG", ++ "SYSTEM_UC", ++ "DMA_UC", ++ "SYSTEM_L2", ++ "CCP2TX", ++ "MPHI_RX", ++ "MPHI_TX", ++ "HVS", ++ "H264", ++ "ISP", ++ "V3D", ++ "PERIPHERAL", ++ "CPU_UC", ++ "CPU_L2" ++}; ++ ++const int num_system_buses = ARRAY_SIZE(system_bus_string); ++ ++const static char *vpu_bus_string[] = { ++ "VPU1_D_L2", ++ "VPU0_D_L2", ++ "VPU1_I_L2", ++ "VPU0_I_L2", ++ "SYSTEM_L2", ++ "L2_FLUSH", ++ "DMA_L2", ++ "VPU1_D_UC", ++ "VPU0_D_UC", ++ "VPU1_I_UC", ++ "VPU0_I_UC", ++ "SYSTEM_UC", ++ "L2_OUT", ++ "DMA_UC", ++ "SDRAM", ++ "L2_IN" ++}; ++ ++const int num_vpu_buses = ARRAY_SIZE(vpu_bus_string); ++ ++const static char *monitor_name[] = { ++ "System", ++ "VPU" ++}; ++ ++static inline void write_reg(int monitor, int reg, u32 value) ++{ ++ writel(value, state->monitor[monitor].base_address + reg); ++} ++ ++static inline u32 read_reg(int monitor, u32 reg) ++{ ++ return readl(state->monitor[monitor].base_address + reg); ++} ++ ++static void read_bus_watcher(int monitor, int watcher, u32 *results) ++{ ++ if (state->monitor[monitor].use_mailbox_interface) { ++ /* We have 9 results, plus the overheads of start address and ++ * length So 11 u32 to define ++ */ ++ u32 tmp[11]; ++ int err; ++ ++ tmp[0] = (u32)(state->monitor[monitor].base_address + watcher ++ + BW_ATRANS_OFFSET); ++ tmp[1] = NUM_BUS_WATCHER_RESULTS; ++ ++ err = rpi_firmware_property(state->firmware, ++ RPI_FIRMWARE_GET_PERIPH_REG, ++ tmp, sizeof(tmp)); ++ ++ if (err < 0 || tmp[1] != NUM_BUS_WATCHER_RESULTS) ++ dev_err_once(&state->dev->dev, ++ "Failed to read bus watcher"); ++ else ++ memcpy(results, &tmp[2], ++ NUM_BUS_WATCHER_RESULTS * sizeof(u32)); ++ } else { ++ int i; ++ void __iomem *addr = state->monitor[monitor].base_address ++ + watcher + BW_ATRANS_OFFSET; ++ for (i = 0; i < NUM_BUS_WATCHER_RESULTS; i++, addr += 4) ++ *results++ = readl(addr); ++ } ++} ++ ++static void set_monitor_control(int monitor, u32 set) ++{ ++ if (state->monitor[monitor].use_mailbox_interface) { ++ u32 tmp[3] = {(u32)(state->monitor[monitor].base_address + ++ GEN_CTRL), 1, set}; ++ int err = rpi_firmware_property(state->firmware, ++ RPI_FIRMWARE_SET_PERIPH_REG, ++ tmp, sizeof(tmp)); ++ ++ if (err < 0 || tmp[1] != 1) ++ dev_err_once(&state->dev->dev, ++ "Failed to set monitor control"); ++ } else ++ write_reg(monitor, GEN_CTRL, set); ++} ++ ++static void set_bus_watcher_control(int monitor, int watcher, u32 set) ++{ ++ if (state->monitor[monitor].use_mailbox_interface) { ++ u32 tmp[3] = {(u32)(state->monitor[monitor].base_address + ++ watcher), 1, set}; ++ int err = rpi_firmware_property(state->firmware, ++ RPI_FIRMWARE_SET_PERIPH_REG, ++ tmp, sizeof(tmp)); ++ if (err < 0 || tmp[1] != 1) ++ dev_err_once(&state->dev->dev, ++ "Failed to set bus watcher control"); ++ } else ++ write_reg(monitor, watcher, set); ++} ++ ++static void monitor(struct rpi_axiperf *state) ++{ ++ int monitor, num_buses[NUM_MONITORS]; ++ ++ mutex_lock(&state->lock); ++ ++ for (monitor = 0; monitor < NUM_MONITORS; monitor++) { ++ typeof(state->monitor[0]) *mon = &(state->monitor[monitor]); ++ ++ /* Anything enabled? */ ++ if (mon->bus_enabled == 0) { ++ /* No, disable all monitoring for this monitor */ ++ set_monitor_control(monitor, GEN_CTL_RESET_BIT); ++ } else { ++ int i; ++ ++ /* Find out how many busses we want to monitor, and ++ * spread our 3 actual monitors over them ++ */ ++ num_buses[monitor] = hweight32(mon->bus_enabled); ++ num_buses[monitor] = min(num_buses[monitor], ++ NUM_BUS_WATCHERS_PER_MONITOR); ++ ++ for (i = 0; i < num_buses[monitor]; i++) { ++ int bus_control; ++ ++ do { ++ mon->last_monitored++; ++ mon->last_monitored &= 0xf; ++ } while ((mon->bus_enabled & ++ (1 << mon->last_monitored)) == 0); ++ ++ mon->current_bus[i] = mon->last_monitored; ++ ++ /* Reset the counters */ ++ set_bus_watcher_control(monitor, ++ BW0_CTRL + ++ i*BW_PITCH, ++ BW_CTRL_RESET_BIT); ++ ++ bus_control = BW_CTRL_ENABLE_BIT | ++ mon->current_bus[i]; ++ ++ if (mon->bus_filter) { ++ bus_control |= ++ BW_CTRL_ENABLE_ID_FILTER_BIT; ++ bus_control |= ++ ((mon->bus_filter & 0x1f) ++ << BW_CTRL_BUS_FILTER_SHIFT); ++ } ++ ++ // Start capture ++ set_bus_watcher_control(monitor, ++ BW0_CTRL + i*BW_PITCH, ++ bus_control); ++ } ++ } ++ ++ /* start monitoring */ ++ set_monitor_control(monitor, GEN_CTL_ENABLE_BIT); ++ } ++ ++ mutex_unlock(&state->lock); ++ ++ msleep(state->sample_time); ++ ++ /* Now read the results */ ++ ++ mutex_lock(&state->lock); ++ for (monitor = 0; monitor < NUM_MONITORS; monitor++) { ++ typeof(state->monitor[0]) *mon = &(state->monitor[monitor]); ++ ++ /* Anything enabled? */ ++ if (mon->bus_enabled == 0) { ++ /* No, disable all monitoring for this monitor */ ++ set_monitor_control(monitor, 0); ++ } else { ++ int i; ++ ++ for (i = 0; i < num_buses[monitor]; i++) { ++ int bus = mon->current_bus[i]; ++ ++ read_bus_watcher(monitor, ++ BW0_CTRL + i*BW_PITCH, ++ (u32 *)&mon->results[bus].results); ++ } ++ } ++ } ++ mutex_unlock(&state->lock); ++} ++ ++static int monitor_thread(void *data) ++{ ++ struct rpi_axiperf *state = data; ++ ++ while (1) { ++ monitor(state); ++ ++ if (kthread_should_stop()) ++ return 0; ++ } ++ return 0; ++} ++ ++static ssize_t myreader(struct file *fp, char __user *user_buffer, ++ size_t count, loff_t *position) ++{ ++#define INIT_BUFF_SIZE 2048 ++ ++ int i; ++ int idx = (int)(fp->private_data); ++ int num_buses, cnt; ++ char *string_buffer; ++ int buff_size = INIT_BUFF_SIZE; ++ char *p; ++ typeof(state->monitor[0]) *mon = &(state->monitor[idx]); ++ ++ if (idx < 0 || idx > NUM_MONITORS) ++ idx = 0; ++ ++ num_buses = idx == SYSTEM_MONITOR ? num_system_buses : num_vpu_buses; ++ ++ string_buffer = kmalloc(buff_size, GFP_KERNEL); ++ ++ if (!string_buffer) { ++ dev_err(&state->dev->dev, ++ "Failed temporary string allocation\n"); ++ return 0; ++ } ++ ++ p = string_buffer; ++ ++ mutex_lock(&state->lock); ++ ++ if (mon->bus_filter) { ++ int filt = min(mon->bus_filter & 0x1f, num_bus_filters); ++ ++ cnt = snprintf(p, buff_size, ++ "\nMonitoring transactions from %s only\n", ++ bus_filter_strings[filt]); ++ p += cnt; ++ buff_size -= cnt; ++ } ++ ++ cnt = snprintf(p, buff_size, " Bus | Atrans Atwait AMax Wtrans Wtwait WMax Rtrans Rtwait RMax\n" ++ "======================================================================================================\n"); ++ ++ if (cnt >= buff_size) ++ goto done; ++ ++ p += cnt; ++ buff_size -= cnt; ++ ++ for (i = 0; i < num_buses; i++) { ++ if (mon->bus_enabled & (1 << i)) { ++#define DIVIDER (1024) ++ typeof(mon->results[0]) *res = &(mon->results[i]); ++ ++ cnt = snprintf(p, buff_size, ++ "%10s | %8uK %8uK %8uK %8uK %8uK %8uK %8uK %8uK %8uK\n", ++ idx == SYSTEM_MONITOR ? ++ system_bus_string[i] : ++ vpu_bus_string[i], ++ res->atrans/DIVIDER, ++ res->atwait/DIVIDER, ++ res->amax/DIVIDER, ++ res->wtrans/DIVIDER, ++ res->wtwait/DIVIDER, ++ res->wmax/DIVIDER, ++ res->rtrans/DIVIDER, ++ res->rtwait/DIVIDER, ++ res->rmax/DIVIDER ++ ); ++ if (cnt >= buff_size) ++ goto done; ++ ++ p += cnt; ++ buff_size -= cnt; ++ } ++ } ++ ++ mutex_unlock(&state->lock); ++ ++done: ++ ++ /* did the last string entry exceeed our buffer size? ie out of string ++ * buffer space. Null terminate, use what we have. ++ */ ++ if (cnt >= buff_size) { ++ buff_size = 0; ++ string_buffer[INIT_BUFF_SIZE] = 0; ++ } ++ ++ cnt = simple_read_from_buffer(user_buffer, count, position, ++ string_buffer, ++ INIT_BUFF_SIZE - buff_size); ++ ++ kfree(string_buffer); ++ ++ return cnt; ++} ++ ++static ssize_t mywriter(struct file *fp, const char __user *user_buffer, ++ size_t count, loff_t *position) ++{ ++ int idx = (int)(fp->private_data); ++ ++ if (idx < 0 || idx > NUM_MONITORS) ++ idx = 0; ++ ++ /* At the moment, this does nothing, but in the future it could be ++ * used to reset counters etc ++ */ ++ return count; ++} ++ ++static const struct file_operations fops_debug = { ++ .read = myreader, ++ .write = mywriter, ++ .open = simple_open ++}; ++ ++static int rpi_axiperf_probe(struct platform_device *pdev) ++{ ++ int ret = 0, i; ++ struct device *dev = &pdev->dev; ++ struct device_node *np = dev->of_node; ++ struct device_node *fw_node; ++ ++ state = kzalloc(sizeof(struct rpi_axiperf), GFP_KERNEL); ++ if (!state) ++ return -ENOMEM; ++ ++ /* Get the firmware handle for future rpi-firmware-xxx calls */ ++ fw_node = of_parse_phandle(np, "firmware", 0); ++ if (!fw_node) { ++ dev_err(dev, "Missing firmware node\n"); ++ return -ENOENT; ++ } ++ ++ state->firmware = rpi_firmware_get(fw_node); ++ if (!state->firmware) ++ return -EPROBE_DEFER; ++ ++ /* Special case for the VPU monitor, we must use the mailbox interface ++ * as it is not accessible from the ARM address space. ++ */ ++ state->monitor[VPU_MONITOR].use_mailbox_interface = 1; ++ state->monitor[SYSTEM_MONITOR].use_mailbox_interface = 0; ++ ++ for (i = 0; i < NUM_MONITORS; i++) { ++ if (state->monitor[i].use_mailbox_interface) { ++ of_property_read_u32_index(np, "reg", i*2, ++ (u32 *)(&state->monitor[i].base_address)); ++ } else { ++ struct resource *resource = ++ platform_get_resource(pdev, IORESOURCE_MEM, i); ++ ++ state->monitor[i].base_address = ++ devm_ioremap_resource(&pdev->dev, resource); ++ } ++ ++ if (IS_ERR(state->monitor[i].base_address)) ++ return PTR_ERR(state->monitor[i].base_address); ++ ++ /* Enable all buses by default */ ++ state->monitor[i].bus_enabled = 0xffff; ++ } ++ ++ state->dev = pdev; ++ platform_set_drvdata(pdev, state); ++ ++ state->sample_time = DEFAULT_SAMPLE_TIME; ++ ++ /* Set up all the debugfs stuff */ ++ state->root_folder = debugfs_create_dir(KBUILD_MODNAME, NULL); ++ ++ for (i = 0; i < NUM_MONITORS; i++) { ++ state->monitor[i].debugfs_entry = ++ debugfs_create_dir(monitor_name[i], state->root_folder); ++ if (IS_ERR(state->monitor[i].debugfs_entry)) ++ state->monitor[i].debugfs_entry = NULL; ++ ++ debugfs_create_file("data", 0444, ++ state->monitor[i].debugfs_entry, ++ (void *)i, &fops_debug); ++ debugfs_create_u32("enable", 0644, ++ state->monitor[i].debugfs_entry, ++ &state->monitor[i].bus_enabled); ++ debugfs_create_u32("filter", 0644, ++ state->monitor[i].debugfs_entry, ++ &state->monitor[i].bus_filter); ++ debugfs_create_u32("sample_time", 0644, ++ state->monitor[i].debugfs_entry, ++ &state->sample_time); ++ } ++ ++ mutex_init(&state->lock); ++ ++ state->monitor_thread = kthread_run(monitor_thread, state, ++ "rpi-axiperfmon"); ++ ++ return ret; ++ ++} ++ ++static int rpi_axiperf_remove(struct platform_device *dev) ++{ ++ int ret = 0; ++ ++ kthread_stop(state->monitor_thread); ++ ++ debugfs_remove_recursive(state->root_folder); ++ state->root_folder = NULL; ++ ++ return ret; ++} ++ ++static const struct of_device_id rpi_axiperf_match[] = { ++ { ++ .compatible = "brcm,bcm2835-axiperf", ++ }, ++ {}, ++}; ++MODULE_DEVICE_TABLE(of, rpi_axiperf_match); ++ ++static struct platform_driver rpi_axiperf_driver = { ++ .probe = rpi_axiperf_probe, ++ .remove = rpi_axiperf_remove, ++ .driver = { ++ .name = "rpi-bcm2835-axiperf", ++ .of_match_table = of_match_ptr(rpi_axiperf_match), ++ }, ++}; ++ ++module_platform_driver(rpi_axiperf_driver); ++ ++/* Module information */ ++MODULE_AUTHOR("James Hughes "); ++MODULE_DESCRIPTION("RPI AXI Performance monitor driver"); ++MODULE_LICENSE("GPL"); ++ +diff --git a/include/soc/bcm2835/raspberrypi-firmware.h b/include/soc/bcm2835/raspberrypi-firmware.h +index dc7fd58afd5dddebf9b17065bb069a1db663362c..cbd1674570433fc591df89f68c892b338a159e82 100644 +--- a/include/soc/bcm2835/raspberrypi-firmware.h ++++ b/include/soc/bcm2835/raspberrypi-firmware.h +@@ -88,6 +88,9 @@ enum rpi_firmware_property_tag { + RPI_FIRMWARE_SET_SDHOST_CLOCK = 0x00038042, + RPI_FIRMWARE_GET_GPIO_CONFIG = 0x00030043, + RPI_FIRMWARE_SET_GPIO_CONFIG = 0x00038043, ++ RPI_FIRMWARE_GET_PERIPH_REG = 0x00030045, ++ RPI_FIRMWARE_SET_PERIPH_REG = 0x00038045, ++ + + /* Dispmanx TAGS */ + RPI_FIRMWARE_FRAMEBUFFER_ALLOCATE = 0x00040001, + +From 5194c9e5ef465b5363d0391d665d80f6c76d2d50 Mon Sep 17 00:00:00 2001 +From: James Hughes +Date: Fri, 21 Jul 2017 09:55:12 +0100 +Subject: [PATCH 141/171] Sets the BCDC priority to constant 0 + +This is to workaround for a possible issue in the +wireless chip firmware where some packets with +higher priorities seem to go missing. + +See https://github.com/raspberrypi/linux/issues/1342 for +details. +--- + drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c +index 9f2d0b0cf6e5c452ad85a3caef58cf16a8cdad46..b009f3083490c2bc2733424f08f81b9f751de939 100644 +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c +@@ -274,7 +274,7 @@ brcmf_proto_bcdc_hdrpush(struct brcmf_pub *drvr, int ifidx, u8 offset, + if (pktbuf->ip_summed == CHECKSUM_PARTIAL) + h->flags |= BCDC_FLAG_SUM_NEEDED; + +- h->priority = (pktbuf->priority & BCDC_PRIORITY_MASK); ++ h->priority = 0; + h->flags2 = 0; + h->data_offset = offset; + BCDC_SET_IF_IDX(h, ifidx); + +From 9d800cfd4d3b77f222cf4f992dd45dc8f0708702 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= +Date: Sat, 15 Jul 2017 21:24:18 +0200 +Subject: [PATCH 142/171] config: Enable TINYDRM and drivers +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Enable tinydrm library, mi0283qt and repaper drivers. + +Signed-off-by: Noralf Trønnes +--- + arch/arm/configs/bcm2709_defconfig | 3 +++ + arch/arm/configs/bcmrpi_defconfig | 3 +++ + 2 files changed, 6 insertions(+) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 4efa95b70464215c257a03f95166e4cb0a0f5cc6..b85cd24405f71287700cf521c058edfab08f4374 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -843,6 +843,9 @@ CONFIG_DRM_LOAD_EDID_FIRMWARE=y + CONFIG_DRM_UDL=m + CONFIG_DRM_PANEL_SIMPLE=m + CONFIG_DRM_VC4=m ++CONFIG_DRM_TINYDRM=m ++CONFIG_TINYDRM_MI0283QT=m ++CONFIG_TINYDRM_REPAPER=m + CONFIG_FB=y + CONFIG_FB_BCM2708=y + CONFIG_FB_UDL=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 3845e3ddd220946a960e94222c3dc4773a1da42d..7f0f669ed33a927194932e362969db0c25a65a5c 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -836,6 +836,9 @@ CONFIG_DRM_LOAD_EDID_FIRMWARE=y + CONFIG_DRM_UDL=m + CONFIG_DRM_PANEL_SIMPLE=m + CONFIG_DRM_VC4=m ++CONFIG_DRM_TINYDRM=m ++CONFIG_TINYDRM_MI0283QT=m ++CONFIG_TINYDRM_REPAPER=m + CONFIG_FB=y + CONFIG_FB_BCM2708=y + CONFIG_FB_UDL=m + +From 72d3882018613b25b57ad33a6b1e723054ddcd9f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= +Date: Sun, 16 Jul 2017 00:13:36 +0200 +Subject: [PATCH 143/171] BCM270X_DT: Add PaPiRus overlay +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Add Device Tree overlay for the PaPiRus ePaper Screens by Pi Supply. + +Signed-off-by: Noralf Trønnes +--- + arch/arm/boot/dts/overlays/Makefile | 1 + + arch/arm/boot/dts/overlays/README | 11 ++++ + arch/arm/boot/dts/overlays/papirus-overlay.dts | 89 ++++++++++++++++++++++++++ + 3 files changed, 101 insertions(+) + create mode 100644 arch/arm/boot/dts/overlays/papirus-overlay.dts + +diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile +index df9ec4c40d2438837e0c34ad305bd46fe8f559e2..b8771396608df877ca0832ce2b36972530c655bc 100644 +--- a/arch/arm/boot/dts/overlays/Makefile ++++ b/arch/arm/boot/dts/overlays/Makefile +@@ -65,6 +65,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ + mmc.dtbo \ + mpu6050.dtbo \ + mz61581.dtbo \ ++ papirus.dtbo \ + pi3-act-led.dtbo \ + pi3-disable-bt.dtbo \ + pi3-disable-wifi.dtbo \ +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 705c4ae77e5c5c36a9c05666e1d39476986e2277..6f6daf2164add0af2363befec3ec521b367c402e 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -1016,6 +1016,17 @@ Params: speed Display SPI bus speed + xohms Touchpanel sensitivity (X-plate resistance) + + ++Name: papirus ++Info: PaPiRus ePaper Screen by Pi Supply (both HAT and pHAT) ++Load: dtoverlay=papirus,= ++Params: panel Display panel (required): ++ 1.44": e1144cs021 ++ 2.0": e2200cs021 ++ 2.7": e2271cs021 ++ ++ speed Display SPI bus speed ++ ++ + [ The pcf2127-rtc overlay has been deleted. See i2c-rtc. ] + + +diff --git a/arch/arm/boot/dts/overlays/papirus-overlay.dts b/arch/arm/boot/dts/overlays/papirus-overlay.dts +new file mode 100644 +index 0000000000000000000000000000000000000000..58eb8847f9ed8746cbffdbf4cdc83711a9201e83 +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/papirus-overlay.dts +@@ -0,0 +1,89 @@ ++/* PaPiRus ePaper Screen by Pi Supply */ ++ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target = <&i2c_arm>; ++ __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ display_temp: lm75@48 { ++ compatible = "lm75b"; ++ reg = <0x48>; ++ status = "okay"; ++ #thermal-sensor-cells = <0>; ++ }; ++ }; ++ }; ++ ++ fragment@1 { ++ target-path = "/"; ++ __overlay__ { ++ thermal-zones { ++ display { ++ polling-delay-passive = <0>; ++ polling-delay = <0>; ++ thermal-sensors = <&display_temp>; ++ }; ++ }; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&spi0>; ++ __overlay__ { ++ status = "okay"; ++ ++ spidev@0{ ++ status = "disabled"; ++ }; ++ }; ++ }; ++ ++ fragment@3 { ++ target = <&gpio>; ++ __overlay__ { ++ repaper_pins: repaper_pins { ++ brcm,pins = <14 15 23 24 25>; ++ brcm,function = <1 1 1 1 0>; /* out out out out in */ ++ }; ++ }; ++ }; ++ ++ fragment@4 { ++ target = <&spi0>; ++ __overlay__ { ++ /* needed to avoid dtc warning */ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ repaper: repaper@0{ ++ compatible = "not_set"; ++ reg = <0>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&repaper_pins>; ++ ++ spi-max-frequency = <8000000>; ++ ++ panel-on-gpios = <&gpio 23 0>; ++ border-gpios = <&gpio 14 0>; ++ discharge-gpios = <&gpio 15 0>; ++ reset-gpios = <&gpio 24 0>; ++ busy-gpios = <&gpio 25 0>; ++ ++ repaper-thermal-zone = "display"; ++ }; ++ }; ++ }; ++ ++ __overrides__ { ++ panel = <&repaper>, "compatible"; ++ speed = <&repaper>, "spi-max-frequency:0"; ++ }; ++}; + +From 9dbf47dffa6c7fcdb636dae8e2d22aa70bf7fee8 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Sat, 18 Nov 2017 20:40:28 +0000 +Subject: [PATCH 144/171] BCM2708_DT: Undo downstream changes to upstream dtsis + +Move the bcm283x.dtsi modifications into bcm270x.dtsi, except for the +SPI gpio declarations which are added in board-specific dts files. + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/bcm270x.dtsi | 23 +++++++++++++++++++++++ + arch/arm/boot/dts/bcm283x.dtsi | 13 +++---------- + 2 files changed, 26 insertions(+), 10 deletions(-) + +diff --git a/arch/arm/boot/dts/bcm270x.dtsi b/arch/arm/boot/dts/bcm270x.dtsi +index 6bb6fd2b16b661dcd48983c0df5626a6fe769dff..a3544c1f5b9dce153bb22f94b6728d6ecd901777 100644 +--- a/arch/arm/boot/dts/bcm270x.dtsi ++++ b/arch/arm/boot/dts/bcm270x.dtsi +@@ -156,3 +156,26 @@ + regulator-always-on; + }; + }; ++ ++/* Configure and use the auxilliary interrupt controller */ ++ ++&aux { ++ interrupts = <1 29>; ++ interrupt-controller; ++ #interrupt-cells = <1>; ++}; ++ ++&uart1 { ++ interrupt-parent = <&aux>; ++ interrupts = <0>; ++}; ++ ++&spi1 { ++ interrupt-parent = <&aux>; ++ interrupts = <1>; ++}; ++ ++&spi2 { ++ interrupt-parent = <&aux>; ++ interrupts = <2>; ++}; +diff --git a/arch/arm/boot/dts/bcm283x.dtsi b/arch/arm/boot/dts/bcm283x.dtsi +index 8617ffdb2463ff307a3de32b74003e8a621119d5..013431e3d7c3140d3a0645bdf4f130e9a860f984 100644 +--- a/arch/arm/boot/dts/bcm283x.dtsi ++++ b/arch/arm/boot/dts/bcm283x.dtsi +@@ -413,7 +413,6 @@ + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; +- cs-gpios = <&gpio 8 1>, <&gpio 7 1>; + }; + + i2c0: i2c@7e205000 { +@@ -470,16 +469,12 @@ + #clock-cells = <1>; + reg = <0x7e215000 0x8>; + clocks = <&clocks BCM2835_CLOCK_VPU>; +- interrupts = <1 29>; +- interrupt-controller; +- #interrupt-cells = <1>; + }; + + uart1: serial@7e215040 { + compatible = "brcm,bcm2835-aux-uart"; + reg = <0x7e215040 0x40>; +- interrupt-parent = <&aux>; +- interrupts = <0>; ++ interrupts = <1 29>; + clocks = <&aux BCM2835_AUX_CLOCK_UART>; + status = "disabled"; + }; +@@ -487,8 +482,7 @@ + spi1: spi@7e215080 { + compatible = "brcm,bcm2835-aux-spi"; + reg = <0x7e215080 0x40>; +- interrupt-parent = <&aux>; +- interrupts = <1>; ++ interrupts = <1 29>; + clocks = <&aux BCM2835_AUX_CLOCK_SPI1>; + #address-cells = <1>; + #size-cells = <0>; +@@ -498,8 +492,7 @@ + spi2: spi@7e2150c0 { + compatible = "brcm,bcm2835-aux-spi"; + reg = <0x7e2150c0 0x40>; +- interrupt-parent = <&aux>; +- interrupts = <2>; ++ interrupts = <1 29>; + clocks = <&aux BCM2835_AUX_CLOCK_SPI2>; + #address-cells = <1>; + #size-cells = <0>; + +From 166358058da45115226dfb5705dba8e35d0df4f4 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 21 Nov 2017 09:55:25 +0000 +Subject: [PATCH 145/171] dwc_otg: Fix compilation warnings + +Signed-off-by: Phil Elwell +--- + drivers/usb/host/dwc_otg/dwc_otg_attr.c | 6 ++++-- + drivers/usb/host/dwc_otg/dwc_otg_hcd.c | 1 - + drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c | 1 - + 3 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_attr.c b/drivers/usb/host/dwc_otg/dwc_otg_attr.c +index 9da0c92aaeca2fc393016442cc6578cb4a52c978..2f8ea77c3892b678cfacb61c70b95eebdbc553ac 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_attr.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_attr.c +@@ -918,9 +918,11 @@ DEVICE_ATTR(regdump, S_IRUGO, regdump_show, 0); + static ssize_t spramdump_show(struct device *_dev, + struct device_attribute *attr, char *buf) + { +- dwc_otg_device_t *otg_dev = dwc_otg_drvdev(_dev); ++#if 0 ++ dwc_otg_device_t *otg_dev = dwc_otg_drvdev(_dev); + +- //dwc_otg_dump_spram(otg_dev->core_if); ++ dwc_otg_dump_spram(otg_dev->core_if); ++#endif + + return sprintf(buf, "SPRAM Dump\n"); + } +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c +index 7710370b30363e3170bf9bf522597c5f41dfb908..0c28a6e44299bffd42c501497b6fa02206c2b620 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c +@@ -2005,7 +2005,6 @@ dwc_otg_transaction_type_e dwc_otg_hcd_select_transactions(dwc_otg_hcd_t * hcd) + dwc_list_link_t *qh_ptr; + dwc_otg_qh_t *qh; + int num_channels; +- dwc_irqflags_t flags; + dwc_otg_transaction_type_e ret_val = DWC_OTG_TRANSACTION_NONE; + + #ifdef DEBUG_HOST_CHANNELS +diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c +index c8f52709a7d24974c0a38dcf1708f91073e96b0e..6947e98b87adb6a5002127215943ad1ac126a05f 100644 +--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c ++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c +@@ -948,7 +948,6 @@ static void release_channel(dwc_otg_hcd_t * hcd, + { + dwc_otg_transaction_type_e tr_type; + int free_qtd; +- dwc_irqflags_t flags; + + int hog_port = 0; + + +From b0fc6b157c715e26b4b3465d1d6324a501606195 Mon Sep 17 00:00:00 2001 +From: Alistair Buxton +Date: Sat, 28 Oct 2017 04:58:26 +0100 +Subject: [PATCH 146/171] BCM_VC_SM: select DMA_SHARED_BUFFER + +This driver was refactored to use the kernel DMA buffer sharing api +in commit a97390852b14e8f06cf579adaaf8b664184e92d2. + +Per Documentation/dma-buf-sharing.txt, it must select DMA_SHARED_BUFFER +in its Kconfig. + +Signed-off-by: Alistair Buxton +--- + drivers/char/broadcom/Kconfig | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/char/broadcom/Kconfig b/drivers/char/broadcom/Kconfig +index 014c7a15e85c6eff99f840fbc44fc6c83f2d9c91..cffd17df6a1b62cc347331a9eaaf8f47fbbbb431 100644 +--- a/drivers/char/broadcom/Kconfig ++++ b/drivers/char/broadcom/Kconfig +@@ -27,6 +27,7 @@ config BCM_VC_SM + bool "VMCS Shared Memory" + depends on BCM2835_VCHIQ + select BCM2708_VCMEM ++ select DMA_SHARED_BUFFER + default n + help + Support for the VC shared memory on the Broadcom reference + +From 5e111ee5edd4094d171358d7d2071dbf37dbc473 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Tue, 26 Apr 2016 13:46:13 -0700 +Subject: [PATCH 147/171] drm/panel: Add support for the Raspberry Pi 7" + Touchscreen. + +This driver communicates with the Atmel microcontroller for sequencing +the poweron of the TC358762 DSI-DPI bridge and controlling the +backlight PWM. + +The following lines are required in config.txt, to keep the firmware +from trying to bash our I2C lines and steal the DSI interrupts: + + disable_touchscreen=1 + ignore_lcd=2 + mask_gpu_interrupt1=0x1000 + +This means that the firmware won't power on the panel at boot time (no +rainbow) and the touchscreen input won't work. The native input +driver for the touchscreen still needs to be written. + +v2: Set the same default orientation as the closed source firmware + used, which is the best for viewing angle. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/panel/Kconfig | 8 + + drivers/gpu/drm/panel/Makefile | 1 + + .../gpu/drm/panel/panel-raspberrypi-touchscreen.c | 514 +++++++++++++++++++++ + 3 files changed, 523 insertions(+) + create mode 100644 drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c + +diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig +index d84a031fae247db1787d9143eb54767381a42c33..d6f1969b8a3b07534837d59d091143550b7c333d 100644 +--- a/drivers/gpu/drm/panel/Kconfig ++++ b/drivers/gpu/drm/panel/Kconfig +@@ -73,6 +73,14 @@ config DRM_PANEL_PANASONIC_VVX10F034N00 + WUXGA (1920x1200) Novatek NT1397-based DSI panel as found in some + Xperia Z2 tablets + ++config DRM_PANEL_RASPBERRYPI_TOUCHSCREEN ++ tristate "Raspberry Pi 7-inch touchscreen panel" ++ depends on DRM_MIPI_DSI ++ help ++ Say Y here if you want to enable support for the Raspberry ++ Pi 7" Touchscreen. To compile this driver as a module, ++ choose M here. ++ + config DRM_PANEL_SAMSUNG_S6E3HA2 + tristate "Samsung S6E3HA2 DSI video mode panel" + depends on OF +diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile +index d73d3e661cec5e6943296292166d93663bf53c75..6975da6d61095191e6b6ea8e1eb69edd3bc78f23 100644 +--- a/drivers/gpu/drm/panel/Makefile ++++ b/drivers/gpu/drm/panel/Makefile +@@ -5,6 +5,7 @@ obj-$(CONFIG_DRM_PANEL_INNOLUX_P079ZCA) += panel-innolux-p079zca.o + obj-$(CONFIG_DRM_PANEL_JDI_LT070ME05000) += panel-jdi-lt070me05000.o + obj-$(CONFIG_DRM_PANEL_LG_LG4573) += panel-lg-lg4573.o + obj-$(CONFIG_DRM_PANEL_PANASONIC_VVX10F034N00) += panel-panasonic-vvx10f034n00.o ++obj-$(CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN) += panel-raspberrypi-touchscreen.o + obj-$(CONFIG_DRM_PANEL_SAMSUNG_LD9040) += panel-samsung-ld9040.o + obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E3HA2) += panel-samsung-s6e3ha2.o + obj-$(CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0) += panel-samsung-s6e8aa0.o +diff --git a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c +new file mode 100644 +index 0000000000000000000000000000000000000000..1a536fe4d040f5fafe324baee110a6225dd0be08 +--- /dev/null ++++ b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c +@@ -0,0 +1,514 @@ ++/* ++ * Copyright © 2016 Broadcom ++ * ++ * 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. ++ * ++ * Portions of this file (derived from panel-simple.c) are: ++ * ++ * Copyright (C) 2013, NVIDIA Corporation. All rights reserved. ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a ++ * copy of this software and associated documentation files (the "Software"), ++ * to deal in the Software without restriction, including without limitation ++ * the rights to use, copy, modify, merge, publish, distribute, sub license, ++ * and/or sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice (including the ++ * next paragraph) shall be included in all copies or substantial portions ++ * of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++ * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL ++ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ++ * DEALINGS IN THE SOFTWARE. ++ */ ++ ++/** ++ * DOC: Raspberry Pi 7" touchscreen panel driver. ++ * ++ * The 7" touchscreen consists of a DPI LCD panel, a Toshiba ++ * TC358762XBG DSI-DPI bridge, and an I2C-connected Atmel ATTINY88-MUR ++ * controlling power management, the LCD PWM, and the touchscreen. ++ * ++ * This driver presents this device as a MIPI DSI panel to the DRM ++ * driver, and should expose the touchscreen as a HID device. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++ ++/* I2C registers of the Atmel microcontroller. */ ++enum REG_ADDR { ++ REG_ID = 0x80, ++ REG_PORTA, // BIT(2) for horizontal flip, BIT(3) for vertical flip ++ REG_PORTB, ++ REG_PORTC, ++ REG_PORTD, ++ REG_POWERON, ++ REG_PWM, ++ REG_DDRA, ++ REG_DDRB, ++ REG_DDRC, ++ REG_DDRD, ++ REG_TEST, ++ REG_WR_ADDRL, ++ REG_WR_ADDRH, ++ REG_READH, ++ REG_READL, ++ REG_WRITEH, ++ REG_WRITEL, ++ REG_ID2, ++}; ++ ++/* We only turn the PWM on or off, without varying values. */ ++#define RPI_TOUCHSCREEN_MAX_BRIGHTNESS 1 ++ ++/* DSI D-PHY Layer Registers */ ++#define D0W_DPHYCONTTX 0x0004 ++#define CLW_DPHYCONTRX 0x0020 ++#define D0W_DPHYCONTRX 0x0024 ++#define D1W_DPHYCONTRX 0x0028 ++#define COM_DPHYCONTRX 0x0038 ++#define CLW_CNTRL 0x0040 ++#define D0W_CNTRL 0x0044 ++#define D1W_CNTRL 0x0048 ++#define DFTMODE_CNTRL 0x0054 ++ ++/* DSI PPI Layer Registers */ ++#define PPI_STARTPPI 0x0104 ++#define PPI_BUSYPPI 0x0108 ++#define PPI_LINEINITCNT 0x0110 ++#define PPI_LPTXTIMECNT 0x0114 ++//#define PPI_LANEENABLE 0x0134 ++//#define PPI_TX_RX_TA 0x013C ++#define PPI_CLS_ATMR 0x0140 ++#define PPI_D0S_ATMR 0x0144 ++#define PPI_D1S_ATMR 0x0148 ++#define PPI_D0S_CLRSIPOCOUNT 0x0164 ++#define PPI_D1S_CLRSIPOCOUNT 0x0168 ++#define CLS_PRE 0x0180 ++#define D0S_PRE 0x0184 ++#define D1S_PRE 0x0188 ++#define CLS_PREP 0x01A0 ++#define D0S_PREP 0x01A4 ++#define D1S_PREP 0x01A8 ++#define CLS_ZERO 0x01C0 ++#define D0S_ZERO 0x01C4 ++#define D1S_ZERO 0x01C8 ++#define PPI_CLRFLG 0x01E0 ++#define PPI_CLRSIPO 0x01E4 ++#define HSTIMEOUT 0x01F0 ++#define HSTIMEOUTENABLE 0x01F4 ++ ++/* DSI Protocol Layer Registers */ ++#define DSI_STARTDSI 0x0204 ++#define DSI_BUSYDSI 0x0208 ++#define DSI_LANEENABLE 0x0210 ++# define DSI_LANEENABLE_CLOCK BIT(0) ++# define DSI_LANEENABLE_D0 BIT(1) ++# define DSI_LANEENABLE_D1 BIT(2) ++ ++#define DSI_LANESTATUS0 0x0214 ++#define DSI_LANESTATUS1 0x0218 ++#define DSI_INTSTATUS 0x0220 ++#define DSI_INTMASK 0x0224 ++#define DSI_INTCLR 0x0228 ++#define DSI_LPTXTO 0x0230 ++#define DSI_MODE 0x0260 ++#define DSI_PAYLOAD0 0x0268 ++#define DSI_PAYLOAD1 0x026C ++#define DSI_SHORTPKTDAT 0x0270 ++#define DSI_SHORTPKTREQ 0x0274 ++#define DSI_BTASTA 0x0278 ++#define DSI_BTACLR 0x027C ++ ++/* DSI General Registers */ ++#define DSIERRCNT 0x0300 ++#define DSISIGMOD 0x0304 ++ ++/* DSI Application Layer Registers */ ++#define APLCTRL 0x0400 ++#define APLSTAT 0x0404 ++#define APLERR 0x0408 ++#define PWRMOD 0x040C ++#define RDPKTLN 0x0410 ++#define PXLFMT 0x0414 ++#define MEMWRCMD 0x0418 ++ ++/* LCDC/DPI Host Registers */ ++#define LCDCTRL 0x0420 ++#define HSR 0x0424 ++#define HDISPR 0x0428 ++#define VSR 0x042C ++#define VDISPR 0x0430 ++#define VFUEN 0x0434 ++ ++/* DBI-B Host Registers */ ++#define DBIBCTRL 0x0440 ++ ++/* SPI Master Registers */ ++#define SPICMR 0x0450 ++#define SPITCR 0x0454 ++ ++/* System Controller Registers */ ++#define SYSSTAT 0x0460 ++#define SYSCTRL 0x0464 ++#define SYSPLL1 0x0468 ++#define SYSPLL2 0x046C ++#define SYSPLL3 0x0470 ++#define SYSPMCTRL 0x047C ++ ++/* GPIO Registers */ ++#define GPIOC 0x0480 ++#define GPIOO 0x0484 ++#define GPIOI 0x0488 ++ ++/* I2C Registers */ ++#define I2CCLKCTRL 0x0490 ++ ++/* Chip/Rev Registers */ ++#define IDREG 0x04A0 ++ ++/* Debug Registers */ ++#define WCMDQUEUE 0x0500 ++#define RCMDQUEUE 0x0504 ++ ++struct rpi_touchscreen { ++ struct drm_panel base; ++ struct mipi_dsi_device *dsi; ++ struct i2c_client *bridge_i2c; ++ ++ /* Version of the firmware on the bridge chip */ ++ int atmel_ver; ++}; ++ ++static const struct drm_display_mode rpi_touchscreen_modes[] = { ++ { ++ /* The DSI PLL can only integer divide from the 2Ghz ++ * PLLD, giving us few choices. We pick a divide by 3 ++ * as our DSI HS clock, giving us a pixel clock of ++ * that divided by 24 bits. Pad out HFP to get our ++ * panel to refresh at 60Hz, even if that doesn't ++ * match the datasheet. ++ */ ++#define PIXEL_CLOCK ((2000000000 / 3) / 24) ++#define VREFRESH 60 ++#define VTOTAL (480 + 7 + 2 + 21) ++#define HACT 800 ++#define HSW 2 ++#define HBP 46 ++#define HFP ((PIXEL_CLOCK / (VTOTAL * VREFRESH)) - (HACT + HSW + HBP)) ++ ++ .clock = PIXEL_CLOCK / 1000, ++ .hdisplay = HACT, ++ .hsync_start = HACT + HFP, ++ .hsync_end = HACT + HFP + HSW, ++ .htotal = HACT + HFP + HSW + HBP, ++ .vdisplay = 480, ++ .vsync_start = 480 + 7, ++ .vsync_end = 480 + 7 + 2, ++ .vtotal = VTOTAL, ++ .vrefresh = 60, ++ }, ++}; ++ ++static struct rpi_touchscreen *panel_to_ts(struct drm_panel *panel) ++{ ++ return container_of(panel, struct rpi_touchscreen, base); ++} ++ ++static u8 rpi_touchscreen_i2c_read(struct rpi_touchscreen *ts, u8 reg) ++{ ++ return i2c_smbus_read_byte_data(ts->bridge_i2c, reg); ++} ++ ++static void rpi_touchscreen_i2c_write(struct rpi_touchscreen *ts, ++ u8 reg, u8 val) ++{ ++ int ret; ++ ++ ret = i2c_smbus_write_byte_data(ts->bridge_i2c, reg, val); ++ if (ret) ++ dev_err(&ts->dsi->dev, "I2C write failed: %d\n", ret); ++} ++ ++static int rpi_touchscreen_write(struct rpi_touchscreen *ts, u16 reg, u32 val) ++{ ++#if 0 ++ /* The firmware uses LP DSI transactions like this to bring up ++ * the hardware, which should be faster than using I2C to then ++ * pass to the Toshiba. However, I was unable to get it to ++ * work. ++ */ ++ u8 msg[] = { ++ reg, ++ reg >> 8, ++ val, ++ val >> 8, ++ val >> 16, ++ val >> 24, ++ }; ++ ++ mipi_dsi_dcs_write_buffer(ts->dsi, msg, sizeof(msg)); ++#else ++ rpi_touchscreen_i2c_write(ts, REG_WR_ADDRH, reg >> 8); ++ rpi_touchscreen_i2c_write(ts, REG_WR_ADDRL, reg); ++ rpi_touchscreen_i2c_write(ts, REG_WRITEH, val >> 8); ++ rpi_touchscreen_i2c_write(ts, REG_WRITEL, val); ++#endif ++ ++ return 0; ++} ++ ++static int rpi_touchscreen_disable(struct drm_panel *panel) ++{ ++ struct rpi_touchscreen *ts = panel_to_ts(panel); ++ ++ rpi_touchscreen_i2c_write(ts, REG_PWM, 0); ++ ++ rpi_touchscreen_i2c_write(ts, REG_POWERON, 0); ++ udelay(1); ++ ++ return 0; ++} ++ ++static int rpi_touchscreen_noop(struct drm_panel *panel) ++{ ++ return 0; ++} ++ ++static int rpi_touchscreen_enable(struct drm_panel *panel) ++{ ++ struct rpi_touchscreen *ts = panel_to_ts(panel); ++ int i; ++ ++ rpi_touchscreen_i2c_write(ts, REG_POWERON, 1); ++ /* Wait for nPWRDWN to go low to indicate poweron is done. */ ++ for (i = 0; i < 100; i++) { ++ if (rpi_touchscreen_i2c_read(ts, REG_PORTB) & 1) ++ break; ++ } ++ ++ rpi_touchscreen_write(ts, DSI_LANEENABLE, ++ DSI_LANEENABLE_CLOCK | ++ DSI_LANEENABLE_D0 | ++ (ts->dsi->lanes > 1 ? DSI_LANEENABLE_D1 : 0)); ++ rpi_touchscreen_write(ts, PPI_D0S_CLRSIPOCOUNT, 0x05); ++ rpi_touchscreen_write(ts, PPI_D1S_CLRSIPOCOUNT, 0x05); ++ rpi_touchscreen_write(ts, PPI_D0S_ATMR, 0x00); ++ rpi_touchscreen_write(ts, PPI_D1S_ATMR, 0x00); ++ rpi_touchscreen_write(ts, PPI_LPTXTIMECNT, 0x03); ++ ++ rpi_touchscreen_write(ts, SPICMR, 0x00); ++ rpi_touchscreen_write(ts, LCDCTRL, 0x00100150); ++ rpi_touchscreen_write(ts, SYSCTRL, 0x040f); ++ msleep(100); ++ ++ rpi_touchscreen_write(ts, PPI_STARTPPI, 0x01); ++ rpi_touchscreen_write(ts, DSI_STARTDSI, 0x01); ++ msleep(100); ++ ++ /* Turn on the backlight. */ ++ rpi_touchscreen_i2c_write(ts, REG_PWM, 255); ++ ++ /* Default to the same orientation as the closed source ++ * firmware used for the panel. Runtime rotation ++ * configuration will be supported using VC4's plane ++ * orientation bits. ++ */ ++ rpi_touchscreen_i2c_write(ts, REG_PORTA, BIT(2)); ++ ++ return 0; ++} ++ ++static int rpi_touchscreen_get_modes(struct drm_panel *panel) ++{ ++ struct drm_connector *connector = panel->connector; ++ struct drm_device *drm = panel->drm; ++ unsigned int i, num = 0; ++ ++ for (i = 0; i < ARRAY_SIZE(rpi_touchscreen_modes); i++) { ++ const struct drm_display_mode *m = &rpi_touchscreen_modes[i]; ++ struct drm_display_mode *mode; ++ ++ mode = drm_mode_duplicate(drm, m); ++ if (!mode) { ++ dev_err(drm->dev, "failed to add mode %ux%u@%u\n", ++ m->hdisplay, m->vdisplay, m->vrefresh); ++ continue; ++ } ++ ++ mode->type |= DRM_MODE_TYPE_DRIVER; ++ ++ if (i == 0) ++ mode->type |= DRM_MODE_TYPE_PREFERRED; ++ ++ drm_mode_set_name(mode); ++ ++ drm_mode_probed_add(connector, mode); ++ num++; ++ } ++ ++ connector->display_info.bpc = 8; ++ connector->display_info.width_mm = 154; ++ connector->display_info.height_mm = 86; ++ ++ return num; ++} ++ ++static const struct drm_panel_funcs rpi_touchscreen_funcs = { ++ .disable = rpi_touchscreen_disable, ++ .unprepare = rpi_touchscreen_noop, ++ .prepare = rpi_touchscreen_noop, ++ .enable = rpi_touchscreen_enable, ++ .get_modes = rpi_touchscreen_get_modes, ++}; ++ ++static struct i2c_client *rpi_touchscreen_get_i2c(struct device *dev, ++ const char *name) ++{ ++ struct device_node *node; ++ struct i2c_client *client; ++ ++ node = of_parse_phandle(dev->of_node, name, 0); ++ if (!node) ++ return ERR_PTR(-ENODEV); ++ ++ client = of_find_i2c_device_by_node(node); ++ ++ of_node_put(node); ++ ++ return client; ++} ++ ++static int rpi_touchscreen_dsi_probe(struct mipi_dsi_device *dsi) ++{ ++ struct device *dev = &dsi->dev; ++ struct rpi_touchscreen *ts; ++ int ret, ver; ++ ++ ts = devm_kzalloc(dev, sizeof(*ts), GFP_KERNEL); ++ if (!ts) ++ return -ENOMEM; ++ ++ dev_set_drvdata(dev, ts); ++ ++ ts->dsi = dsi; ++ dsi->mode_flags = (MIPI_DSI_MODE_VIDEO | ++ MIPI_DSI_MODE_VIDEO_SYNC_PULSE | ++ MIPI_DSI_MODE_LPM); ++ dsi->format = MIPI_DSI_FMT_RGB888; ++ dsi->lanes = 1; ++ ++ ts->bridge_i2c = ++ rpi_touchscreen_get_i2c(dev, "raspberrypi,touchscreen-bridge"); ++ if (IS_ERR(ts->bridge_i2c)) { ++ ret = -EPROBE_DEFER; ++ return ret; ++ } ++ ++ ver = rpi_touchscreen_i2c_read(ts, REG_ID); ++ if (ver < 0) { ++ dev_err(dev, "Atmel I2C read failed: %d\n", ver); ++ return -ENODEV; ++ } ++ ++ switch (ver) { ++ case 0xde: ++ ts->atmel_ver = 1; ++ break; ++ case 0xc3: ++ ts->atmel_ver = 2; ++ break; ++ default: ++ dev_err(dev, "Unknown Atmel firmware revision: 0x%02x\n", ver); ++ return -ENODEV; ++ } ++ ++ /* Turn off at boot, so we can cleanly sequence powering on. */ ++ rpi_touchscreen_i2c_write(ts, REG_POWERON, 0); ++ ++ drm_panel_init(&ts->base); ++ ts->base.dev = dev; ++ ts->base.funcs = &rpi_touchscreen_funcs; ++ ++ ret = drm_panel_add(&ts->base); ++ if (ret < 0) ++ goto err_release_bridge; ++ ++ return mipi_dsi_attach(dsi); ++ ++err_release_bridge: ++ put_device(&ts->bridge_i2c->dev); ++ return ret; ++} ++ ++static int rpi_touchscreen_dsi_remove(struct mipi_dsi_device *dsi) ++{ ++ struct device *dev = &dsi->dev; ++ struct rpi_touchscreen *ts = dev_get_drvdata(dev); ++ int ret; ++ ++ ret = mipi_dsi_detach(dsi); ++ if (ret < 0) { ++ dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", ret); ++ return ret; ++ } ++ ++ drm_panel_detach(&ts->base); ++ drm_panel_remove(&ts->base); ++ ++ put_device(&ts->bridge_i2c->dev); ++ ++ return 0; ++} ++ ++static void rpi_touchscreen_dsi_shutdown(struct mipi_dsi_device *dsi) ++{ ++ struct device *dev = &dsi->dev; ++ struct rpi_touchscreen *ts = dev_get_drvdata(dev); ++ ++ rpi_touchscreen_i2c_write(ts, REG_POWERON, 0); ++} ++ ++static const struct of_device_id rpi_touchscreen_of_match[] = { ++ { .compatible = "raspberrypi,touchscreen" }, ++ { } /* sentinel */ ++}; ++MODULE_DEVICE_TABLE(of, rpi_touchscreen_of_match); ++ ++static struct mipi_dsi_driver rpi_touchscreen_driver = { ++ .driver = { ++ .name = "raspberrypi-touchscreen", ++ .of_match_table = rpi_touchscreen_of_match, ++ }, ++ .probe = rpi_touchscreen_dsi_probe, ++ .remove = rpi_touchscreen_dsi_remove, ++ .shutdown = rpi_touchscreen_dsi_shutdown, ++}; ++module_mipi_dsi_driver(rpi_touchscreen_driver); ++ ++MODULE_AUTHOR("Eric Anholt "); ++MODULE_DESCRIPTION("Raspberry Pi 7-inch touchscreen driver"); ++MODULE_LICENSE("GPL v2"); + +From 2ff53846107ee48879d56f77f8a12aac55665155 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Wed, 12 Apr 2017 17:52:56 -0700 +Subject: [PATCH 148/171] panel-raspberrypi-touchscreen: Fix NULL deref if + probe order goes wrong. + +If the i2c driver hadn't pobed before the panel driver probes, then +the client would be NULL but we were looking for an ERR_PTR in the +error case. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c +index 1a536fe4d040f5fafe324baee110a6225dd0be08..5d6bfd81b07a11a0cb407f4301d22931705fb8b1 100644 +--- a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c ++++ b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c +@@ -399,6 +399,9 @@ static struct i2c_client *rpi_touchscreen_get_i2c(struct device *dev, + + of_node_put(node); + ++ if (!client) ++ return ERR_PTR(-EPROBE_DEFER); ++ + return client; + } + + +From 3a087082a16a0dddba79fbdc396c6fa0f89a7f51 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Mon, 6 Mar 2017 12:17:16 -0800 +Subject: [PATCH 149/171] panel-raspberrypi-touchscreen: Round up clk rate to + fix DSI panel. + +Commit 488f9bc8e3def93e0baef53cee2026c2cb0d8956 slightly increased the +reported rate of PLLD, so the clk driver decided that PLLD/3/8 was now +higher than our requested pixel clock rate and rejected it in favor of +PLLD/4/8, which then ran the pixel clock way out of spec. + +By bumping the requested clock rate just slightly, we get back to +PLLD/3/8 like we wanted and the panel displays content again. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c +index 5d6bfd81b07a11a0cb407f4301d22931705fb8b1..b57b7ad9aa4c5048186e98553af59ec912973096 100644 +--- a/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c ++++ b/drivers/gpu/drm/panel/panel-raspberrypi-touchscreen.c +@@ -220,7 +220,12 @@ static const struct drm_display_mode rpi_touchscreen_modes[] = { + #define HBP 46 + #define HFP ((PIXEL_CLOCK / (VTOTAL * VREFRESH)) - (HACT + HSW + HBP)) + +- .clock = PIXEL_CLOCK / 1000, ++ /* Round up the pixel clock a bit (10khz), so that the ++ * "don't run things faster than the requested clock ++ * rate" rule of the clk driver doesn't reject the ++ * divide-by-3 mode due to rounding error. ++ */ ++ .clock = PIXEL_CLOCK / 1000 + 10, + .hdisplay = HACT, + .hsync_start = HACT + HFP, + .hsync_end = HACT + HFP + HSW, + +From 8619877476986e9a237f6db74c87908c33653534 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Thu, 2 Jun 2016 12:29:45 -0700 +Subject: [PATCH 150/171] BCM270X: Add the DSI panel to the defconfig. + +Signed-off-by: Eric Anholt +--- + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + arch/arm64/configs/bcmrpi3_defconfig | 2 ++ + 3 files changed, 4 insertions(+) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index b85cd24405f71287700cf521c058edfab08f4374..465d5e75ad0fbd6a7b3863e2337e0b619db3700a 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -842,6 +842,7 @@ CONFIG_DRM=m + CONFIG_DRM_LOAD_EDID_FIRMWARE=y + CONFIG_DRM_UDL=m + CONFIG_DRM_PANEL_SIMPLE=m ++CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN=m + CONFIG_DRM_VC4=m + CONFIG_DRM_TINYDRM=m + CONFIG_TINYDRM_MI0283QT=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 7f0f669ed33a927194932e362969db0c25a65a5c..73cacf051f69686416814c21823e8292b9c4c1b4 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -835,6 +835,7 @@ CONFIG_DRM=m + CONFIG_DRM_LOAD_EDID_FIRMWARE=y + CONFIG_DRM_UDL=m + CONFIG_DRM_PANEL_SIMPLE=m ++CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN=m + CONFIG_DRM_VC4=m + CONFIG_DRM_TINYDRM=m + CONFIG_TINYDRM_MI0283QT=m +diff --git a/arch/arm64/configs/bcmrpi3_defconfig b/arch/arm64/configs/bcmrpi3_defconfig +index 9dcb58a519d041fadae99c81a7bda621b2a49f12..003209bf2362c2a136ab987b2f20065e9fa81b43 100644 +--- a/arch/arm64/configs/bcmrpi3_defconfig ++++ b/arch/arm64/configs/bcmrpi3_defconfig +@@ -815,6 +815,8 @@ CONFIG_VIDEO_OV7640=m + CONFIG_VIDEO_MT9V011=m + CONFIG_DRM=m + CONFIG_DRM_LOAD_EDID_FIRMWARE=y ++CONFIG_DRM_PANEL_SIMPLE=m ++CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN=m + CONFIG_DRM_UDL=m + CONFIG_DRM_VC4=m + CONFIG_FB=y + +From 86467015605cb6e2fc2cc265f0349d3e09924441 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Thu, 6 Jul 2017 11:45:48 -0700 +Subject: [PATCH 151/171] drm/vc4: Add support for setting DPMS in firmwarekms. + +This ensures that the screen goes blank during DPMS (screensaver), +including the cursor. Planes don't necessarily get disabled during +CRTC disable, so we need to be careful to not leave them on or turn +them back on early. + +Signed-off-by: Eric Anholt +--- + drivers/gpu/drm/vc4/vc4_firmware_kms.c | 40 +++++++++++++++++++++++++++++++--- + 1 file changed, 37 insertions(+), 3 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_firmware_kms.c b/drivers/gpu/drm/vc4/vc4_firmware_kms.c +index d170775ccc985637ff018804f510a5003933c9ec..766f700417f7194d6b01fa1bc18dad40f116744b 100644 +--- a/drivers/gpu/drm/vc4/vc4_firmware_kms.c ++++ b/drivers/gpu/drm/vc4/vc4_firmware_kms.c +@@ -36,6 +36,8 @@ struct vc4_crtc { + struct drm_crtc base; + struct drm_encoder *encoder; + struct drm_connector *connector; ++ struct drm_plane *primary; ++ struct drm_plane *cursor; + void __iomem *regs; + + struct drm_pending_vblank_event *event; +@@ -124,8 +126,6 @@ static void vc4_primary_plane_atomic_update(struct drm_plane *plane, + u32 bpp = 32; + int ret; + +- vc4_plane_set_primary_blank(plane, false); +- + fbinfo->xres = state->crtc_w; + fbinfo->yres = state->crtc_h; + fbinfo->xres_virtual = state->crtc_w; +@@ -169,6 +169,12 @@ static void vc4_primary_plane_atomic_update(struct drm_plane *plane, + vc4_plane->fbinfo_bus_addr); + WARN_ON_ONCE(fbinfo->pitch != fb->pitches[0]); + WARN_ON_ONCE(fbinfo->base != bo->paddr + fb->offsets[0]); ++ ++ /* If the CRTC is on (or going to be on) and we're enabled, ++ * then unblank. Otherwise, stay blank until CRTC enable. ++ */ ++ if (state->crtc->state->active) ++ vc4_plane_set_primary_blank(plane, false); + } + + static void vc4_primary_plane_atomic_disable(struct drm_plane *plane, +@@ -186,7 +192,12 @@ static void vc4_cursor_plane_atomic_update(struct drm_plane *plane, + struct drm_framebuffer *fb = state->fb; + struct drm_gem_cma_object *bo = drm_fb_cma_get_gem_obj(fb, 0); + int ret; +- u32 packet_state[] = { true, state->crtc_x, state->crtc_y, 0 }; ++ u32 packet_state[] = { ++ state->crtc->state->active, ++ state->crtc_x, ++ state->crtc_y, ++ 0 ++ }; + u32 packet_info[] = { state->crtc_w, state->crtc_h, + 0, /* unused */ + bo->paddr + fb->offsets[0], +@@ -329,10 +340,30 @@ static void vc4_crtc_mode_set_nofb(struct drm_crtc *crtc) + + static void vc4_crtc_disable(struct drm_crtc *crtc, struct drm_crtc_state *old_state) + { ++ struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); ++ ++ /* Always turn the planes off on CRTC disable. In DRM, planes ++ * are enabled/disabled through the update/disable hooks ++ * above, and the CRTC enable/disable independently controls ++ * whether anything scans out at all, but the firmware doesn't ++ * give us a CRTC-level control for that. ++ */ ++ vc4_cursor_plane_atomic_disable(vc4_crtc->cursor, ++ vc4_crtc->cursor->state); ++ vc4_plane_set_primary_blank(vc4_crtc->primary, true); + } + + static void vc4_crtc_enable(struct drm_crtc *crtc, struct drm_crtc_state *old_state) + { ++ struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); ++ ++ /* Unblank the planes (if they're supposed to be displayed). */ ++ if (vc4_crtc->primary->state->fb) ++ vc4_plane_set_primary_blank(vc4_crtc->primary, false); ++ if (vc4_crtc->cursor->state->fb) { ++ vc4_cursor_plane_atomic_update(vc4_crtc->cursor, ++ vc4_crtc->cursor->state); ++ } + } + + static int vc4_crtc_atomic_check(struct drm_crtc *crtc, +@@ -626,6 +657,9 @@ static int vc4_fkms_bind(struct device *dev, struct device *master, void *data) + primary_plane->crtc = crtc; + cursor_plane->crtc = crtc; + ++ vc4_crtc->primary = primary_plane; ++ vc4_crtc->cursor = cursor_plane; ++ + vc4_encoder = devm_kzalloc(dev, sizeof(*vc4_encoder), GFP_KERNEL); + if (!vc4_encoder) + return -ENOMEM; + +From 1657e1acfe125caa4fd0bdd763c9d401606fe53c Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Fri, 14 Jul 2017 17:33:08 -0700 +Subject: [PATCH 152/171] drm/vc4: Fix pitch setup for T-format scanout. + +The documentation said to use src_w here, and I didn't consider that +we actually needed to be using pitch somewhere in our setup. Fixes +scanout on my DSI panel when X11 does initial setup with 1920x1080 +HDMI and 800x480 DSI both at 0,0 of the same framebuffer. + +Signed-off-by: Eric Anholt +Fixes: 98830d91da08 ("drm/vc4: Add T-format scanout support.") +--- + drivers/gpu/drm/vc4/vc4_plane.c | 20 +++++++++++++++----- + 1 file changed, 15 insertions(+), 5 deletions(-) + +diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c +index 2968b3ebb895714cb8c8faeaf40dff1c996f2259..4ad0b9fcae99f74fb89d09dd52d9ffe5be123e45 100644 +--- a/drivers/gpu/drm/vc4/vc4_plane.c ++++ b/drivers/gpu/drm/vc4/vc4_plane.c +@@ -547,14 +547,24 @@ static int vc4_plane_mode_set(struct drm_plane *plane, + tiling = SCALER_CTL0_TILING_LINEAR; + pitch0 = VC4_SET_FIELD(fb->pitches[0], SCALER_SRC_PITCH); + break; +- case DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED: ++ ++ case DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED: { ++ /* For T-tiled, the FB pitch is "how many bytes from ++ * one row to the next, such that pitch * tile_h == ++ * tile_size * tiles_per_row." ++ */ ++ u32 tile_size_shift = 12; ++ u32 tile_h_shift = 5; ++ u32 tiles_w = fb->pitches[0] >> (tile_size_shift - tile_h_shift); ++ + tiling = SCALER_CTL0_TILING_256B_OR_T; + +- pitch0 = (VC4_SET_FIELD(0, SCALER_PITCH0_TILE_Y_OFFSET), +- VC4_SET_FIELD(0, SCALER_PITCH0_TILE_WIDTH_L), +- VC4_SET_FIELD((vc4_state->src_w[0] + 31) >> 5, +- SCALER_PITCH0_TILE_WIDTH_R)); ++ pitch0 = (VC4_SET_FIELD(0, SCALER_PITCH0_TILE_Y_OFFSET) | ++ VC4_SET_FIELD(0, SCALER_PITCH0_TILE_WIDTH_L) | ++ VC4_SET_FIELD(tiles_w, SCALER_PITCH0_TILE_WIDTH_R)); + break; ++ } ++ + default: + DRM_DEBUG_KMS("Unsupported FB tiling flag 0x%16llx", + (long long)fb->modifier); + +From 048e84d706d1d87a29af0ebf8be7d2749f7c480a Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 15 Aug 2017 16:48:46 +0100 +Subject: [PATCH 153/171] config: Enable CONFIG_BRCMDBG temporarily for + debugging + +--- + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 465d5e75ad0fbd6a7b3863e2337e0b619db3700a..185753f21ce8fc7ccbb42d7b159cb3ce9909e959 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -521,6 +521,7 @@ CONFIG_B43=m + CONFIG_B43LEGACY=m + CONFIG_BRCMFMAC=m + CONFIG_BRCMFMAC_USB=y ++CONFIG_BRCMDBG=y + CONFIG_HOSTAP=m + CONFIG_P54_COMMON=m + CONFIG_P54_USB=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 73cacf051f69686416814c21823e8292b9c4c1b4..f27a367b6be0b4af0d44b6fcaaaeca6c824c2da9 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -516,6 +516,7 @@ CONFIG_B43=m + CONFIG_B43LEGACY=m + CONFIG_BRCMFMAC=m + CONFIG_BRCMFMAC_USB=y ++CONFIG_BRCMDBG=y + CONFIG_HOSTAP=m + CONFIG_P54_COMMON=m + CONFIG_P54_USB=m + +From 8d9b1bfa454ce0b9ffff85c432868a04fd2272bb Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Thu, 24 Aug 2017 16:16:16 +0100 +Subject: [PATCH 154/171] brcmfmac: Disable ARP offloading when promiscuous + +This is a test patch for brcmfmac from Franky Lin at Broadcom to disable +ARP offloading when in promiscuous mode, re-enabling the ability to +sniff ARP packets over WiFi. + +See: https://github.com/raspberrypi/linux/issues/2171 + +Signed-off-by: Phil Elwell +--- + .../broadcom/brcm80211/brcmfmac/cfg80211.c | 41 ---------------------- + .../wireless/broadcom/brcm80211/brcmfmac/core.c | 39 ++++++++++++++++++++ + .../wireless/broadcom/brcm80211/brcmfmac/core.h | 1 + + 3 files changed, 40 insertions(+), 41 deletions(-) + +diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +index e417454f5d6ec136cda29e65af5449f2f89cba92..660839f6cea13b65e969bd76cbc7ec7b42a4c8c0 100644 +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +@@ -472,47 +472,6 @@ send_key_to_dongle(struct brcmf_if *ifp, struct brcmf_wsec_key *key) + return err; + } + +-static s32 +-brcmf_configure_arp_nd_offload(struct brcmf_if *ifp, bool enable) +-{ +- s32 err; +- u32 mode; +- +- if (enable) +- mode = BRCMF_ARP_OL_AGENT | BRCMF_ARP_OL_PEER_AUTO_REPLY; +- else +- mode = 0; +- +- /* Try to set and enable ARP offload feature, this may fail, then it */ +- /* is simply not supported and err 0 will be returned */ +- err = brcmf_fil_iovar_int_set(ifp, "arp_ol", mode); +- if (err) { +- brcmf_dbg(TRACE, "failed to set ARP offload mode to 0x%x, err = %d\n", +- mode, err); +- err = 0; +- } else { +- err = brcmf_fil_iovar_int_set(ifp, "arpoe", enable); +- if (err) { +- brcmf_dbg(TRACE, "failed to configure (%d) ARP offload err = %d\n", +- enable, err); +- err = 0; +- } else +- brcmf_dbg(TRACE, "successfully configured (%d) ARP offload to 0x%x\n", +- enable, mode); +- } +- +- err = brcmf_fil_iovar_int_set(ifp, "ndoe", enable); +- if (err) { +- brcmf_dbg(TRACE, "failed to configure (%d) ND offload err = %d\n", +- enable, err); +- err = 0; +- } else +- brcmf_dbg(TRACE, "successfully configured (%d) ND offload to 0x%x\n", +- enable, mode); +- +- return err; +-} +- + static void + brcmf_cfg80211_update_proto_addr_mode(struct wireless_dev *wdev) + { +diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +index 5cc3a07dda9e6acf202ba29a1f0a420814c4a96d..9763ff4f7ddc200241cc3e66c67d9703c0cc6a94 100644 +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +@@ -71,6 +71,43 @@ struct brcmf_if *brcmf_get_ifp(struct brcmf_pub *drvr, int ifidx) + return ifp; + } + ++void brcmf_configure_arp_nd_offload(struct brcmf_if *ifp, bool enable) ++{ ++ s32 err; ++ u32 mode; ++ ++ if (enable) ++ mode = BRCMF_ARP_OL_AGENT | BRCMF_ARP_OL_PEER_AUTO_REPLY; ++ else ++ mode = 0; ++ ++ /* Try to set and enable ARP offload feature, this may fail, then it */ ++ /* is simply not supported and err 0 will be returned */ ++ err = brcmf_fil_iovar_int_set(ifp, "arp_ol", mode); ++ if (err) { ++ brcmf_dbg(TRACE, "failed to set ARP offload mode to 0x%x, err = %d\n", ++ mode, err); ++ err = 0; ++ } else { ++ err = brcmf_fil_iovar_int_set(ifp, "arpoe", enable); ++ if (err) { ++ brcmf_dbg(TRACE, "failed to configure (%d) ARP offload err = %d\n", ++ enable, err); ++ err = 0; ++ } else ++ brcmf_dbg(TRACE, "successfully configured (%d) ARP offload to 0x%x\n", ++ enable, mode); ++ } ++ ++ err = brcmf_fil_iovar_int_set(ifp, "ndoe", enable); ++ if (err) ++ brcmf_dbg(TRACE, "failed to configure (%d) ND offload err = %d\n", ++ enable, err); ++ else ++ brcmf_dbg(TRACE, "successfully configured (%d) ND offload to 0x%x\n", ++ enable, mode); ++} ++ + static void _brcmf_set_multicast_list(struct work_struct *work) + { + struct brcmf_if *ifp; +@@ -134,6 +171,8 @@ static void _brcmf_set_multicast_list(struct work_struct *work) + if (err < 0) + brcmf_err("Setting BRCMF_C_SET_PROMISC failed, %d\n", + err); ++ ++ brcmf_configure_arp_nd_offload(ifp, !cmd_value); + } + + #if IS_ENABLED(CONFIG_IPV6) +diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h +index a4dd313140f37dc1fbb6955e1148f48bccf22f44..b9a96cbc70f0865ee8c9cff3c61641443e41b7e7 100644 +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h +@@ -204,6 +204,7 @@ int brcmf_netdev_wait_pend8021x(struct brcmf_if *ifp); + char *brcmf_ifname(struct brcmf_if *ifp); + struct brcmf_if *brcmf_get_ifp(struct brcmf_pub *drvr, int ifidx); + int brcmf_net_attach(struct brcmf_if *ifp, bool rtnl_locked); ++void brcmf_configure_arp_nd_offload(struct brcmf_if *ifp, bool enable); + struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bsscfgidx, s32 ifidx, + bool is_p2pdev, const char *name, u8 *mac_addr); + void brcmf_remove_interface(struct brcmf_if *ifp, bool rtnl_locked); + +From 5719ced04d6f934304f11b2e36bde429c403eb1d Mon Sep 17 00:00:00 2001 +From: Kevin Cernekee +Date: Sat, 16 Sep 2017 21:08:22 -0700 +Subject: [PATCH 155/171] brcmfmac: Avoid possible out-of-bounds read + +In brcmf_p2p_notify_rx_mgmt_p2p_probereq(), chanspec is assigned before +the length of rxframe is validated. This could lead to uninitialized +data being accessed (but not printed). Since we already have a +perfectly good endian-swapped copy of rxframe->chanspec in ch.chspec, +and ch.chspec is not modified by decchspec(), avoid the extra +assignment and use ch.chspec in the debug print. + +Suggested-by: Mattias Nissler +Signed-off-by: Kevin Cernekee +Reviewed-by: Arend van Spriel +--- + drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c +index 2ce675ab40ef867cf6a86ca5257a6db7ef76e80a..1c450c0727cb577f7dae25a1ce82b2db638b75b8 100644 +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c +@@ -1853,7 +1853,6 @@ s32 brcmf_p2p_notify_rx_mgmt_p2p_probereq(struct brcmf_if *ifp, + struct afx_hdl *afx_hdl = &p2p->afx_hdl; + struct brcmf_cfg80211_vif *vif = ifp->vif; + struct brcmf_rx_mgmt_data *rxframe = (struct brcmf_rx_mgmt_data *)data; +- u16 chanspec = be16_to_cpu(rxframe->chanspec); + struct brcmu_chan ch; + u8 *mgmt_frame; + u32 mgmt_frame_len; +@@ -1906,7 +1905,7 @@ s32 brcmf_p2p_notify_rx_mgmt_p2p_probereq(struct brcmf_if *ifp, + cfg80211_rx_mgmt(&vif->wdev, freq, 0, mgmt_frame, mgmt_frame_len, 0); + + brcmf_dbg(INFO, "mgmt_frame_len (%d) , e->datalen (%d), chanspec (%04x), freq (%d)\n", +- mgmt_frame_len, e->datalen, chanspec, freq); ++ mgmt_frame_len, e->datalen, ch.chspec, freq); + + return 0; + } + +From bed1416b6dd522d2522d769acf43efd4968214d8 Mon Sep 17 00:00:00 2001 +From: Kevin Cernekee +Date: Sat, 16 Sep 2017 21:08:23 -0700 +Subject: [PATCH 156/171] brcmfmac: Delete redundant length check + +brcmf_fweh_process_event() sets event->datalen to the +endian-swapped value of event_packet->msg.datalen, which is the +same as emsg.datalen. This length is already validated in +brcmf_fweh_process_event(), so there is no need to check it +again upon dequeuing the event. + +Suggested-by: Arend van Spriel +Signed-off-by: Kevin Cernekee +--- + drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c | 5 ----- + 1 file changed, 5 deletions(-) + +diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c +index ef72baf6dd969c2478a2138ea57b9f691fdf12d8..e7eaa57d11d98f61280bd99013e649aacec7d0d6 100644 +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c +@@ -257,11 +257,6 @@ static void brcmf_fweh_event_worker(struct work_struct *work) + brcmf_dbg_hex_dump(BRCMF_EVENT_ON(), event->data, + min_t(u32, emsg.datalen, 64), + "event payload, len=%d\n", emsg.datalen); +- if (emsg.datalen > event->datalen) { +- brcmf_err("event invalid length header=%d, msg=%d\n", +- event->datalen, emsg.datalen); +- goto event_free; +- } + + /* special handling of interface event */ + if (event->code == BRCMF_E_IF) { + +From 077d698af96b03efc52f0eb772a7d05b060ff045 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Mon, 13 Nov 2017 13:00:14 +0000 +Subject: [PATCH 157/171] USB_DWCOTG: Disable building dwc_otg as a module + (#2265) + +When dwc_otg is built as a module, build will fail with the following +error: + +ERROR: "DWC_TASK_HI_SCHEDULE" [drivers/usb/host/dwc_otg/dwc_otg.ko] undefined! +scripts/Makefile.modpost:91: recipe for target '__modpost' failed +make[1]: *** [__modpost] Error 1 +Makefile:1199: recipe for target 'modules' failed +make: *** [modules] Error 2 + +Even if the error is solved by including the missing +DWC_TASK_HI_SCHEDULE function, the kernel will panic when loading +dwc_otg. + +As a workaround, simply prevent user from building dwc_otg as a module +as the current kernel does not support it. + +See: https://github.com/raspberrypi/linux/issues/2258 + +Signed-off-by: Malik Olivier Boussejra +--- + drivers/usb/host/Kconfig | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig +index 64ed87af62b3d38db663cc77978b024d0f020f65..9eeb88a5b6e6b4e728d18abf6175ef19986c6bdc 100644 +--- a/drivers/usb/host/Kconfig ++++ b/drivers/usb/host/Kconfig +@@ -772,7 +772,7 @@ config USB_HWA_HCD + will be called "hwa-hc". + + config USB_DWCOTG +- tristate "Synopsis DWC host support" ++ bool "Synopsis DWC host support" + depends on USB && (FIQ || ARM64) + help + The Synopsis DWC controller is a dual-role +@@ -781,9 +781,6 @@ config USB_DWCOTG + Enable this option to support this IP in host controller mode. + If unsure, say N. + +- To compile this driver as a module, choose M here: the +- modules built will be called dwc_otg and dwc_common_port. +- + config USB_IMX21_HCD + tristate "i.MX21 HCD support" + depends on ARM && ARCH_MXC + +From 880bd353def3c18ab75463bf042fb59ec9020e6f Mon Sep 17 00:00:00 2001 +From: allocom +Date: Thu, 27 Jul 2017 23:49:36 +0530 +Subject: [PATCH 158/171] allo-piano-dac-plus: Master volume added + fixes + +Master volume added, which controls both DACs volumes. + +See: https://github.com/raspberrypi/linux/pull/2149 + +Also fix initial max volume, default mode value, and unmute. + +Signed-off-by: allocom +--- + sound/soc/bcm/allo-piano-dac-plus.c | 303 ++++++++++++++++++++++++++++++------ + 1 file changed, 256 insertions(+), 47 deletions(-) + +diff --git a/sound/soc/bcm/allo-piano-dac-plus.c b/sound/soc/bcm/allo-piano-dac-plus.c +index d4e99e3c6a383d92fb0cf9e8c1cd1e7657358d49..1800f5e4d414e2d83a9487a89a2800a3e1ec01b1 100644 +--- a/sound/soc/bcm/allo-piano-dac-plus.c ++++ b/sound/soc/bcm/allo-piano-dac-plus.c +@@ -28,6 +28,13 @@ + #include + #include "../codecs/pcm512x.h" + ++#define P_DAC_LEFT_MUTE 0x10 ++#define P_DAC_RIGHT_MUTE 0x01 ++#define P_DAC_MUTE 0x11 ++#define P_DAC_UNMUTE 0x00 ++#define P_MUTE 1 ++#define P_UNMUTE 0 ++ + struct dsp_code { + char i2c_addr; + char offset; +@@ -111,7 +118,7 @@ static int __snd_allo_piano_dsp_program(struct snd_soc_pcm_runtime *rtd, + rate = 192000; + + if (lowpass > 14) +- glb_ptr->set_lowpass = lowpass = 3; ++ glb_ptr->set_lowpass = lowpass = 0; + + if (mode > 3) + glb_ptr->set_mode = mode = 0; +@@ -129,16 +136,20 @@ static int __snd_allo_piano_dsp_program(struct snd_soc_pcm_runtime *rtd, + return 1; + + case 1: /* 2.0 */ +- snd_soc_write(rtd->codec_dais[0]->codec, PCM512x_MUTE, 0x00); +- snd_soc_write(rtd->codec_dais[1]->codec, PCM512x_MUTE, 0x11); ++ snd_soc_write(rtd->codec_dais[0]->codec, ++ PCM512x_MUTE, P_DAC_UNMUTE); ++ snd_soc_write(rtd->codec_dais[1]->codec, ++ PCM512x_MUTE, P_DAC_MUTE); + glb_ptr->set_rate = rate; + glb_ptr->set_mode = mode; + glb_ptr->set_lowpass = lowpass; + return 1; + + default: +- snd_soc_write(rtd->codec_dais[0]->codec, PCM512x_MUTE, 0x00); +- snd_soc_write(rtd->codec_dais[1]->codec, PCM512x_MUTE, 0x00); ++ snd_soc_write(rtd->codec_dais[0]->codec, ++ PCM512x_MUTE, P_DAC_UNMUTE); ++ snd_soc_write(rtd->codec_dais[1]->codec, ++ PCM512x_MUTE, P_DAC_UNMUTE); + } + + for (dac = 0; dac < rtd->num_codecs; dac++) { +@@ -173,8 +184,8 @@ static int __snd_allo_piano_dsp_program(struct snd_soc_pcm_runtime *rtd, + if (dsp_code_read->offset == 0) { + 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); ++ PCM512x_PAGE_BASE(0), ++ dsp_code_read->val); + + } else if (dsp_code_read->offset != 0) { + ret = snd_soc_write(rtd->codec_dais[dac]->codec, +@@ -211,8 +222,8 @@ static int snd_allo_piano_dsp_program(struct snd_soc_pcm_runtime *rtd, + + mutex_lock(&glb_ptr->lock); + +- ret = __snd_allo_piano_dsp_program(rtd, +- mode, rate, lowpass); ++ ret = __snd_allo_piano_dsp_program(rtd, mode, rate, lowpass); ++ + mutex_unlock(&glb_ptr->lock); + + return ret; +@@ -238,28 +249,32 @@ static int snd_allo_piano_dual_mode_put(struct snd_kcontrol *kcontrol, + struct snd_card *snd_card_ptr = card->snd_card; + struct snd_kcontrol *kctl; + struct soc_mixer_control *mc; +- unsigned int left_val = 0; ++ unsigned int left_val = 0, right_val = 0; + + rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); + + if (ucontrol->value.integer.value[0] > 0) { + glb_ptr->dual_mode = ucontrol->value.integer.value[0]; + glb_ptr->set_mode = 0; +- } else if (ucontrol->value.integer.value[0] <= 0) { ++ } else { + if (glb_ptr->set_mode <= 0) { + glb_ptr->dual_mode = 1; + glb_ptr->set_mode = 0; ++ } else { ++ glb_ptr->dual_mode = 0; ++ return 0; + } +- } else { +- glb_ptr->dual_mode = 0; +- return 0; + } + +- if (glb_ptr->dual_mode == 1) { +- snd_soc_write(rtd->codec_dais[0]->codec, PCM512x_MUTE, 0x01); +- snd_soc_write(rtd->codec_dais[1]->codec, PCM512x_MUTE, 0x10); ++ if (glb_ptr->dual_mode == 1) { // Dual Mono ++ snd_soc_write(rtd->codec_dais[0]->codec, ++ PCM512x_MUTE, P_DAC_RIGHT_MUTE); ++ snd_soc_write(rtd->codec_dais[1]->codec, ++ PCM512x_MUTE, P_DAC_LEFT_MUTE); + snd_soc_write(rtd->codec_dais[0]->codec, + PCM512x_DIGITAL_VOLUME_3, 0xff); ++ snd_soc_write(rtd->codec_dais[1]->codec, ++ PCM512x_DIGITAL_VOLUME_2, 0xff); + + list_for_each_entry(kctl, &snd_card_ptr->controls, list) { + if (!strncmp(kctl->id.name, "Digital Playback Volume", +@@ -273,6 +288,9 @@ static int snd_allo_piano_dual_mode_put(struct snd_kcontrol *kcontrol, + } else { + left_val = snd_soc_read(rtd->codec_dais[0]->codec, + PCM512x_DIGITAL_VOLUME_2); ++ right_val = snd_soc_read(rtd->codec_dais[1]->codec, ++ PCM512x_DIGITAL_VOLUME_3); ++ + list_for_each_entry(kctl, &snd_card_ptr->controls, list) { + if (!strncmp(kctl->id.name, "Digital Playback Volume", + sizeof(kctl->id.name))) { +@@ -285,8 +303,12 @@ static int snd_allo_piano_dual_mode_put(struct snd_kcontrol *kcontrol, + + snd_soc_write(rtd->codec_dais[0]->codec, + PCM512x_DIGITAL_VOLUME_3, left_val); +- snd_soc_write(rtd->codec_dais[0]->codec, PCM512x_MUTE, 0x00); +- snd_soc_write(rtd->codec_dais[1]->codec, PCM512x_MUTE, 0x00); ++ snd_soc_write(rtd->codec_dais[1]->codec, ++ PCM512x_DIGITAL_VOLUME_2, right_val); ++ snd_soc_write(rtd->codec_dais[0]->codec, ++ PCM512x_MUTE, P_DAC_UNMUTE); ++ snd_soc_write(rtd->codec_dais[1]->codec, ++ PCM512x_MUTE, P_DAC_UNMUTE); + } + + return 0; +@@ -311,7 +333,7 @@ static int snd_allo_piano_mode_put(struct snd_kcontrol *kcontrol, + struct snd_card *snd_card_ptr = card->snd_card; + struct snd_kcontrol *kctl; + struct soc_mixer_control *mc; +- unsigned int left_val = 0; ++ unsigned int left_val = 0, right_val = 0; + + rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); + +@@ -319,6 +341,9 @@ static int snd_allo_piano_mode_put(struct snd_kcontrol *kcontrol, + (ucontrol->value.integer.value[0] > 0)) { + left_val = snd_soc_read(rtd->codec_dais[0]->codec, + PCM512x_DIGITAL_VOLUME_2); ++ right_val = snd_soc_read(rtd->codec_dais[1]->codec, ++ PCM512x_DIGITAL_VOLUME_2); ++ + list_for_each_entry(kctl, &snd_card_ptr->controls, list) { + if (!strncmp(kctl->id.name, "Digital Playback Volume", + sizeof(kctl->id.name))) { +@@ -330,6 +355,8 @@ static int snd_allo_piano_mode_put(struct snd_kcontrol *kcontrol, + } + snd_soc_write(rtd->codec_dais[0]->codec, + PCM512x_DIGITAL_VOLUME_3, left_val); ++ snd_soc_write(rtd->codec_dais[1]->codec, ++ PCM512x_DIGITAL_VOLUME_3, right_val); + } + + return(snd_allo_piano_dsp_program(rtd, +@@ -366,23 +393,29 @@ 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 glb_pool *glb_ptr = card->drvdata; + struct snd_soc_pcm_runtime *rtd; + unsigned int left_val = 0; + unsigned int right_val = 0; + + 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->codec_dais[1]->codec, + PCM512x_DIGITAL_VOLUME_3); + if (right_val < 0) + return right_val; + ++ if (glb_ptr->dual_mode != 1) { ++ left_val = snd_soc_read(rtd->codec_dais[1]->codec, ++ PCM512x_DIGITAL_VOLUME_2); ++ if (left_val < 0) ++ return left_val; ++ ++ } else { ++ left_val = right_val; ++ } ++ + ucontrol->value.integer.value[0] = +- (~(left_val >> mc->shift)) & mc->max; ++ (~(left_val >> mc->shift)) & mc->max; + ucontrol->value.integer.value[1] = + (~(right_val >> mc->shift)) & mc->max; + +@@ -395,16 +428,27 @@ 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 glb_pool *glb_ptr = card->drvdata; + 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; + + 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; ++ if (glb_ptr->dual_mode != 1) { ++ ret = snd_soc_write(rtd->codec_dais[1]->codec, ++ PCM512x_DIGITAL_VOLUME_2, (~left_val)); ++ if (ret < 0) ++ return ret; ++ } ++ ++ if (digital_gain_0db_limit) { ++ ret = snd_soc_limit_volume(card, "Subwoofer Playback Volume", ++ 207); ++ if (ret < 0) ++ dev_warn(card->dev, "Failed to set volume limit: %d\n", ++ ret); ++ } + + ret = snd_soc_write(rtd->codec_dais[1]->codec, + PCM512x_DIGITAL_VOLUME_3, (~right_val)); +@@ -426,8 +470,10 @@ static int pcm512x_get_reg_sub_switch(struct snd_kcontrol *kcontrol, + if (val < 0) + return val; + +- ucontrol->value.integer.value[0] = (val & 0x10) ? 0 : 1; +- ucontrol->value.integer.value[1] = (val & 0x01) ? 0 : 1; ++ ucontrol->value.integer.value[0] = ++ (val & P_DAC_LEFT_MUTE) ? P_UNMUTE : P_MUTE; ++ ucontrol->value.integer.value[1] = ++ (val & P_DAC_RIGHT_MUTE) ? P_UNMUTE : P_MUTE; + + return val; + } +@@ -437,21 +483,177 @@ static int pcm512x_set_reg_sub_switch(struct snd_kcontrol *kcontrol, + { + struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); + struct snd_soc_pcm_runtime *rtd; ++ struct glb_pool *glb_ptr = card->drvdata; + unsigned int left_val = (ucontrol->value.integer.value[0]); + unsigned int right_val = (ucontrol->value.integer.value[1]); + int ret = 0; + + 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 (glb_ptr->set_mode != 1) { ++ ret = snd_soc_write(rtd->codec_dais[1]->codec, PCM512x_MUTE, ++ ~((left_val & 0x01)<<4 | (right_val & 0x01))); ++ if (ret < 0) ++ return ret; ++ } ++ return 1; ++ ++} ++ ++static int pcm512x_get_reg_master(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ struct soc_mixer_control *mc = ++ (struct soc_mixer_control *)kcontrol->private_value; ++ struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); ++ struct glb_pool *glb_ptr = card->drvdata; ++ struct snd_soc_pcm_runtime *rtd; ++ unsigned int left_val = 0, right_val = 0; ++ ++ rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); ++ ++ left_val = snd_soc_read(rtd->codec_dais[0]->codec, ++ PCM512x_DIGITAL_VOLUME_2); ++ if (left_val < 0) ++ return left_val; ++ ++ if (glb_ptr->dual_mode == 1) { ++ right_val = snd_soc_read(rtd->codec_dais[1]->codec, ++ PCM512x_DIGITAL_VOLUME_3); ++ if (right_val < 0) ++ return right_val; ++ } else { ++ right_val = snd_soc_read(rtd->codec_dais[0]->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_master(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ struct soc_mixer_control *mc = ++ (struct soc_mixer_control *)kcontrol->private_value; ++ struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); ++ struct glb_pool *glb_ptr = card->drvdata; ++ 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; ++ ++ rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); ++ ++ if (digital_gain_0db_limit) { ++ ret = snd_soc_limit_volume(card, "Master Playback Volume", ++ 207); ++ if (ret < 0) ++ dev_warn(card->dev, "Failed to set volume limit: %d\n", ++ ret); ++ } ++ ++ if (glb_ptr->dual_mode != 1) { ++ 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->codec_dais[0]->codec, ++ PCM512x_DIGITAL_VOLUME_3, (~right_val)); ++ if (ret < 0) ++ return ret; ++ ++ } ++ ++ ret = snd_soc_write(rtd->codec_dais[1]->codec, ++ PCM512x_DIGITAL_VOLUME_3, (~right_val)); + if (ret < 0) + return ret; + ++ ret = snd_soc_write(rtd->codec_dais[0]->codec, ++ PCM512x_DIGITAL_VOLUME_2, (~left_val)); ++ if (ret < 0) ++ return ret; + return 1; ++} ++ ++static int pcm512x_get_reg_master_switch(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); ++ struct glb_pool *glb_ptr = card->drvdata; ++ struct snd_soc_pcm_runtime *rtd; ++ int val = 0; ++ ++ rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); ++ ++ val = snd_soc_read(rtd->codec_dais[0]->codec, PCM512x_MUTE); ++ if (val < 0) ++ return val; ++ ++ ucontrol->value.integer.value[0] = ++ (val & P_DAC_LEFT_MUTE) ? P_UNMUTE : P_MUTE; ++ ++ if (glb_ptr->dual_mode == 1) { ++ val = snd_soc_read(rtd->codec_dais[1]->codec, PCM512x_MUTE); ++ if (val < 0) ++ return val; ++ } ++ ucontrol->value.integer.value[1] = ++ (val & P_DAC_RIGHT_MUTE) ? P_UNMUTE : P_MUTE; ++ ++ return val; ++} ++ ++static int pcm512x_set_reg_master_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; ++ struct glb_pool *glb_ptr = card->drvdata; ++ unsigned int left_val = (ucontrol->value.integer.value[0]); ++ unsigned int right_val = (ucontrol->value.integer.value[1]); ++ int ret = 0; + ++ rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); ++ if (glb_ptr->dual_mode == 1) { ++ ret = snd_soc_write(rtd->codec_dais[0]->codec, PCM512x_MUTE, ++ ~((left_val & 0x01)<<4)); ++ if (ret < 0) ++ return ret; ++ ret = snd_soc_write(rtd->codec_dais[1]->codec, PCM512x_MUTE, ++ ~((right_val & 0x01))); ++ if (ret < 0) ++ return ret; ++ ++ } else if (glb_ptr->set_mode == 1) { ++ ret = snd_soc_write(rtd->codec_dais[0]->codec, PCM512x_MUTE, ++ ~((left_val & 0x01)<<4 | (right_val & 0x01))); ++ if (ret < 0) ++ return ret; ++ ++ } else { ++ ret = snd_soc_write(rtd->codec_dais[0]->codec, PCM512x_MUTE, ++ ~((left_val & 0x01)<<4 | (right_val & 0x01))); ++ if (ret < 0) ++ return ret; ++ ++ ret = snd_soc_write(rtd->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 DECLARE_TLV_DB_SCALE(digital_tlv_master, -10350, 50, 1); + + static const struct snd_kcontrol_new allo_piano_controls[] = { + SOC_ENUM_EXT("Subwoofer mode Route", +@@ -481,6 +683,20 @@ static const struct snd_kcontrol_new allo_piano_controls[] = { + PCM512x_RQMR_SHIFT, 1, 1, + pcm512x_get_reg_sub_switch, + pcm512x_set_reg_sub_switch), ++ ++ SOC_DOUBLE_R_EXT_TLV("Master Playback Volume", ++ PCM512x_DIGITAL_VOLUME_2, ++ PCM512x_DIGITAL_VOLUME_3, 0, 255, 1, ++ pcm512x_get_reg_master, ++ pcm512x_set_reg_master, ++ digital_tlv_master), ++ ++ SOC_DOUBLE_EXT("Master Playback Switch", ++ PCM512x_MUTE, ++ PCM512x_RQML_SHIFT, ++ PCM512x_RQMR_SHIFT, 1, 1, ++ pcm512x_get_reg_master_switch, ++ pcm512x_set_reg_master_switch), + }; + + static int snd_allo_piano_dac_init(struct snd_soc_pcm_runtime *rtd) +@@ -494,6 +710,8 @@ static int snd_allo_piano_dac_init(struct snd_soc_pcm_runtime *rtd) + + memset(glb_ptr, 0x00, sizeof(glb_ptr)); + card->drvdata = glb_ptr; ++ glb_ptr->dual_mode = 2; ++ glb_ptr->set_mode = 0; + + mutex_init(&glb_ptr->lock); + +@@ -506,26 +724,25 @@ static int snd_allo_piano_dac_init(struct snd_soc_pcm_runtime *rtd) + dev_warn(card->dev, "Failed to set volume limit: %d\n", + ret); + } +- + return 0; + } + + static void snd_allo_piano_gpio_mute(struct snd_soc_card *card) + { + if (mute_gpio[0]) +- gpiod_set_value_cansleep(mute_gpio[0], 1); ++ gpiod_set_value_cansleep(mute_gpio[0], P_MUTE); + + if (mute_gpio[1]) +- gpiod_set_value_cansleep(mute_gpio[1], 1); ++ gpiod_set_value_cansleep(mute_gpio[1], P_MUTE); + } + + static void snd_allo_piano_gpio_unmute(struct snd_soc_card *card) + { + if (mute_gpio[0]) +- gpiod_set_value_cansleep(mute_gpio[0], 0); ++ gpiod_set_value_cansleep(mute_gpio[0], P_UNMUTE); + + if (mute_gpio[1]) +- gpiod_set_value_cansleep(mute_gpio[1], 0); ++ gpiod_set_value_cansleep(mute_gpio[1], P_UNMUTE); + } + + static int snd_allo_piano_set_bias_level(struct snd_soc_card *card, +@@ -617,14 +834,6 @@ static int snd_allo_piano_dac_hw_params( + } + } + +- if (digital_gain_0db_limit) { +- ret = snd_soc_limit_volume(card, +- "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, glb_ptr->set_mode, rate, + glb_ptr->set_lowpass); + if (ret < 0) + +From a62835edb9861d48bf5e0c0b5e8f2ef2090df7ce Mon Sep 17 00:00:00 2001 +From: allocom +Date: Sat, 5 Aug 2017 11:27:07 +0530 +Subject: [PATCH 159/171] allo-digione: 192kHz clicking sound fix + +See: https://github.com/raspberrypi/linux/pull/2149 +--- + sound/soc/bcm/allo-digione.c | 113 +++++++++++++++++++++---------------------- + 1 file changed, 55 insertions(+), 58 deletions(-) + +diff --git a/sound/soc/bcm/allo-digione.c b/sound/soc/bcm/allo-digione.c +index e3664e44c699d0102120ecf99e8b780a4505ebad..9387b055875fdf92a13dc4a9d2727f959dd0f2f9 100644 +--- a/sound/soc/bcm/allo-digione.c ++++ b/sound/soc/bcm/allo-digione.c +@@ -28,7 +28,7 @@ + + #include "../codecs/wm8804.h" + +-static short int auto_shutdown_output = 0; ++static short int auto_shutdown_output; + module_param(auto_shutdown_output, short, + S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP); + MODULE_PARM_DESC(auto_shutdown_output, "Shutdown SP/DIF output if playback is stopped"); +@@ -75,6 +75,7 @@ static int snd_allo_digione_startup(struct snd_pcm_substream *substream) + /* turn on digital output */ + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_codec *codec = rtd->codec; ++ + snd_soc_update_bits(codec, WM8804_PWRDN, 0x3c, 0x00); + return 0; + } +@@ -86,6 +87,7 @@ static void snd_allo_digione_shutdown(struct snd_pcm_substream *substream) + /* turn off output */ + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_codec *codec = rtd->codec; ++ + snd_soc_update_bits(codec, WM8804_PWRDN, 0x3c, 0x3c); + } + } +@@ -107,43 +109,37 @@ static int snd_allo_digione_hw_params(struct snd_pcm_substream *substream, + int ret; + + samplerate = params_rate(params); +- +- if (samplerate <= 96000) { +- mclk_freq = samplerate * 256; +- mclk_div = WM8804_MCLKDIV_256FS; +- } else { +- mclk_freq = samplerate * 128; +- mclk_div = WM8804_MCLKDIV_128FS; +- } ++ mclk_freq = samplerate * 256; ++ mclk_div = WM8804_MCLKDIV_256FS; + + sysclk = snd_allo_digione_enable_clock(samplerate); +- ++ + switch (samplerate) { +- case 32000: +- sampling_freq=0x03; +- break; +- case 44100: +- sampling_freq=0x00; +- break; +- case 48000: +- sampling_freq=0x02; +- break; +- case 88200: +- sampling_freq=0x08; +- break; +- case 96000: +- sampling_freq=0x0a; +- break; +- case 176400: +- sampling_freq=0x0c; +- break; +- case 192000: +- sampling_freq=0x0e; +- break; +- default: +- dev_err(codec->dev, +- "Failed to set WM8804 SYSCLK, unsupported samplerate %d\n", +- samplerate); ++ case 32000: ++ sampling_freq = 0x03; ++ break; ++ case 44100: ++ sampling_freq = 0x00; ++ break; ++ case 48000: ++ sampling_freq = 0x02; ++ break; ++ case 88200: ++ sampling_freq = 0x08; ++ break; ++ case 96000: ++ sampling_freq = 0x0a; ++ break; ++ case 176400: ++ sampling_freq = 0x0c; ++ break; ++ case 192000: ++ sampling_freq = 0x0e; ++ break; ++ default: ++ dev_err(codec->dev, ++ "Failed to set WM8804 SYSCLK, unsupported samplerate %d\n", ++ samplerate); + } + + snd_soc_dai_set_clkdiv(codec_dai, WM8804_MCLK_DIV, mclk_div); +@@ -173,8 +169,8 @@ static int snd_allo_digione_hw_params(struct snd_pcm_substream *substream, + /* machine stream operations */ + static struct snd_soc_ops snd_allo_digione_ops = { + .hw_params = snd_allo_digione_hw_params, +- .startup = snd_allo_digione_startup, +- .shutdown = snd_allo_digione_shutdown, ++ .startup = snd_allo_digione_startup, ++ .shutdown = snd_allo_digione_shutdown, + }; + + static struct snd_soc_dai_link snd_allo_digione_dai[] = { +@@ -209,27 +205,28 @@ static int snd_allo_digione_probe(struct platform_device *pdev) + snd_allo_digione.dev = &pdev->dev; + + if (pdev->dev.of_node) { +- struct device_node *i2s_node; +- struct snd_soc_dai_link *dai = &snd_allo_digione_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; +- } +- +- snd_allo_clk44gpio = +- devm_gpiod_get(&pdev->dev, "clock44", GPIOD_OUT_LOW); +- if (IS_ERR(snd_allo_clk44gpio)) +- dev_err(&pdev->dev, "devm_gpiod_get() failed\n"); +- +- snd_allo_clk48gpio = +- devm_gpiod_get(&pdev->dev, "clock48", GPIOD_OUT_LOW); +- if (IS_ERR(snd_allo_clk48gpio)) +- dev_err(&pdev->dev, "devm_gpiod_get() failed\n"); ++ struct device_node *i2s_node; ++ struct snd_soc_dai_link *dai = &snd_allo_digione_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; ++ } ++ ++ snd_allo_clk44gpio = ++ devm_gpiod_get(&pdev->dev, "clock44", GPIOD_OUT_LOW); ++ if (IS_ERR(snd_allo_clk44gpio)) ++ dev_err(&pdev->dev, "devm_gpiod_get() failed\n"); ++ ++ snd_allo_clk48gpio = ++ devm_gpiod_get(&pdev->dev, "clock48", GPIOD_OUT_LOW); ++ if (IS_ERR(snd_allo_clk48gpio)) ++ dev_err(&pdev->dev, "devm_gpiod_get() failed\n"); + } + + ret = snd_soc_register_card(&snd_allo_digione); + +From 986c5e9858d06aac3fd36f2cca9041a60a4ace32 Mon Sep 17 00:00:00 2001 +From: Daniel Matuschek +Date: Tue, 17 Oct 2017 10:30:28 +0200 +Subject: [PATCH 160/171] Fixed a bug when using 352.8kHz sample rate + +Signed-off-by: Daniel Matuschek +--- + sound/soc/bcm/hifiberry_dacplus.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sound/soc/bcm/hifiberry_dacplus.c b/sound/soc/bcm/hifiberry_dacplus.c +index b7b401cbe2b0d510d8b12d2dda6d5ff1fff42eb0..16697dd6c6db6856022731a07a9a1653dd94b9f5 100644 +--- a/sound/soc/bcm/hifiberry_dacplus.c ++++ b/sound/soc/bcm/hifiberry_dacplus.c +@@ -117,6 +117,7 @@ static int snd_rpi_hifiberry_dacplus_clk_for_rate(int sample_rate) + case 44100: + case 88200: + case 176400: ++ case 352800: + type = HIFIBERRY_DACPRO_CLK44EN; + break; + default: + +From e33f96c62bc39eff0f6a4269a654072e371d189e Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Thu, 14 Sep 2017 16:16:24 +0100 +Subject: [PATCH 161/171] config: Add CONFIG_GPIO_WATCHDOG=m + +Enable the gpio_wdt module, to support external watchdogs. + +See: https://github.com/raspberrypi/linux/issues/2199 + +Signed-off-by: Phil Elwell +--- + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 185753f21ce8fc7ccbb42d7b159cb3ce9909e959..0e58f92e52854275e9e3fcb8784961ab3f284da1 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -666,6 +666,7 @@ CONFIG_SENSORS_TMP102=m + CONFIG_THERMAL=y + CONFIG_BCM2835_THERMAL=y + CONFIG_WATCHDOG=y ++CONFIG_GPIO_WATCHDOG=m + CONFIG_BCM2835_WDT=y + CONFIG_MFD_STMPE=y + CONFIG_STMPE_SPI=y +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index f27a367b6be0b4af0d44b6fcaaaeca6c824c2da9..9a08c8fce1144cb73167e40b51e311c420fd52b4 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -659,6 +659,7 @@ CONFIG_SENSORS_TMP102=m + CONFIG_THERMAL=y + CONFIG_BCM2835_THERMAL=y + CONFIG_WATCHDOG=y ++CONFIG_GPIO_WATCHDOG=m + CONFIG_BCM2835_WDT=y + CONFIG_MFD_STMPE=y + CONFIG_STMPE_SPI=y + +From 84f87ba11350f5c272634747748a5434e12949a8 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Fri, 27 Oct 2017 21:34:12 +0100 +Subject: [PATCH 162/171] config: Add CONFIG_W1_SLAVE_DS2438=m + +See: https://github.com/raspberrypi/linux/issues/2246 +--- + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 0e58f92e52854275e9e3fcb8784961ab3f284da1..0aa08b035a41fc54ca583b1dcfb06d2bb6368f44 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -647,6 +647,7 @@ CONFIG_W1_SLAVE_DS2406=m + CONFIG_W1_SLAVE_DS2423=m + CONFIG_W1_SLAVE_DS2431=m + CONFIG_W1_SLAVE_DS2433=m ++CONFIG_W1_SLAVE_DS2438=m + CONFIG_W1_SLAVE_DS2760=m + CONFIG_W1_SLAVE_DS2780=m + CONFIG_W1_SLAVE_DS2781=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 9a08c8fce1144cb73167e40b51e311c420fd52b4..d0abfb90ff955c09d832615cadfc2ac8aa889f4b 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -640,6 +640,7 @@ CONFIG_W1_SLAVE_DS2406=m + CONFIG_W1_SLAVE_DS2423=m + CONFIG_W1_SLAVE_DS2431=m + CONFIG_W1_SLAVE_DS2433=m ++CONFIG_W1_SLAVE_DS2438=m + CONFIG_W1_SLAVE_DS2760=m + CONFIG_W1_SLAVE_DS2780=m + CONFIG_W1_SLAVE_DS2781=m + +From 607d128ebb188bc4009a841742022a85605a646c Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Wed, 1 Nov 2017 12:24:28 +0000 +Subject: [PATCH 163/171] ARM: dts: Add fake CTS signal to pi3-miniuart-bt + +The Pi 3B rev 1.3 and the Pi Zero W have flow control signals to the +BT modem, which work well using UART0 (a.k.a. ttyAMA0). Because of +this, the pin wired to the modem's CTS line has to be held low in +order for it to transmit data. + +Unfortunately the mini-UART (or its driver) appears to have a flow +control issue, causing hciattach to stall during modem initialisation. + +As a workaround (potentially short-term), configure GPIO 31 as an +output driving low (the default state for an output). + +See: https://www.raspberrypi.org/forums/viewtopic.php?f=107&t=138223&start=100#p1228339 + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/overlays/pi3-miniuart-bt-overlay.dts | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/arch/arm/boot/dts/overlays/pi3-miniuart-bt-overlay.dts b/arch/arm/boot/dts/overlays/pi3-miniuart-bt-overlay.dts +index 18f77453c38dbbf33f3726a5b4cce15b9f20f390..98381656945f5b84d96b9e496366b99109b4fbe7 100644 +--- a/arch/arm/boot/dts/overlays/pi3-miniuart-bt-overlay.dts ++++ b/arch/arm/boot/dts/overlays/pi3-miniuart-bt-overlay.dts +@@ -31,7 +31,7 @@ + target = <&uart1>; + __overlay__ { + pinctrl-names = "default"; +- pinctrl-0 = <&uart1_pins &bt_pins>; ++ pinctrl-0 = <&uart1_pins &bt_pins &fake_bt_cts>; + status = "okay"; + }; + }; +@@ -55,6 +55,16 @@ + }; + + fragment@4 { ++ target = <&gpio>; ++ __overlay__ { ++ fake_bt_cts: fake_bt_cts { ++ brcm,pins = <31>; ++ brcm,function = <1>; /* output */ ++ }; ++ }; ++ }; ++ ++ fragment@5 { + target-path = "/aliases"; + __overlay__ { + serial0 = "/soc/serial@7e201000"; + +From 4789fefcdcd46a0a216cd2a9624fd016a6ea69b8 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 14 Nov 2017 11:03:22 +0000 +Subject: [PATCH 164/171] mcp2515: Use DT-supplied interrupt flags + +The MCP2515 datasheet clearly describes a level-triggered interrupt +pin. Therefore the receiving interrupt controller must also be +configured for level-triggered operation otherwise there is a danger +of a missed interrupt condition blocking all subsequent interrupts. +The ONESHOT flag ensures that the interrupt is masked until the +threaded interrupt handler exits. + +Rather than change the flags globally (they must have worked for at +least one user), allow the flags to be overridden from Device Tree +in the event that the device has a DT node. + +See: https://github.com/raspberrypi/linux/issues/2175 + https://github.com/raspberrypi/linux/issues/2263 + +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/overlays/mcp2515-can0-overlay.dts | 2 +- + arch/arm/boot/dts/overlays/mcp2515-can1-overlay.dts | 2 +- + drivers/net/can/spi/mcp251x.c | 3 +++ + 3 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/arch/arm/boot/dts/overlays/mcp2515-can0-overlay.dts b/arch/arm/boot/dts/overlays/mcp2515-can0-overlay.dts +index c96cdae27fb15055c4a6ec55d1ee45644768c392..03eb5486fa9c4cdb74cfc7a228dc7cea0105b8b5 100755 +--- a/arch/arm/boot/dts/overlays/mcp2515-can0-overlay.dts ++++ b/arch/arm/boot/dts/overlays/mcp2515-can0-overlay.dts +@@ -60,7 +60,7 @@ + pinctrl-0 = <&can0_pins>; + spi-max-frequency = <10000000>; + interrupt-parent = <&gpio>; +- interrupts = <25 0x2>; ++ interrupts = <25 8>; /* IRQ_TYPE_LEVEL_LOW */ + clocks = <&can0_osc>; + }; + }; +diff --git a/arch/arm/boot/dts/overlays/mcp2515-can1-overlay.dts b/arch/arm/boot/dts/overlays/mcp2515-can1-overlay.dts +index 67bd0d9bdaa2ff767d284010a69ecfe3f2aa1fd1..dc773fa3b50cea849ffede35f42d30175c11718c 100644 +--- a/arch/arm/boot/dts/overlays/mcp2515-can1-overlay.dts ++++ b/arch/arm/boot/dts/overlays/mcp2515-can1-overlay.dts +@@ -60,7 +60,7 @@ + pinctrl-0 = <&can1_pins>; + spi-max-frequency = <10000000>; + interrupt-parent = <&gpio>; +- interrupts = <25 0x2>; ++ interrupts = <25 8>; /* IRQ_TYPE_LEVEL_LOW */ + clocks = <&can1_osc>; + }; + }; +diff --git a/drivers/net/can/spi/mcp251x.c b/drivers/net/can/spi/mcp251x.c +index f3f05fea8e1f8e0ad3a1ebd7461d2019835e1d47..6c2d3aba25918f5536b2d67292334e746df06c5e 100644 +--- a/drivers/net/can/spi/mcp251x.c ++++ b/drivers/net/can/spi/mcp251x.c +@@ -952,6 +952,9 @@ static int mcp251x_open(struct net_device *net) + priv->tx_skb = NULL; + priv->tx_len = 0; + ++ if (spi->dev.of_node) ++ flags = 0; ++ + ret = request_threaded_irq(spi->irq, NULL, mcp251x_can_ist, + flags | IRQF_ONESHOT, DEVICE_NAME, priv); + if (ret) { + +From 1198d413d70e20b374a8bdc9794d39ee3a7bde0b Mon Sep 17 00:00:00 2001 +From: Eric Cooper +Date: Sat, 29 Jul 2017 15:52:58 -0400 +Subject: [PATCH 165/171] overlays: i2c-rtc: add m41t62 + +Add support for the ST M41T62 real-time clock chip. +--- + arch/arm/boot/dts/overlays/README | 2 ++ + arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts | 19 ++++++++++++++++++- + 2 files changed, 20 insertions(+), 1 deletion(-) + +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 6f6daf2164add0af2363befec3ec521b367c402e..77204d1fe09028ba5c6e50583a96eb5cafa8008a 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -689,6 +689,8 @@ Params: abx80x Select one of the ABx80x family: + + ds3231 Select the DS3231 device + ++ m41t62 Select the M41T62 device ++ + mcp7940x Select the MCP7940x device + + mcp7941x Select the MCP7941x device +diff --git a/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts b/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts +index 6140f172a86b8731782f938f76cb5dac9f28b662..fcb846a50d19cb97fc73de8b801962ac96416c20 100644 +--- a/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts ++++ b/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts +@@ -143,6 +143,21 @@ + }; + }; + ++ fragment@9 { ++ target = <&i2c_arm>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ m41t62: m41t62@68 { ++ compatible = "st,m41t62"; ++ reg = <0x68>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ + __overrides__ { + abx80x = <0>,"+0"; + ds1307 = <0>,"+1"; +@@ -153,12 +168,14 @@ + pcf2127 = <0>,"+6"; + pcf8523 = <0>,"+7"; + pcf8563 = <0>,"+8"; ++ m41t62 = <0>,"+9"; + trickle-diode-type = <&abx80x>,"abracon,tc-diode"; + trickle-resistor-ohms = <&ds1339>,"trickle-resistor-ohms:0", + <&abx80x>,"abracon,tc-resistor"; + wakeup-source = <&ds1339>,"wakeup-source?", + <&ds3231>,"wakeup-source?", + <&mcp7940x>,"wakeup-source?", +- <&mcp7941x>,"wakeup-source?"; ++ <&mcp7941x>,"wakeup-source?", ++ <&m41t62>,"wakeup-source?"; + }; + }; + +From 907f7589115e0456177bc6ec61b41e1bbb2bc2bc Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Wed, 16 Aug 2017 16:52:50 +0100 +Subject: [PATCH 166/171] BCM270X_DT: Set spidev spi-max-frequency to 125MHz + +The BCM2835 SPI controllers have a maximum bus clock of half the system +clock speed, so with the 250MHz system clock found on Raspberry Pis +you get a theoretical maximum bus speed of 125MHz. Note that this +speed is unlikely to be reliable, and the maximum usable bus spee will +depend on both the attached device and the wiring. + +See: https://github.com/raspberrypi/linux/issues/2165 +Signed-off-by: Phil Elwell +--- + arch/arm/boot/dts/bcm2708-rpi-0-w.dts | 4 ++-- + arch/arm/boot/dts/bcm2708-rpi-b-plus.dts | 4 ++-- + arch/arm/boot/dts/bcm2708-rpi-b.dts | 4 ++-- + arch/arm/boot/dts/bcm2708-rpi-cm.dts | 4 ++-- + arch/arm/boot/dts/bcm2709-rpi-2-b.dts | 4 ++-- + arch/arm/boot/dts/bcm2710-rpi-3-b.dts | 4 ++-- + arch/arm/boot/dts/bcm2710-rpi-cm3.dts | 4 ++-- + arch/arm/boot/dts/overlays/spi1-1cs-overlay.dts | 2 +- + arch/arm/boot/dts/overlays/spi1-2cs-overlay.dts | 4 ++-- + arch/arm/boot/dts/overlays/spi1-3cs-overlay.dts | 6 +++--- + arch/arm/boot/dts/overlays/spi2-1cs-overlay.dts | 2 +- + arch/arm/boot/dts/overlays/spi2-2cs-overlay.dts | 4 ++-- + arch/arm/boot/dts/overlays/spi2-3cs-overlay.dts | 6 +++--- + 13 files changed, 26 insertions(+), 26 deletions(-) + +diff --git a/arch/arm/boot/dts/bcm2708-rpi-0-w.dts b/arch/arm/boot/dts/bcm2708-rpi-0-w.dts +index a6ef9ee67ef8ca7eb88808bc9afcd89ce3af1f0d..8299f8a4e2a436f443e9c95c468583d538787c0f 100644 +--- a/arch/arm/boot/dts/bcm2708-rpi-0-w.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-0-w.dts +@@ -101,7 +101,7 @@ + reg = <0>; /* CE0 */ + #address-cells = <1>; + #size-cells = <0>; +- spi-max-frequency = <500000>; ++ spi-max-frequency = <125000000>; + }; + + spidev1: spidev@1{ +@@ -109,7 +109,7 @@ + reg = <1>; /* CE1 */ + #address-cells = <1>; + #size-cells = <0>; +- spi-max-frequency = <500000>; ++ spi-max-frequency = <125000000>; + }; + }; + +diff --git a/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts b/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts +index 373bfd02786c6d912c3fc5ebb2f3dcebb5ebf82b..31db4fd917a40d949acbabfc9ae1367f85933f9a 100644 +--- a/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts +@@ -53,7 +53,7 @@ + reg = <0>; /* CE0 */ + #address-cells = <1>; + #size-cells = <0>; +- spi-max-frequency = <500000>; ++ spi-max-frequency = <125000000>; + }; + + spidev1: spidev@1{ +@@ -61,7 +61,7 @@ + reg = <1>; /* CE1 */ + #address-cells = <1>; + #size-cells = <0>; +- spi-max-frequency = <500000>; ++ spi-max-frequency = <125000000>; + }; + }; + +diff --git a/arch/arm/boot/dts/bcm2708-rpi-b.dts b/arch/arm/boot/dts/bcm2708-rpi-b.dts +index 7e5151ad52a661f482b1de355210b5587417e87c..ffe5d14feb9f671b6a574c55c115e331fac22c4d 100644 +--- a/arch/arm/boot/dts/bcm2708-rpi-b.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-b.dts +@@ -53,7 +53,7 @@ + reg = <0>; /* CE0 */ + #address-cells = <1>; + #size-cells = <0>; +- spi-max-frequency = <500000>; ++ spi-max-frequency = <125000000>; + }; + + spidev1: spidev@1{ +@@ -61,7 +61,7 @@ + reg = <1>; /* CE1 */ + #address-cells = <1>; + #size-cells = <0>; +- spi-max-frequency = <500000>; ++ spi-max-frequency = <125000000>; + }; + }; + +diff --git a/arch/arm/boot/dts/bcm2708-rpi-cm.dts b/arch/arm/boot/dts/bcm2708-rpi-cm.dts +index 935867a7bb46addd9e205f93cb9db45b92722fa3..0b0d23256edd74fca11a0e6479f4d048aec75717 100644 +--- a/arch/arm/boot/dts/bcm2708-rpi-cm.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-cm.dts +@@ -52,7 +52,7 @@ + reg = <0>; /* CE0 */ + #address-cells = <1>; + #size-cells = <0>; +- spi-max-frequency = <500000>; ++ spi-max-frequency = <125000000>; + }; + + spidev1: spidev@1{ +@@ -60,7 +60,7 @@ + reg = <1>; /* CE1 */ + #address-cells = <1>; + #size-cells = <0>; +- spi-max-frequency = <500000>; ++ spi-max-frequency = <125000000>; + }; + }; + +diff --git a/arch/arm/boot/dts/bcm2709-rpi-2-b.dts b/arch/arm/boot/dts/bcm2709-rpi-2-b.dts +index 434c451928b4830530d008d9c9ede9b0fc0c1b92..b7d48347066597e5d1e183e7c58330daf12f4e9b 100644 +--- a/arch/arm/boot/dts/bcm2709-rpi-2-b.dts ++++ b/arch/arm/boot/dts/bcm2709-rpi-2-b.dts +@@ -53,7 +53,7 @@ + reg = <0>; /* CE0 */ + #address-cells = <1>; + #size-cells = <0>; +- spi-max-frequency = <500000>; ++ spi-max-frequency = <125000000>; + }; + + spidev1: spidev@1{ +@@ -61,7 +61,7 @@ + reg = <1>; /* CE1 */ + #address-cells = <1>; + #size-cells = <0>; +- spi-max-frequency = <500000>; ++ spi-max-frequency = <125000000>; + }; + }; + +diff --git a/arch/arm/boot/dts/bcm2710-rpi-3-b.dts b/arch/arm/boot/dts/bcm2710-rpi-3-b.dts +index e032516ffd351a4099d150767a112f195d678b5a..a72c2fed5c52444fbc80daf23e1bf8f7c6f70e7f 100644 +--- a/arch/arm/boot/dts/bcm2710-rpi-3-b.dts ++++ b/arch/arm/boot/dts/bcm2710-rpi-3-b.dts +@@ -125,7 +125,7 @@ + reg = <0>; /* CE0 */ + #address-cells = <1>; + #size-cells = <0>; +- spi-max-frequency = <500000>; ++ spi-max-frequency = <125000000>; + }; + + spidev1: spidev@1{ +@@ -133,7 +133,7 @@ + reg = <1>; /* CE1 */ + #address-cells = <1>; + #size-cells = <0>; +- spi-max-frequency = <500000>; ++ spi-max-frequency = <125000000>; + }; + }; + +diff --git a/arch/arm/boot/dts/bcm2710-rpi-cm3.dts b/arch/arm/boot/dts/bcm2710-rpi-cm3.dts +index a84552eca6a54dafd6d016dfb60e9d4ce064041f..2500641c14dc3f01421351738b1e0f01ad73772d 100644 +--- a/arch/arm/boot/dts/bcm2710-rpi-cm3.dts ++++ b/arch/arm/boot/dts/bcm2710-rpi-cm3.dts +@@ -70,7 +70,7 @@ + reg = <0>; /* CE0 */ + #address-cells = <1>; + #size-cells = <0>; +- spi-max-frequency = <500000>; ++ spi-max-frequency = <125000000>; + }; + + spidev1: spidev@1{ +@@ -78,7 +78,7 @@ + reg = <1>; /* CE1 */ + #address-cells = <1>; + #size-cells = <0>; +- spi-max-frequency = <500000>; ++ spi-max-frequency = <125000000>; + }; + }; + +diff --git a/arch/arm/boot/dts/overlays/spi1-1cs-overlay.dts b/arch/arm/boot/dts/overlays/spi1-1cs-overlay.dts +index 71c243947004fa887998065df9c259b50edfa428..c3d4f96b7aa92cd679cc8abc7c7aea1dc7c84eb6 100644 +--- a/arch/arm/boot/dts/overlays/spi1-1cs-overlay.dts ++++ b/arch/arm/boot/dts/overlays/spi1-1cs-overlay.dts +@@ -36,7 +36,7 @@ + reg = <0>; /* CE0 */ + #address-cells = <1>; + #size-cells = <0>; +- spi-max-frequency = <500000>; ++ spi-max-frequency = <125000000>; + status = "okay"; + }; + }; +diff --git a/arch/arm/boot/dts/overlays/spi1-2cs-overlay.dts b/arch/arm/boot/dts/overlays/spi1-2cs-overlay.dts +index 2ae0885cf1e7fb7420f65e538310ab1addafbece..2ad62497dc895c6253c2a03b45e726e4f882d170 100644 +--- a/arch/arm/boot/dts/overlays/spi1-2cs-overlay.dts ++++ b/arch/arm/boot/dts/overlays/spi1-2cs-overlay.dts +@@ -36,7 +36,7 @@ + reg = <0>; /* CE0 */ + #address-cells = <1>; + #size-cells = <0>; +- spi-max-frequency = <500000>; ++ spi-max-frequency = <125000000>; + status = "okay"; + }; + +@@ -45,7 +45,7 @@ + reg = <1>; /* CE1 */ + #address-cells = <1>; + #size-cells = <0>; +- spi-max-frequency = <500000>; ++ spi-max-frequency = <125000000>; + status = "okay"; + }; + }; +diff --git a/arch/arm/boot/dts/overlays/spi1-3cs-overlay.dts b/arch/arm/boot/dts/overlays/spi1-3cs-overlay.dts +index 8f79044cd8f47ea055394822cc380497c985c7e5..ef82890453bfe36afd124f6a01f4ca5116b809d4 100644 +--- a/arch/arm/boot/dts/overlays/spi1-3cs-overlay.dts ++++ b/arch/arm/boot/dts/overlays/spi1-3cs-overlay.dts +@@ -36,7 +36,7 @@ + reg = <0>; /* CE0 */ + #address-cells = <1>; + #size-cells = <0>; +- spi-max-frequency = <500000>; ++ spi-max-frequency = <125000000>; + status = "okay"; + }; + +@@ -45,7 +45,7 @@ + reg = <1>; /* CE1 */ + #address-cells = <1>; + #size-cells = <0>; +- spi-max-frequency = <500000>; ++ spi-max-frequency = <125000000>; + status = "okay"; + }; + +@@ -54,7 +54,7 @@ + reg = <2>; /* CE2 */ + #address-cells = <1>; + #size-cells = <0>; +- spi-max-frequency = <500000>; ++ spi-max-frequency = <125000000>; + status = "okay"; + }; + }; +diff --git a/arch/arm/boot/dts/overlays/spi2-1cs-overlay.dts b/arch/arm/boot/dts/overlays/spi2-1cs-overlay.dts +index 6f57bc710fe123028a5a216063733f0cea9bbd54..761b6be4ff9b55da1bf3979c905a3cc8d87ca6fb 100644 +--- a/arch/arm/boot/dts/overlays/spi2-1cs-overlay.dts ++++ b/arch/arm/boot/dts/overlays/spi2-1cs-overlay.dts +@@ -36,7 +36,7 @@ + reg = <0>; /* CE0 */ + #address-cells = <1>; + #size-cells = <0>; +- spi-max-frequency = <500000>; ++ spi-max-frequency = <125000000>; + status = "okay"; + }; + }; +diff --git a/arch/arm/boot/dts/overlays/spi2-2cs-overlay.dts b/arch/arm/boot/dts/overlays/spi2-2cs-overlay.dts +index d090631d36821b0c89833b9f217216f0b134a8f3..e533aba113deddd35ed3f9f6628eb130f1e09095 100644 +--- a/arch/arm/boot/dts/overlays/spi2-2cs-overlay.dts ++++ b/arch/arm/boot/dts/overlays/spi2-2cs-overlay.dts +@@ -36,7 +36,7 @@ + reg = <0>; /* CE0 */ + #address-cells = <1>; + #size-cells = <0>; +- spi-max-frequency = <500000>; ++ spi-max-frequency = <125000000>; + status = "okay"; + }; + +@@ -45,7 +45,7 @@ + reg = <1>; /* CE1 */ + #address-cells = <1>; + #size-cells = <0>; +- spi-max-frequency = <500000>; ++ spi-max-frequency = <125000000>; + status = "okay"; + }; + }; +diff --git a/arch/arm/boot/dts/overlays/spi2-3cs-overlay.dts b/arch/arm/boot/dts/overlays/spi2-3cs-overlay.dts +index e2586728c311829462f6a4b3b348e35603f033ce..a62e107dc98fa484bcaad7f8caddfca450d0aea6 100644 +--- a/arch/arm/boot/dts/overlays/spi2-3cs-overlay.dts ++++ b/arch/arm/boot/dts/overlays/spi2-3cs-overlay.dts +@@ -36,7 +36,7 @@ + reg = <0>; /* CE0 */ + #address-cells = <1>; + #size-cells = <0>; +- spi-max-frequency = <500000>; ++ spi-max-frequency = <125000000>; + status = "okay"; + }; + +@@ -45,7 +45,7 @@ + reg = <1>; /* CE1 */ + #address-cells = <1>; + #size-cells = <0>; +- spi-max-frequency = <500000>; ++ spi-max-frequency = <125000000>; + status = "okay"; + }; + +@@ -54,7 +54,7 @@ + reg = <2>; /* CE2 */ + #address-cells = <1>; + #size-cells = <0>; +- spi-max-frequency = <500000>; ++ spi-max-frequency = <125000000>; + status = "okay"; + }; + }; + +From 000de40d0c0a1f7890e2ac95bd5cca89e24307ab Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Wed, 24 May 2017 18:06:02 +0100 +Subject: [PATCH 167/171] Revert "hid: Reduce default mouse polling interval to + 60Hz" + +This reverts commit b45c0448b60d691508251cdccf242ea43bbabb14. +--- + drivers/hid/usbhid/hid-core.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c +index 45abcbab4efe561a3829e9a6b6014abeb7d7797d..045b5da9b992873ce74f5d401de34855b93a6f8e 100644 +--- a/drivers/hid/usbhid/hid-core.c ++++ b/drivers/hid/usbhid/hid-core.c +@@ -48,7 +48,7 @@ + * Module parameters. + */ + +-static unsigned int hid_mousepoll_interval = ~0; ++static unsigned int hid_mousepoll_interval; + module_param_named(mousepoll, hid_mousepoll_interval, uint, 0644); + MODULE_PARM_DESC(mousepoll, "Polling interval of mice"); + +@@ -1098,9 +1098,7 @@ static int usbhid_start(struct hid_device *hid) + /* Change the polling interval of mice and joysticks. */ + switch (hid->collection->usage) { + case HID_GD_MOUSE: +- if (hid_mousepoll_interval == ~0 && interval < 16) +- interval = 16; +- else if (hid_mousepoll_interval != ~0 && hid_mousepoll_interval != 0) ++ if (hid_mousepoll_interval > 0) + interval = hid_mousepoll_interval; + break; + case HID_GD_JOYSTICK: + +From 86bf60b3d7b8ce75bb4be3dce93b9c44f814a3ab Mon Sep 17 00:00:00 2001 +From: Gerald Pape +Date: Wed, 1 Nov 2017 11:15:32 +0100 +Subject: [PATCH 168/171] Include tsl4531, veml6070 and hdc100x dtoverlay + (#2252) + +This commit adds the needed kernel config keys and extends the +i2c-sensor-overlay.dts file with support for: +* the Texas Instruments HDC100x temp sensor +* the AMS TSL4531 digital ambient light sensor +* the Vishay VEML6070 ultraviolet light sensor +--- + arch/arm/boot/dts/overlays/README | 13 +++++- + arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts | 50 ++++++++++++++++++++++- + arch/arm/configs/bcm2709_defconfig | 3 ++ + arch/arm/configs/bcmrpi_defconfig | 3 ++ + 4 files changed, 66 insertions(+), 3 deletions(-) + +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 77204d1fe09028ba5c6e50583a96eb5cafa8008a..708d4e4baa8ed70c29d8ad6381fdab0e8ea33bb5 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -756,8 +756,8 @@ Name: i2c-sensor + Info: Adds support for a number of I2C barometric pressure and temperature + sensors on i2c_arm + Load: dtoverlay=i2c-sensor,= +-Params: addr Set the address for the BME280, BMP280, TMP102 +- or LM75 ++Params: addr Set the address for the BME280, BMP280, TMP102, ++ HDC100X or LM75 + + bme280 Select the Bosch Sensortronic BME280 + Valid addresses 0x76-0x77, default 0x76 +@@ -769,6 +769,9 @@ Params: addr Set the address for the BME280, BMP280, TMP102 + bmp280 Select the Bosch Sensortronic BMP280 + Valid addresses 0x76-0x77, default 0x76 + ++ hdc100x Select the Texas Instruments HDC100x temp sensor ++ Valid addresses 0x40-0x43, default 0x40 ++ + htu21 Select the HTU21 temperature and humidity sensor + + lm75 Select the Maxim LM75 temperature sensor +@@ -782,6 +785,12 @@ Params: addr Set the address for the BME280, BMP280, TMP102 + tmp102 Select the Texas Instruments TMP102 temp sensor + Valid addresses 0x48-0x4b, default 0x48 + ++ tsl4531 Select the AMS TSL4531 digital ambient light ++ sensor ++ ++ veml6070 Select the Vishay VEML6070 ultraviolet light ++ sensor ++ + + Name: i2c0-bcm2708 + Info: Enable the i2c_bcm2708 driver for the i2c0 bus. Not all pin combinations +diff --git a/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts b/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts +index 17c27e3b666a7a83619471b50c63bb93836653c5..28e6fa3b659d90b4fdfcc52df37e870572731235 100644 +--- a/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts ++++ b/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts +@@ -126,9 +126,54 @@ + }; + }; + ++ fragment@8 { ++ target = <&i2c_arm>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ hdc100x: hdc100x@40 { ++ compatible = "hdc100x"; ++ reg = <0x40>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ fragment@9 { ++ target = <&i2c_arm>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ tsl4531: tsl4531@29 { ++ compatible = "tsl4531"; ++ reg = <0x29>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ fragment@10 { ++ target = <&i2c_arm>; ++ __dormant__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ veml6070: veml6070@38 { ++ compatible = "veml6070"; ++ reg = <0x38>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ + __overrides__ { + addr = <&bme280>,"reg:0", <&bmp280>,"reg:0", <&tmp102>,"reg:0", +- <&lm75>,"reg:0"; ++ <&lm75>,"reg:0",<&hdc100x>,"reg:0"; + bme280 = <0>,"+0"; + bmp085 = <0>,"+1"; + bmp180 = <0>,"+2"; +@@ -138,5 +183,8 @@ + lm75addr = <&lm75>,"reg:0"; + si7020 = <0>,"+6"; + tmp102 = <0>,"+7"; ++ hdc100x = <0>,"+8"; ++ tsl4531 = <0>,"+9"; ++ veml6070 = <0>,"+10"; + }; + }; +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 0aa08b035a41fc54ca583b1dcfb06d2bb6368f44..63d4b769d3164996d3968c5ca1f872f214840a5a 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -1183,8 +1183,11 @@ CONFIG_IIO_BUFFER_CB=m + CONFIG_MCP320X=m + CONFIG_MCP3422=m + CONFIG_DHT11=m ++CONFIG_HDC100X=m + CONFIG_HTU21=m + CONFIG_INV_MPU6050_I2C=m ++CONFIG_TSL4531=m ++CONFIG_VEML6070=m + CONFIG_BMP280=m + CONFIG_PWM_BCM2835=m + CONFIG_PWM_PCA9685=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index d0abfb90ff955c09d832615cadfc2ac8aa889f4b..656475a7e6ecd5004417a3157732271402b50139 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -1189,8 +1189,11 @@ CONFIG_IIO_BUFFER_CB=m + CONFIG_MCP320X=m + CONFIG_MCP3422=m + CONFIG_DHT11=m ++CONFIG_HDC100X=m + CONFIG_HTU21=m + CONFIG_INV_MPU6050_I2C=m ++CONFIG_TSL4531=m ++CONFIG_VEML6070=m + CONFIG_BMP280=m + CONFIG_PWM_BCM2835=m + CONFIG_PWM_PCA9685=m + +From f06974d949719653795ff6fef2f8fa97fdce51a9 Mon Sep 17 00:00:00 2001 +From: James Hughes +Date: Thu, 16 Nov 2017 15:56:17 +0000 +Subject: [PATCH 169/171] Tidy up of the ft5406 driver to use DT (#2189) + +Driver was using a fixed resolution, this commit +adds touchscreen size, and coordinate flip and swap +features via device tree overlays. + +Adds overrides so the VC4 can adjust the DT parameters +appropriately; there is a newer version of the VC4 side +driver that can now set up the appropriate DT values +if required. + +Signed-off-by: James Hughes +--- + arch/arm/boot/dts/overlays/README | 8 +- + arch/arm/boot/dts/overlays/rpi-ft5406-overlay.dts | 13 ++ + drivers/input/touchscreen/rpi-ft5406.c | 218 ++++++++++++++-------- + 3 files changed, 164 insertions(+), 75 deletions(-) + +diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README +index 708d4e4baa8ed70c29d8ad6381fdab0e8ea33bb5..608b68fb7dad22290320f63ec340617453e58187 100644 +--- a/arch/arm/boot/dts/overlays/README ++++ b/arch/arm/boot/dts/overlays/README +@@ -1299,8 +1299,12 @@ Params: speed Display SPI bus speed + + Name: rpi-ft5406 + Info: Official Raspberry Pi display touchscreen +-Load: dtoverlay=rpi-ft5406 +-Params: ++Load: dtoverlay=rpi-ft5406,= ++Params: touchscreen-size-x Touchscreen X resolution (default 800) ++ touchscreen-size-y Touchscreen Y resolution (default 600); ++ touchscreen-inverted-x Invert touchscreen X coordinates (default 0); ++ touchscreen-inverted-y Invert touchscreen Y coordinates (default 0); ++ touchscreen-swapped-x-y Swap X and Y cordinates (default 0); + + + Name: rpi-proto +diff --git a/arch/arm/boot/dts/overlays/rpi-ft5406-overlay.dts b/arch/arm/boot/dts/overlays/rpi-ft5406-overlay.dts +index 2e53a17491706bdb6245426b548a54960a40966f..d4607b9d1cbfc38c6dd8b504aa00921d9590f6da 100644 +--- a/arch/arm/boot/dts/overlays/rpi-ft5406-overlay.dts ++++ b/arch/arm/boot/dts/overlays/rpi-ft5406-overlay.dts +@@ -11,7 +11,20 @@ + compatible = "rpi,rpi-ft5406"; + firmware = <&firmware>; + status = "okay"; ++ touchscreen-size-x = <800>; ++ touchscreen-size-y = <600>; ++ touchscreen-inverted-x = <0>; ++ touchscreen-inverted-y = <0>; ++ touchscreen-swapped-x-y = <0>; + }; + }; + }; ++ ++ __overrides__ { ++ touchscreen-size-x = <&rpi_ft5406>,"touchscreen-size-x:0"; ++ touchscreen-size-y = <&rpi_ft5406>,"touchscreen-size-y:0"; ++ touchscreen-inverted-x = <&rpi_ft5406>,"touchscreen-inverted-x:0"; ++ touchscreen-inverted-y = <&rpi_ft5406>,"touchscreen-inverted-y:0"; ++ touchscreen-swapped-x-y = <&rpi_ft5406>,"touchscreen-swapped-x-y:0"; ++ }; + }; +diff --git a/drivers/input/touchscreen/rpi-ft5406.c b/drivers/input/touchscreen/rpi-ft5406.c +index 9d7d05482355d168c5c0c42508cd978979ee5f14..40bbde9ce1bc4c51be50f47fc359c74f49c5e9ba 100644 +--- a/drivers/input/touchscreen/rpi-ft5406.c ++++ b/drivers/input/touchscreen/rpi-ft5406.c +@@ -1,7 +1,7 @@ + /* + * Driver for memory based ft5406 touchscreen + * +- * Copyright (C) 2015 Raspberry Pi ++ * Copyright (C) 2015, 2017 Raspberry Pi + * + * + * This program is free software; you can redistribute it and/or modify +@@ -9,7 +9,6 @@ + * published by the Free Software Foundation. + */ + +- + #include + #include + #include +@@ -21,11 +20,15 @@ + #include + #include + #include +-#include ++#include + #include + #include + + #define MAXIMUM_SUPPORTED_POINTS 10 ++#define FTS_TOUCH_DOWN 0 ++#define FTS_TOUCH_UP 1 ++#define FTS_TOUCH_CONTACT 2 ++ + struct ft5406_regs { + uint8_t device_mode; + uint8_t gesture_id; +@@ -35,85 +38,125 @@ struct ft5406_regs { + uint8_t xl; + uint8_t yh; + uint8_t yl; +- uint8_t res1; +- uint8_t res2; ++ uint8_t pressure; /* Not supported */ ++ uint8_t area; /* Not supported */ + } point[MAXIMUM_SUPPORTED_POINTS]; + }; + +-#define SCREEN_WIDTH 800 +-#define SCREEN_HEIGHT 480 ++/* These are defaults if the DT entries are missing */ ++#define DEFAULT_SCREEN_WIDTH 800 ++#define DEFAULT_SCREEN_HEIGHT 480 + + struct ft5406 { +- struct platform_device * pdev; +- struct input_dev * input_dev; +- void __iomem * ts_base; +- dma_addr_t bus_addr; +- struct task_struct * thread; ++ struct platform_device *pdev; ++ struct input_dev *input_dev; ++ void __iomem *ts_base; ++ dma_addr_t bus_addr; ++ struct task_struct *thread; ++ ++ uint16_t max_x; ++ uint16_t max_y; ++ uint8_t hflip; ++ uint8_t vflip; ++ uint8_t xyswap; + }; + + /* Thread to poll for touchscreen events +- * ++ * + * This thread polls the memory based register copy of the ft5406 registers + * using the number of points register to know whether the copy has been +- * updated (we write 99 to the memory copy, the GPU will write between ++ * updated (we write 99 to the memory copy, the GPU will write between + * 0 - 10 points) + */ ++#define ID_TO_BIT(a) (1 << a) ++ + static int ft5406_thread(void *arg) + { + struct ft5406 *ts = (struct ft5406 *) arg; + struct ft5406_regs regs; + int known_ids = 0; +- +- while(!kthread_should_stop()) +- { +- // 60fps polling ++ ++ while (!kthread_should_stop()) { ++ /* 60fps polling */ + msleep_interruptible(17); + memcpy_fromio(®s, ts->ts_base, sizeof(struct ft5406_regs)); +- iowrite8(99, ts->ts_base + offsetof(struct ft5406_regs, num_points)); +- // Do not output if theres no new information (num_points is 99) +- // or we have no touch points and don't need to release any +- if(!(regs.num_points == 99 || (regs.num_points == 0 && known_ids == 0))) +- { ++ iowrite8(99, ++ ts->ts_base + ++ offsetof(struct ft5406_regs, num_points)); ++ ++ /* ++ * Do not output if theres no new information (num_points is 99) ++ * or we have no touch points and don't need to release any ++ */ ++ if (!(regs.num_points == 99 || ++ (regs.num_points == 0 && known_ids == 0))) { + int i; + int modified_ids = 0, released_ids; +- for(i = 0; i < regs.num_points; i++) +- { +- int x = (((int) regs.point[i].xh & 0xf) << 8) + regs.point[i].xl; +- int y = (((int) regs.point[i].yh & 0xf) << 8) + regs.point[i].yl; +- int touchid = (regs.point[i].yh >> 4) & 0xf; +- +- modified_ids |= 1 << touchid; +- +- if(!((1 << touchid) & known_ids)) +- dev_dbg(&ts->pdev->dev, "x = %d, y = %d, touchid = %d\n", x, y, touchid); +- +- input_mt_slot(ts->input_dev, touchid); +- input_mt_report_slot_state(ts->input_dev, MT_TOOL_FINGER, 1); +- +- input_report_abs(ts->input_dev, ABS_MT_POSITION_X, x); +- input_report_abs(ts->input_dev, ABS_MT_POSITION_Y, y); + ++ for (i = 0; i < regs.num_points; i++) { ++ int x = (((int) regs.point[i].xh & 0xf) << 8) + ++ regs.point[i].xl; ++ int y = (((int) regs.point[i].yh & 0xf) << 8) + ++ regs.point[i].yl; ++ int touchid = (regs.point[i].yh >> 4) & 0xf; ++ int event_type = (regs.point[i].xh >> 6) & 0x03; ++ ++ modified_ids |= ID_TO_BIT(touchid); ++ ++ if (event_type == FTS_TOUCH_DOWN || ++ event_type == FTS_TOUCH_CONTACT) { ++ if (ts->hflip) ++ x = ts->max_x - 1 - x; ++ ++ if (ts->vflip) ++ y = ts->max_y - 1 - y; ++ ++ if (ts->xyswap) ++ swap(x, y); ++ ++ if (!((ID_TO_BIT(touchid)) & known_ids)) ++ dev_dbg(&ts->pdev->dev, ++ "x = %d, y = %d, press = %d, touchid = %d\n", ++ x, y, ++ regs.point[i].pressure, ++ touchid); ++ ++ input_mt_slot(ts->input_dev, touchid); ++ input_mt_report_slot_state( ++ ts->input_dev, ++ MT_TOOL_FINGER, ++ 1); ++ ++ input_report_abs(ts->input_dev, ++ ABS_MT_POSITION_X, x); ++ input_report_abs(ts->input_dev, ++ ABS_MT_POSITION_Y, y); ++ } + } + + released_ids = known_ids & ~modified_ids; +- for(i = 0; released_ids && i < MAXIMUM_SUPPORTED_POINTS; i++) +- { +- if(released_ids & (1<pdev->dev, "Released %d, known = %x modified = %x\n", i, known_ids, modified_ids); ++ for (i = 0; ++ released_ids && i < MAXIMUM_SUPPORTED_POINTS; ++ i++) { ++ if (released_ids & (1<pdev->dev, ++ "Released %d, known = %x, modified = %x\n", ++ i, known_ids, modified_ids); + input_mt_slot(ts->input_dev, i); +- input_mt_report_slot_state(ts->input_dev, MT_TOOL_FINGER, 0); +- modified_ids &= ~(1 << i); ++ input_mt_report_slot_state( ++ ts->input_dev, ++ MT_TOOL_FINGER, ++ 0); ++ modified_ids &= ~(ID_TO_BIT(i)); + } + } + known_ids = modified_ids; +- ++ + input_mt_report_pointer_emulation(ts->input_dev, true); + input_sync(ts->input_dev); + } +- + } +- ++ + return 0; + } + +@@ -122,13 +165,14 @@ static int ft5406_probe(struct platform_device *pdev) + int err = 0; + struct device *dev = &pdev->dev; + struct device_node *np = dev->of_node; +- struct ft5406 * ts; ++ struct ft5406 *ts; + struct device_node *fw_node; + struct rpi_firmware *fw; + u32 touchbuf; +- ++ u32 val; ++ + dev_info(dev, "Probing device\n"); +- ++ + fw_node = of_parse_phandle(np, "firmware", 0); + if (!fw_node) { + dev_err(dev, "Missing firmware node\n"); +@@ -151,7 +195,8 @@ static int ft5406_probe(struct platform_device *pdev) + return -ENOMEM; + } + +- ts->ts_base = dma_zalloc_coherent(dev, PAGE_SIZE, &ts->bus_addr, GFP_KERNEL); ++ ts->ts_base = dma_zalloc_coherent(dev, PAGE_SIZE, &ts->bus_addr, ++ GFP_KERNEL); + if (!ts->ts_base) { + pr_err("[%s]: failed to dma_alloc_coherent(%ld)\n", + __func__, PAGE_SIZE); +@@ -164,17 +209,22 @@ static int ft5406_probe(struct platform_device *pdev) + &touchbuf, sizeof(touchbuf)); + + if (err || touchbuf != 0) { +- dev_warn(dev, "Failed to set touchbuf, trying to get err:%x\n", err); ++ dev_warn(dev, "Failed to set touchbuf, trying to get err:%x\n", ++ err); + dma_free_coherent(dev, PAGE_SIZE, ts->ts_base, ts->bus_addr); + ts->ts_base = 0; + ts->bus_addr = 0; + } + + if (!ts->ts_base) { +- dev_warn(dev, "set failed, trying get (err:%d touchbuf:%x virt:%p bus:%x)\n", err, touchbuf, ts->ts_base, ts->bus_addr); +- +- err = rpi_firmware_property(fw, RPI_FIRMWARE_FRAMEBUFFER_GET_TOUCHBUF, +- &touchbuf, sizeof(touchbuf)); ++ dev_warn(dev, ++ "set failed, trying get (err:%d touchbuf:%x virt:%p bus:%x)\n", ++ err, touchbuf, ts->ts_base, ts->bus_addr); ++ ++ err = rpi_firmware_property( ++ fw, ++ RPI_FIRMWARE_FRAMEBUFFER_GET_TOUCHBUF, ++ &touchbuf, sizeof(touchbuf)); + if (err) { + dev_err(dev, "Failed to get touch buffer\n"); + goto out; +@@ -188,11 +238,10 @@ static int ft5406_probe(struct platform_device *pdev) + + dev_dbg(dev, "Got TS buffer 0x%x\n", touchbuf); + +- // mmap the physical memory ++ /* mmap the physical memory */ + touchbuf &= ~0xc0000000; + ts->ts_base = ioremap(touchbuf, sizeof(struct ft5406_regs)); +- if (ts->ts_base == NULL) +- { ++ if (ts->ts_base == NULL) { + dev_err(dev, "Failed to map physical address\n"); + err = -ENOMEM; + goto out; +@@ -200,22 +249,46 @@ static int ft5406_probe(struct platform_device *pdev) + } + platform_set_drvdata(pdev, ts); + ts->pdev = pdev; +- ++ + ts->input_dev->name = "FT5406 memory based driver"; +- ++ ++ if (of_property_read_u32(np, "touchscreen-size-x", &val) >= 0) ++ ts->max_x = val; ++ else ++ ts->max_x = DEFAULT_SCREEN_WIDTH; ++ ++ if (of_property_read_u32(np, "touchscreen-size-y", &val) >= 0) ++ ts->max_y = val; ++ else ++ ts->max_y = DEFAULT_SCREEN_HEIGHT; ++ ++ if (of_property_read_u32(np, "touchscreen-inverted-x", &val) >= 0) ++ ts->hflip = val; ++ ++ if (of_property_read_u32(np, "touchscreen-inverted-y", &val) >= 0) ++ ts->vflip = val; ++ ++ if (of_property_read_u32(np, "touchscreen-swapped-x-y", &val) >= 0) ++ ts->xyswap = val; ++ ++ dev_dbg(dev, ++ "Touchscreen parameters (%d,%d), hflip=%d, vflip=%d, xyswap=%d", ++ ts->max_x, ts->max_y, ts->hflip, ts->vflip, ts->xyswap); ++ + __set_bit(EV_KEY, ts->input_dev->evbit); + __set_bit(EV_SYN, ts->input_dev->evbit); + __set_bit(EV_ABS, ts->input_dev->evbit); + + input_set_abs_params(ts->input_dev, ABS_MT_POSITION_X, 0, +- SCREEN_WIDTH, 0, 0); ++ ts->xyswap ? ts->max_y : ts->max_x, 0, 0); + input_set_abs_params(ts->input_dev, ABS_MT_POSITION_Y, 0, +- SCREEN_HEIGHT, 0, 0); ++ ts->xyswap ? ts->max_x : ts->max_y, 0, 0); + +- input_mt_init_slots(ts->input_dev, MAXIMUM_SUPPORTED_POINTS, INPUT_MT_DIRECT); ++ input_mt_init_slots(ts->input_dev, ++ MAXIMUM_SUPPORTED_POINTS, INPUT_MT_DIRECT); + + input_set_drvdata(ts->input_dev, ts); +- ++ + err = input_register_device(ts->input_dev); + if (err) { + dev_err(dev, "could not register input device, %d\n", +@@ -223,10 +296,9 @@ static int ft5406_probe(struct platform_device *pdev) + goto out; + } + +- // create thread to poll the touch events ++ /* create thread that polls the touch events */ + ts->thread = kthread_run(ft5406_thread, ts, "ft5406"); +- if(ts->thread == NULL) +- { ++ if (ts->thread == NULL) { + dev_err(dev, "Failed to create kernel thread"); + err = -ENOMEM; + goto out; +@@ -254,9 +326,9 @@ static int ft5406_remove(struct platform_device *pdev) + { + struct device *dev = &pdev->dev; + struct ft5406 *ts = (struct ft5406 *) platform_get_drvdata(pdev); +- ++ + dev_info(dev, "Removing rpi-ft5406\n"); +- ++ + kthread_stop(ts->thread); + + if (ts->bus_addr) +@@ -265,7 +337,7 @@ static int ft5406_remove(struct platform_device *pdev) + iounmap(ts->ts_base); + if (ts->input_dev) + input_unregister_device(ts->input_dev); +- ++ + return 0; + } + + +From b28a8559ccdd30ace0466b10e4b7e64a958af989 Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 21 Nov 2017 13:28:17 +0000 +Subject: [PATCH 170/171] configs: Regenerate defconfigs (cosmetic) + +Regenerate the defconfigs to make it easier to spot real functional +changes. This has no functional impact - the resulting .configs +are identical - so is essentially cosmetic. + +Signed-off-by: Phil Elwell +--- + arch/arm/configs/bcm2709_defconfig | 44 +++++++++++++++++--------------------- + arch/arm/configs/bcmrpi_defconfig | 44 +++++++++++++++++--------------------- + 2 files changed, 40 insertions(+), 48 deletions(-) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 63d4b769d3164996d3968c5ca1f872f214840a5a..32d8ea0e2de4157dc273dc1b054552ff770d0739 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -43,7 +43,6 @@ CONFIG_ARCH_BCM2835=y + CONFIG_SMP=y + CONFIG_VMSPLIT_2G=y + CONFIG_PREEMPT_VOLUNTARY=y +-CONFIG_AEABI=y + # CONFIG_CPU_SW_DOMAIN_PAN is not set + CONFIG_CLEANCACHE=y + CONFIG_FRONTSWAP=y +@@ -363,20 +362,6 @@ CONFIG_CAN_VCAN=m + CONFIG_CAN_SLCAN=m + CONFIG_CAN_MCP251X=m + CONFIG_CAN_GS_USB=m +-CONFIG_IRDA=m +-CONFIG_IRLAN=m +-CONFIG_IRNET=m +-CONFIG_IRCOMM=m +-CONFIG_IRDA_ULTRA=y +-CONFIG_IRDA_CACHE_LAST_LSAP=y +-CONFIG_IRDA_FAST_RR=y +-CONFIG_IRTTY_SIR=m +-CONFIG_KINGSUN_DONGLE=m +-CONFIG_KSDAZZLE_DONGLE=m +-CONFIG_KS959_DONGLE=m +-CONFIG_USB_IRDA=m +-CONFIG_SIGMATEL_FIR=m +-CONFIG_MCS_FIR=m + CONFIG_BT=m + CONFIG_BT_RFCOMM=m + CONFIG_BT_RFCOMM_TTY=y +@@ -388,7 +373,6 @@ CONFIG_BT_6LOWPAN=m + CONFIG_BT_HCIBTUSB=m + CONFIG_BT_HCIUART=m + CONFIG_BT_HCIUART_3WIRE=y +-CONFIG_BT_HCIUART_BCM=y + CONFIG_BT_HCIBCM203X=m + CONFIG_BT_HCIBPA10X=m + CONFIG_BT_HCIBFUSB=m +@@ -652,7 +636,6 @@ CONFIG_W1_SLAVE_DS2760=m + CONFIG_W1_SLAVE_DS2780=m + CONFIG_W1_SLAVE_DS2781=m + CONFIG_W1_SLAVE_DS28E04=m +-CONFIG_W1_SLAVE_BQ27000=m + CONFIG_POWER_RESET=y + CONFIG_POWER_RESET_GPIO=y + CONFIG_BATTERY_DS2760=m +@@ -678,13 +661,6 @@ CONFIG_REGULATOR=y + CONFIG_REGULATOR_FIXED_VOLTAGE=m + CONFIG_REGULATOR_ARIZONA_LDO1=m + CONFIG_REGULATOR_ARIZONA_MICSUPP=m +-CONFIG_MEDIA_SUPPORT=m +-CONFIG_MEDIA_CAMERA_SUPPORT=y +-CONFIG_MEDIA_ANALOG_TV_SUPPORT=y +-CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y +-CONFIG_MEDIA_RADIO_SUPPORT=y +-CONFIG_MEDIA_RC_SUPPORT=y +-CONFIG_MEDIA_CONTROLLER=y + CONFIG_LIRC=m + CONFIG_RC_DEVICES=y + CONFIG_RC_ATI_REMOTE=m +@@ -698,6 +674,12 @@ CONFIG_RC_LOOPBACK=m + CONFIG_IR_GPIO_CIR=m + CONFIG_IR_GPIO_TX=m + CONFIG_IR_PWM_TX=m ++CONFIG_MEDIA_SUPPORT=m ++CONFIG_MEDIA_CAMERA_SUPPORT=y ++CONFIG_MEDIA_ANALOG_TV_SUPPORT=y ++CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y ++CONFIG_MEDIA_RADIO_SUPPORT=y ++CONFIG_MEDIA_CONTROLLER=y + CONFIG_MEDIA_USB_SUPPORT=y + CONFIG_USB_VIDEO_CLASS=m + CONFIG_USB_M5602=m +@@ -1128,6 +1110,20 @@ CONFIG_DMA_BCM2708=y + CONFIG_UIO=m + CONFIG_UIO_PDRV_GENIRQ=m + CONFIG_STAGING=y ++CONFIG_IRDA=m ++CONFIG_IRLAN=m ++CONFIG_IRNET=m ++CONFIG_IRCOMM=m ++CONFIG_IRDA_ULTRA=y ++CONFIG_IRDA_CACHE_LAST_LSAP=y ++CONFIG_IRDA_FAST_RR=y ++CONFIG_IRTTY_SIR=m ++CONFIG_KINGSUN_DONGLE=m ++CONFIG_KSDAZZLE_DONGLE=m ++CONFIG_KS959_DONGLE=m ++CONFIG_USB_IRDA=m ++CONFIG_SIGMATEL_FIR=m ++CONFIG_MCS_FIR=m + CONFIG_PRISM2_USB=m + CONFIG_R8712U=m + CONFIG_R8188EU=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 656475a7e6ecd5004417a3157732271402b50139..f999d60bf2fc90f947d046235004618ddaa0f6fe 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -41,7 +41,6 @@ CONFIG_ARCH_BCM=y + CONFIG_ARCH_BCM2835=y + # CONFIG_CACHE_L2X0 is not set + CONFIG_PREEMPT_VOLUNTARY=y +-CONFIG_AEABI=y + # CONFIG_CPU_SW_DOMAIN_PAN is not set + CONFIG_CLEANCACHE=y + CONFIG_FRONTSWAP=y +@@ -358,20 +357,6 @@ CONFIG_CAN_VCAN=m + CONFIG_CAN_SLCAN=m + CONFIG_CAN_MCP251X=m + CONFIG_CAN_GS_USB=m +-CONFIG_IRDA=m +-CONFIG_IRLAN=m +-CONFIG_IRNET=m +-CONFIG_IRCOMM=m +-CONFIG_IRDA_ULTRA=y +-CONFIG_IRDA_CACHE_LAST_LSAP=y +-CONFIG_IRDA_FAST_RR=y +-CONFIG_IRTTY_SIR=m +-CONFIG_KINGSUN_DONGLE=m +-CONFIG_KSDAZZLE_DONGLE=m +-CONFIG_KS959_DONGLE=m +-CONFIG_USB_IRDA=m +-CONFIG_SIGMATEL_FIR=m +-CONFIG_MCS_FIR=m + CONFIG_BT=m + CONFIG_BT_RFCOMM=m + CONFIG_BT_RFCOMM_TTY=y +@@ -383,7 +368,6 @@ CONFIG_BT_6LOWPAN=m + CONFIG_BT_HCIBTUSB=m + CONFIG_BT_HCIUART=m + CONFIG_BT_HCIUART_3WIRE=y +-CONFIG_BT_HCIUART_BCM=y + CONFIG_BT_HCIBCM203X=m + CONFIG_BT_HCIBPA10X=m + CONFIG_BT_HCIBFUSB=m +@@ -645,7 +629,6 @@ CONFIG_W1_SLAVE_DS2760=m + CONFIG_W1_SLAVE_DS2780=m + CONFIG_W1_SLAVE_DS2781=m + CONFIG_W1_SLAVE_DS28E04=m +-CONFIG_W1_SLAVE_BQ27000=m + CONFIG_POWER_RESET=y + CONFIG_POWER_RESET_GPIO=y + CONFIG_BATTERY_DS2760=m +@@ -671,13 +654,6 @@ CONFIG_REGULATOR=y + CONFIG_REGULATOR_FIXED_VOLTAGE=m + CONFIG_REGULATOR_ARIZONA_LDO1=m + CONFIG_REGULATOR_ARIZONA_MICSUPP=m +-CONFIG_MEDIA_SUPPORT=m +-CONFIG_MEDIA_CAMERA_SUPPORT=y +-CONFIG_MEDIA_ANALOG_TV_SUPPORT=y +-CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y +-CONFIG_MEDIA_RADIO_SUPPORT=y +-CONFIG_MEDIA_RC_SUPPORT=y +-CONFIG_MEDIA_CONTROLLER=y + CONFIG_LIRC=m + CONFIG_RC_DEVICES=y + CONFIG_RC_ATI_REMOTE=m +@@ -691,6 +667,12 @@ CONFIG_RC_LOOPBACK=m + CONFIG_IR_GPIO_CIR=m + CONFIG_IR_GPIO_TX=m + CONFIG_IR_PWM_TX=m ++CONFIG_MEDIA_SUPPORT=m ++CONFIG_MEDIA_CAMERA_SUPPORT=y ++CONFIG_MEDIA_ANALOG_TV_SUPPORT=y ++CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y ++CONFIG_MEDIA_RADIO_SUPPORT=y ++CONFIG_MEDIA_CONTROLLER=y + CONFIG_MEDIA_USB_SUPPORT=y + CONFIG_USB_VIDEO_CLASS=m + CONFIG_USB_M5602=m +@@ -1134,6 +1116,20 @@ CONFIG_DMA_BCM2708=y + CONFIG_UIO=m + CONFIG_UIO_PDRV_GENIRQ=m + CONFIG_STAGING=y ++CONFIG_IRDA=m ++CONFIG_IRLAN=m ++CONFIG_IRNET=m ++CONFIG_IRCOMM=m ++CONFIG_IRDA_ULTRA=y ++CONFIG_IRDA_CACHE_LAST_LSAP=y ++CONFIG_IRDA_FAST_RR=y ++CONFIG_IRTTY_SIR=m ++CONFIG_KINGSUN_DONGLE=m ++CONFIG_KSDAZZLE_DONGLE=m ++CONFIG_KS959_DONGLE=m ++CONFIG_USB_IRDA=m ++CONFIG_SIGMATEL_FIR=m ++CONFIG_MCS_FIR=m + CONFIG_PRISM2_USB=m + CONFIG_R8712U=m + CONFIG_R8188EU=m + +From a879ddf7b1815763a8a3bbfe3f68bb7fd3450c13 Mon Sep 17 00:00:00 2001 +From: notro +Date: Thu, 10 Jul 2014 13:59:47 +0200 +Subject: [PATCH 171/171] pinctrl-bcm2835: Set base to 0 give expected gpio + numbering + +Signed-off-by: Noralf Tronnes +--- + drivers/pinctrl/bcm/pinctrl-bcm2835.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c +index ff782445dfb75d1a8af9eed775b8e8f7b275fee3..786efcddb5e56a06baf67cb91ddbbd8eec4b2e16 100644 +--- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c ++++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c +@@ -362,7 +362,7 @@ static const struct gpio_chip bcm2835_gpio_chip = { + .get_direction = bcm2835_gpio_get_direction, + .get = bcm2835_gpio_get, + .set = bcm2835_gpio_set, +- .base = -1, ++ .base = 0, + .ngpio = BCM2835_NUM_GPIOS, + .can_sleep = false, + };