From c2bcdd339a14428fabc933e81a9000960f2af13f Mon Sep 17 00:00:00 2001 From: MilhouseVH Date: Fri, 14 Jul 2017 21:30:56 +0100 Subject: [PATCH] RPi: update linux support patch for linux 4.12-rc2 --- .../patches/linux/linux-01-RPi_support.patch | 14373 ++++------------ 1 file changed, 3599 insertions(+), 10774 deletions(-) diff --git a/projects/RPi/patches/linux/linux-01-RPi_support.patch b/projects/RPi/patches/linux/linux-01-RPi_support.patch index 2e12203906..6c2c59ff51 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 20278316131bfe95842b29dc22d7667c190bcbf4 Mon Sep 17 00:00:00 2001 +From 151f1cdedd02433972d8f09fc709bc6b87afdde6 Mon Sep 17 00:00:00 2001 From: Steve Glendinning Date: Thu, 19 Feb 2015 18:47:12 +0000 -Subject: [PATCH 001/201] smsx95xx: fix crimes against truesize +Subject: [PATCH 001/134] 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. @@ -13,7 +13,7 @@ Signed-off-by: Steve Glendinning 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c -index 5f19fb0f025d9449d0ba20958610e0d1f083f032..ed28f1c3e1d0f2559a62a1c28993794497730c5d 100644 +index 765400b62168436b278d8a09fa0dd1fd8566bcb7..1d31e182f035c6acddc9bc34ad71e5a6a0516213 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c @@ -82,6 +82,10 @@ static bool turbo_mode = true; @@ -27,7 +27,7 @@ index 5f19fb0f025d9449d0ba20958610e0d1f083f032..ed28f1c3e1d0f2559a62a1c289937944 static int __must_check __smsc95xx_read_reg(struct usbnet *dev, u32 index, u32 *data, int in_pm) { -@@ -1951,7 +1955,8 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb) +@@ -1952,7 +1956,8 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb) if (dev->net->features & NETIF_F_RXCSUM) smsc95xx_rx_csum_offload(skb); skb_trim(skb, skb->len - 4); /* remove fcs */ @@ -37,7 +37,7 @@ index 5f19fb0f025d9449d0ba20958610e0d1f083f032..ed28f1c3e1d0f2559a62a1c289937944 return 1; } -@@ -1969,7 +1974,8 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb) +@@ -1970,7 +1975,8 @@ static int smsc95xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb) if (dev->net->features & NETIF_F_RXCSUM) smsc95xx_rx_csum_offload(ax_skb); skb_trim(ax_skb, ax_skb->len - 4); /* remove fcs */ @@ -48,10 +48,10 @@ index 5f19fb0f025d9449d0ba20958610e0d1f083f032..ed28f1c3e1d0f2559a62a1c289937944 usbnet_skb_return(dev, ax_skb); } -From 761ebb6af56c48b7cf18b0c70488aac0dc10cda0 Mon Sep 17 00:00:00 2001 +From 02788c82626f3775b96256af81a24ad0c19bbaac Mon Sep 17 00:00:00 2001 From: Sam Nazarko Date: Fri, 1 Apr 2016 17:27:21 +0100 -Subject: [PATCH 002/201] smsc95xx: Experimental: Enable turbo_mode and +Subject: [PATCH 002/134] smsc95xx: Experimental: Enable turbo_mode and packetsize=2560 by default See: http://forum.kodi.tv/showthread.php?tid=285288 @@ -60,7 +60,7 @@ See: http://forum.kodi.tv/showthread.php?tid=285288 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c -index ed28f1c3e1d0f2559a62a1c28993794497730c5d..f758e122c65685799d4aeeb1c3e6ca81df0d7980 100644 +index 1d31e182f035c6acddc9bc34ad71e5a6a0516213..1d5d4f77f3fe73c32804e52de46e91360ee4e64a 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c @@ -86,6 +86,10 @@ static bool truesize_mode = false; @@ -94,10 +94,10 @@ index ed28f1c3e1d0f2559a62a1c28993794497730c5d..f758e122c65685799d4aeeb1c3e6ca81 netif_dbg(dev, ifup, dev->net, "rx_urb_size=%ld\n", -From ca1638fbd8faa78debcbeaa50b402da20cfed273 Mon Sep 17 00:00:00 2001 +From 07cf10fed752d695f14cb35a948e68e92fa4d340 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 17:26:38 +0000 -Subject: [PATCH 003/201] Allow mac address to be set in smsc95xx +Subject: [PATCH 003/134] Allow mac address to be set in smsc95xx Signed-off-by: popcornmix --- @@ -105,7 +105,7 @@ Signed-off-by: popcornmix 1 file changed, 56 insertions(+) diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c -index f758e122c65685799d4aeeb1c3e6ca81df0d7980..f6661e388f6e801c1b88e48a3b71407bd70cf56e 100644 +index 1d5d4f77f3fe73c32804e52de46e91360ee4e64a..c60e5dff69f4522909e1a75a6e06df15f872d905 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c @@ -60,6 +60,7 @@ @@ -193,10 +193,58 @@ index f758e122c65685799d4aeeb1c3e6ca81df0d7980..f6661e388f6e801c1b88e48a3b71407b eth_hw_addr_random(dev->net); netif_dbg(dev, ifup, dev->net, "MAC address set to eth_random_addr\n"); -From ad9d133762cd075a8aeeb8a8d0a0825f1a856d69 Mon Sep 17 00:00:00 2001 +From 8a8c187ae0da77762b1d8ca2a5f99927dad640ba Mon Sep 17 00:00:00 2001 +From: Nisar Sayed +Date: Tue, 9 May 2017 18:51:42 +0100 +Subject: [PATCH 004/134] According to RFC 2460, IPv6 UDP calculated checksum + yields a result of zero must be changed to 0xffff, however this feature is + not supported by smsc95xx family hence enable csum offload only for IPv4 + TCP/UDP packets. + +Signed-off-by: Nisar Sayed + +Reported-by: popcorn mix +--- + drivers/net/usb/smsc95xx.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c +index c60e5dff69f4522909e1a75a6e06df15f872d905..ee4945f55f4151790acbf82649a876743458e4df 100644 +--- a/drivers/net/usb/smsc95xx.c ++++ b/drivers/net/usb/smsc95xx.c +@@ -694,7 +694,7 @@ static int smsc95xx_set_features(struct net_device *netdev, + if (ret < 0) + return ret; + +- if (features & NETIF_F_HW_CSUM) ++ if (features & NETIF_F_IP_CSUM) + read_buf |= Tx_COE_EN_; + else + read_buf &= ~Tx_COE_EN_; +@@ -1343,12 +1343,16 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf) + + spin_lock_init(&pdata->mac_cr_lock); + ++ /* RFC 2460, IPv6 UDP calculated checksum yields a result of zero must be ++ * changed to 0xffff, this feature is not supported by smsc95xx family, ++ * hence enable csum offload only for IPv4 TCP/UDP packets. ++ */ + if (DEFAULT_TX_CSUM_ENABLE) +- dev->net->features |= NETIF_F_HW_CSUM; ++ dev->net->features |= NETIF_F_IP_CSUM; + if (DEFAULT_RX_CSUM_ENABLE) + dev->net->features |= NETIF_F_RXCSUM; + +- dev->net->hw_features = NETIF_F_HW_CSUM | NETIF_F_RXCSUM; ++ dev->net->hw_features = NETIF_F_IP_CSUM | NETIF_F_RXCSUM; + + smsc95xx_init_mac_address(dev); + + +From 89e5adf945d832ee26ebca55d9c7a046727dc7b2 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 13 Mar 2015 12:43:36 +0000 -Subject: [PATCH 004/201] Protect __release_resource against resources without +Subject: [PATCH 005/134] Protect __release_resource against resources without parents Without this patch, removing a device tree overlay can crash here. @@ -224,10 +272,10 @@ index 9b5f04404152c296af3a96132f27cfc80ffa9af9..f8a9af6e6b915812be2ba2c1c2b40106 for (;;) { tmp = *p; -From 56336cd7e5739e00412172508478c1e4d35d2a3c Mon Sep 17 00:00:00 2001 +From 4f90100cc5566f59a0d99965b1be9bcc4d6f2e32 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 18 Dec 2014 16:07:15 -0800 -Subject: [PATCH 005/201] mm: Remove the PFN busy warning +Subject: [PATCH 006/134] mm: Remove the PFN busy warning See commit dae803e165a11bc88ca8dbc07a11077caf97bbcb -- the warning is expected sometimes when using CMA. However, that commit still spams @@ -239,10 +287,10 @@ Signed-off-by: Eric Anholt 1 file changed, 2 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c -index a2019fc9d94df3af9cf2c5ce1a476949c6822efc..5e6e1815923f212f5c1b1d1a213b0b12778997d4 100644 +index f9e450c6b6e414d61b00d5a61be9cdea3b773e1b..c8ce217418ac59358d35281c787608e94bc28164 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -7529,8 +7529,6 @@ int alloc_contig_range(unsigned long start, unsigned long end, +@@ -7554,8 +7554,6 @@ int alloc_contig_range(unsigned long start, unsigned long end, /* Make sure the range is really isolated. */ if (test_pages_isolated(outer_start, end, false)) { @@ -252,10 +300,10 @@ index a2019fc9d94df3af9cf2c5ce1a476949c6822efc..5e6e1815923f212f5c1b1d1a213b0b12 goto done; } -From f2a49d496dfdcb0dd77243743e7de0684b5c8272 Mon Sep 17 00:00:00 2001 +From fa34513c7d30d1cd409758b55dd48fc654cba2b4 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 4 Dec 2015 17:41:50 +0000 -Subject: [PATCH 006/201] irq-bcm2836: Prevent spurious interrupts, and trap +Subject: [PATCH 007/134] irq-bcm2836: Prevent spurious interrupts, and trap them early The old arch-specific IRQ macros included a dsb to ensure the @@ -282,10 +330,10 @@ index e7463e3c08143acae3e8cc5682f918c6a0b07ebd..a8db33b50ad9ff83d284fa54fe4d3b65 #endif } else if (stat) { -From a8e58f02935a910e75f1704d5cd274ee971ac596 Mon Sep 17 00:00:00 2001 +From 9e0a35dd45ec6c7c2df27bdcd435930d464b01d5 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 9 Feb 2017 14:33:30 +0000 -Subject: [PATCH 007/201] irq-bcm2836: Avoid "Invalid trigger warning" +Subject: [PATCH 008/134] irq-bcm2836: Avoid "Invalid trigger warning" Initialise the level for each IRQ to avoid a warning from the arm arch timer code. @@ -309,10 +357,10 @@ index a8db33b50ad9ff83d284fa54fe4d3b65f859df0f..c4e151451cf8c8ebde5225515eac2786 static void -From f38b4d4c94ade17f1f58ffa7300b098e61181905 Mon Sep 17 00:00:00 2001 +From 424c8124b155d6a2b3b5a0aba076977eab5784dd 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/201] irqchip: bcm2835: Add FIQ support +Subject: [PATCH 009/134] irqchip: bcm2835: Add FIQ support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -330,7 +378,7 @@ Acked-by: Stephen Warren 2 files changed, 47 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-bcm/Kconfig b/arch/arm/mach-bcm/Kconfig -index a0e66d8200c5cf8f2ea592abf870a32800213fa2..4ff30d5278a7ce093c9629d4c25d37e3bbbda752 100644 +index f9389c5910e76bad8353744137a7360a0c549b56..307fcf9c9d92c1e9eee5111260997cbc5514b5fc 100644 --- a/arch/arm/mach-bcm/Kconfig +++ b/arch/arm/mach-bcm/Kconfig @@ -152,6 +152,7 @@ config ARCH_BCM2835 @@ -441,10 +489,10 @@ index 44d7c38dde479d771f3552e914bf8c1c1f5019f7..42ff5e6a8e0d532f5b60a1e7af7cc4d9 } -From 800cfbde7ae832011d35b7396a96b64c36616f6f Mon Sep 17 00:00:00 2001 +From c25be4bf3ce8a3eaf60cb567e726dad889129514 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/201] irqchip: irq-bcm2835: Add 2836 FIQ support +Subject: [PATCH 010/134] irqchip: irq-bcm2835: Add 2836 FIQ support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -543,10 +591,10 @@ index 42ff5e6a8e0d532f5b60a1e7af7cc4d941bd5008..eccf6ed025299cb480884f5bcbe77abf for (b = 0; b < NR_BANKS; b++) { for (i = 0; i < bank_irqs[b]; i++) { -From bf599aed441cc61910096206385111a18d7047f8 Mon Sep 17 00:00:00 2001 +From 4ef30a14db1099aa4b4fd238d2e836b72ed03c7a Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Jul 2015 10:26:09 +0100 -Subject: [PATCH 010/201] spidev: Add "spidev" compatible string to silence +Subject: [PATCH 011/134] spidev: Add "spidev" compatible string to silence warning See: https://github.com/raspberrypi/linux/issues/1054 @@ -555,22 +603,22 @@ See: https://github.com/raspberrypi/linux/issues/1054 1 file changed, 1 insertion(+) diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c -index 9e2e099baf8ca5cc6510912a36d4ca03daeb8273..e59640942826db2ea14d0bde0ff5ab22ec34c9dd 100644 +index 9a2a79a871ba009fcfa8b7e2b52002c8845d94ce..4ffd24e8c50fd0df03cbb1257448c2020be5a696 100644 --- a/drivers/spi/spidev.c +++ b/drivers/spi/spidev.c -@@ -697,6 +697,7 @@ static const struct of_device_id spidev_dt_ids[] = { - { .compatible = "rohm,dh2228fv" }, +@@ -698,6 +698,7 @@ static const struct of_device_id spidev_dt_ids[] = { { .compatible = "lineartechnology,ltc2488" }, { .compatible = "ge,achc" }, + { .compatible = "semtech,sx1301" }, + { .compatible = "spidev" }, {}, }; MODULE_DEVICE_TABLE(of, spidev_dt_ids); -From 7673cc0f54874e6f8e2cdfa7fcf40df8c077484b Mon Sep 17 00:00:00 2001 +From dc5cb8060f11d984f0517ee99732d85371be04d3 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 3 Jan 2017 18:25:01 +0000 -Subject: [PATCH 011/201] Revert "pinctrl: bcm2835: switch to GPIOLIB_IRQCHIP" +Subject: [PATCH 012/134] Revert "pinctrl: bcm2835: switch to GPIOLIB_IRQCHIP" This reverts commit 85ae9e512f437cd09bf61564bdba29ab88bab3e3. --- @@ -864,10 +912,10 @@ index 85d0091128644c446aed878e87769e82c77c3ebf..4f2621272bfd5cbc0d691d2fabe89e2e if (IS_ERR(pc->pctl_dev)) { gpiochip_remove(&pc->gpio_chip); -From 5dd1c337a345c07c7f1c07d47d0b3f94c200950b Mon Sep 17 00:00:00 2001 +From 58375107998b87b0b9cd8f8371d8589eebc210c7 Mon Sep 17 00:00:00 2001 From: notro Date: Thu, 10 Jul 2014 13:59:47 +0200 -Subject: [PATCH 012/201] pinctrl-bcm2835: Set base to 0 give expected gpio +Subject: [PATCH 013/134] pinctrl-bcm2835: Set base to 0 give expected gpio numbering Signed-off-by: Noralf Tronnes @@ -889,10 +937,10 @@ index 4f2621272bfd5cbc0d691d2fabe89e2ee428d6db..5b7cb4c415e19f98e25b221ab0ad36b6 .can_sleep = false, }; -From 507616a5a22f3da7279bda3c6971ab86d58a8140 Mon Sep 17 00:00:00 2001 +From 1f3c2d0d1983bfc72bc615f422c792f2fed61925 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 26 Feb 2015 09:58:22 +0000 -Subject: [PATCH 013/201] pinctrl-bcm2835: Only request the interrupts listed +Subject: [PATCH 014/134] pinctrl-bcm2835: Only request the interrupts listed in the DTB Although the GPIO controller can generate three interrupts (four counting @@ -919,10 +967,10 @@ index 5b7cb4c415e19f98e25b221ab0ad36b6885dae4c..6351fe7f8e314ac5ebb102dd20847b38 pc->irq_data[i].irqgroup = i; -From 442de0bfaf7cb2c384f59581e8cc9af8b47ab902 Mon Sep 17 00:00:00 2001 +From a3a31ac4fa08364279ab630c06ae80429a327f2e Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 24 Jun 2015 14:10:44 +0100 -Subject: [PATCH 014/201] spi-bcm2835: Support pin groups other than 7-11 +Subject: [PATCH 015/134] 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 @@ -1003,10 +1051,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 47914f8321040a07fad7fc6a7cf9857acdbc545c Mon Sep 17 00:00:00 2001 +From 8e9ee7ba491be80c51b33b31cf4593b8ff7388f6 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 1 Jul 2016 22:09:24 +0100 -Subject: [PATCH 015/201] spi-bcm2835: Disable forced software CS +Subject: [PATCH 016/134] 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 @@ -1040,10 +1088,10 @@ index 5dfe20ffc2866fa6789825016c585175a29705b6..8493474d286f7a1ac6454a22c61c8c2c return 0; } -From 4def4f07f743b195c8a3a2aa6d44a6b286583164 Mon Sep 17 00:00:00 2001 +From 50ed462f7576dca3909075b35956a86f1a39d41e Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 8 Nov 2016 21:35:38 +0000 -Subject: [PATCH 016/201] spi-bcm2835: Remove unused code +Subject: [PATCH 017/134] spi-bcm2835: Remove unused code --- drivers/spi/spi-bcm2835.c | 61 ----------------------------------------------- @@ -1131,10 +1179,10 @@ index 8493474d286f7a1ac6454a22c61c8c2cef9121bf..33d75ad38a7f77d085321ace9101900a } -From 7f706be85eb351684e6b54d9df79cfc733dafe7d Mon Sep 17 00:00:00 2001 +From 8a9ac0088a172630bb0f932c561a56ac5c124ea3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Wed, 3 Jun 2015 12:26:13 +0200 -Subject: [PATCH 017/201] ARM: bcm2835: Set Serial number and Revision +Subject: [PATCH 018/134] ARM: bcm2835: Set Serial number and Revision MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -1187,10 +1235,10 @@ index 0c1edfc98696da0e0bb7f4a18cdfbcdd27a9795d..8f152266ba9b470df2eaaed9ebcf158e static const char * const bcm2835_compat[] = { -From d528a0d0d4a9392494440e5e3b8b948669b2a24e Mon Sep 17 00:00:00 2001 +From bc4115257eaca267c6622bbd81bffe970edefd4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Sat, 3 Oct 2015 22:22:55 +0200 -Subject: [PATCH 018/201] dmaengine: bcm2835: Load driver early and support +Subject: [PATCH 019/134] dmaengine: bcm2835: Load driver early and support legacy API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -1208,7 +1256,7 @@ Signed-off-by: Noralf Trønnes 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig -index d01d59812cf3ec8f171e09641ae2c1c787e0de06..a754288fb8bec3dafea4952f5133703f4e42f7df 100644 +index 24e8597b2c3ed3fa6857c2e1aa9cc191c2cad2e2..3b3d2c56ae7a57ec41722a060c1a93b0a61c5e98 100644 --- a/drivers/dma/Kconfig +++ b/drivers/dma/Kconfig @@ -108,7 +108,7 @@ config COH901318 @@ -1293,10 +1341,10 @@ index 6204cc32d09c5096df8aec304c3c37b3bcb6be44..599c218dc8a73172dd4bd4a058fc8f95 MODULE_ALIAS("platform:bcm2835-dma"); MODULE_DESCRIPTION("BCM2835 DMA engine driver"); -From cc5d82404cfa8caa7d2e3678e8013a88dc32ebd0 Mon Sep 17 00:00:00 2001 +From bfa88b454e0f0b0ddb755ffa43bd64edb06f7286 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 25 Jan 2016 17:25:12 +0000 -Subject: [PATCH 019/201] firmware: Updated mailbox header +Subject: [PATCH 020/134] firmware: Updated mailbox header --- include/soc/bcm2835/raspberrypi-firmware.h | 9 +++++++++ @@ -1357,10 +1405,10 @@ index cb979ad90401e299344dd5fae38d09c489d8bd58..30fb37fe175df604a738258a2a632bca RPI_FIRMWARE_VCHIQ_INIT = 0x00048010, -From 739dd74ff040de02d0858227249a0e7fecdcb14c Mon Sep 17 00:00:00 2001 +From c30970cbe8c00f9e201b9140f5ac97a62ef7b58d Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 15 Jun 2016 16:48:41 +0100 -Subject: [PATCH 020/201] rtc: Add SPI alias for pcf2123 driver +Subject: [PATCH 021/134] rtc: Add SPI alias for pcf2123 driver Without this alias, Device Tree won't cause the driver to be loaded. @@ -1380,10 +1428,10 @@ index 8895f77726e8da5444afcd602dceff8f25a9b3fd..1833b8853ceb0e6147cceb93a00e558c MODULE_LICENSE("GPL"); +MODULE_ALIAS("spi:rtc-pcf2123"); -From 79f3c0a2d9073c75ec0e84741a0bcceb264191b6 Mon Sep 17 00:00:00 2001 +From 0542aaf3934044e4a63c367a7af9256d37ad2490 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= Date: Fri, 7 Oct 2016 16:50:59 +0200 -Subject: [PATCH 021/201] watchdog: bcm2835: Support setting reboot partition +Subject: [PATCH 022/134] watchdog: bcm2835: Support setting reboot partition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -1485,10 +1533,10 @@ index b339e0e67b4c1275fd4992fea4f1e24c0575b783..26b7177573fac2af1cd4ab5488d2686f static int bcm2835_wdt_probe(struct platform_device *pdev) -From 4186ebaea8431e07dfc3b7947b2d2476bf93500a Mon Sep 17 00:00:00 2001 +From 07b1d7154c123edc365b7d97b2dca7f1168a490a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 5 Apr 2016 19:40:12 +0100 -Subject: [PATCH 022/201] reboot: Use power off rather than busy spinning when +Subject: [PATCH 023/134] reboot: Use power off rather than busy spinning when halt is requested --- @@ -1496,10 +1544,10 @@ Subject: [PATCH 022/201] reboot: Use power off rather than busy spinning when 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/arm/kernel/reboot.c b/arch/arm/kernel/reboot.c -index 3fa867a2aae672755c6ce6448f4148c989dbf964..80dca8dcd6709034b643c6a3f35729e00fb59a19 100644 +index 3b2aa9a9fe268d45335f781c4aa22cf573753a1b..0180d89a34af45c56243fe0f17fbe20932e02489 100644 --- a/arch/arm/kernel/reboot.c +++ b/arch/arm/kernel/reboot.c -@@ -102,9 +102,7 @@ void machine_shutdown(void) +@@ -105,9 +105,7 @@ void machine_shutdown(void) */ void machine_halt(void) { @@ -1511,10 +1559,10 @@ index 3fa867a2aae672755c6ce6448f4148c989dbf964..80dca8dcd6709034b643c6a3f35729e0 /* -From 920e6a0139b4250c6344cbd614e7d82814409f1a Mon Sep 17 00:00:00 2001 +From ef22d31211b4cc4d4b7a8cd6ee891c03c9d8ab24 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 9 Nov 2016 13:02:52 +0000 -Subject: [PATCH 023/201] bcm: Make RASPBERRYPI_POWER depend on PM +Subject: [PATCH 024/134] bcm: Make RASPBERRYPI_POWER depend on PM --- drivers/soc/bcm/Kconfig | 1 + @@ -1533,10 +1581,10 @@ index a39b0d58ddd0fdf0ac1cc7295f8aafb12546e226..e037a6dd79d1881a09e3ca9115782709 help This enables support for the RPi power domains which can be enabled -From e00442399414e1e44a7535883cf2087d285934ee Mon Sep 17 00:00:00 2001 +From a27c8fd916df10ed7fe883276015014d05bb2368 Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Fri, 2 Sep 2016 16:45:27 +0100 -Subject: [PATCH 024/201] Register the clocks early during the boot process, so +Subject: [PATCH 025/134] 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. @@ -1581,10 +1629,10 @@ index 02585387061967ac9408e18ac1bce67e9e9414c0..283d2de45e4f29406d01f24ab1cae3f9 MODULE_AUTHOR("Eric Anholt "); MODULE_DESCRIPTION("BCM2835 clock driver"); -From a723ecec42ae1c0f0882eb978640ac553fedab7e Mon Sep 17 00:00:00 2001 +From e19f2d167c6bc1022ea8b27af6a94d49e78dedf0 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 6 Dec 2016 17:05:39 +0000 -Subject: [PATCH 025/201] bcm2835-rng: Avoid initialising if already enabled +Subject: [PATCH 026/134] bcm2835-rng: Avoid initialising if already enabled Avoids the 0x40000 cycles of warmup again if firmware has already used it --- @@ -1610,17 +1658,17 @@ index 574211a495491d9d6021dcaefe4274a63ed02055..e66c0fca8c6090e32f72796c0877a1cf err = hwrng_register(&bcm2835_rng_ops); if (err) { -From 455a0f93fef080d51f305707ccdf2a7084ee2544 Mon Sep 17 00:00:00 2001 +From e067ae0b929429a6fe4dcb9f34964f6ea7e52178 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 24 Aug 2016 16:28:44 +0100 -Subject: [PATCH 026/201] kbuild: Ignore dtco targets when filtering symbols +Subject: [PATCH 027/134] kbuild: Ignore dtco targets when filtering symbols --- scripts/Kbuild.include | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include -index afe3fd3af1e40616857b3e6c425be632c1fa2667..b2bbad417f0c4499a5f49081c8f996b97b01e867 100644 +index 61f87a99bf0a1c512e572d3cbdcf4b4b5d7ae785..0a5e36778eacf7dc589486f8bc8033f57d1adc6e 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -288,7 +288,7 @@ ksym_dep_filter = \ @@ -1633,10 +1681,10 @@ index afe3fd3af1e40616857b3e6c425be632c1fa2667..b2bbad417f0c4499a5f49081c8f996b9 esac | tr ";" "\n" | sed -rn 's/^.*=== __KSYM_(.*) ===.*$$/KSYM_\1/p' -From d609dd84add98ccd1bc693acb959998779cece74 Mon Sep 17 00:00:00 2001 +From 26f794a4a1ec2fc5906fcc5b586cfd56d9baca0e Mon Sep 17 00:00:00 2001 From: Robert Tiemann Date: Mon, 20 Jul 2015 11:01:25 +0200 -Subject: [PATCH 027/201] BCM2835_DT: Fix I2S register map +Subject: [PATCH 028/134] BCM2835_DT: Fix I2S register map --- Documentation/devicetree/bindings/dma/brcm,bcm2835-dma.txt | 4 ++-- @@ -1674,10 +1722,10 @@ index 65783de0aedf3da79adc36fd077b7a89954ddb6b..a89fe4220fdc3f26f75ee66daf187554 dmas = <&dma 2>, <&dma 3>; -From 84e3e9af12067b590147e12345109e25bad548a4 Mon Sep 17 00:00:00 2001 +From 3356cc64087a7f9e79c7f1917950a8c63bcea4ab Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Feb 2017 17:20:08 +0000 -Subject: [PATCH 028/201] clk-bcm2835: Mark used PLLs and dividers CRITICAL +Subject: [PATCH 029/134] 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 @@ -1705,10 +1753,10 @@ index 283d2de45e4f29406d01f24ab1cae3f9f879234a..85df8c74a309f0b877ef65f1c55b086f divider->data = data; -From 393d33092d03271aac594f1da67d7b1ae09460e4 Mon Sep 17 00:00:00 2001 +From 9010e5cb1843ecc8211dc47ce0b8a6de814c2b37 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 13 Feb 2017 17:20:08 +0000 -Subject: [PATCH 029/201] clk-bcm2835: Add claim-clocks property +Subject: [PATCH 030/134] 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, @@ -1810,10 +1858,10 @@ index 85df8c74a309f0b877ef65f1c55b086f1bb774a1..eec6735505c074c0a76ae647bf0e1bb6 sizeof(cprman_parent_names)); of_clk_parent_fill(dev->of_node, cprman->real_parent_names, -From 556dabe8344299fd67ddcdbaccedc05ad51adf4b Mon Sep 17 00:00:00 2001 +From 25d50a982e06e003f5eb1ba2b572322a8ce58870 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 1 Mar 2017 16:06:53 +0000 -Subject: [PATCH 030/201] clk-bcm2835: Correct the prediv logic +Subject: [PATCH 031/134] clk-bcm2835: Correct the prediv logic If a clock has the prediv flag set, both the integer and fractional parts must be scaled when calculating the resulting frequency. @@ -1840,10 +1888,10 @@ index eec6735505c074c0a76ae647bf0e1bb68ab3a488..e0d28add45efdf70d1eba590282a3a26 return bcm2835_pll_rate_from_divisors(parent_rate, ndiv, fdiv, pdiv); } -From 31d2e22e02adcfd37205b436d86ff7dc5446dd00 Mon Sep 17 00:00:00 2001 +From 784f4a932c22edf1a4f59b36712cc779a1276e25 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 6 Mar 2017 09:06:18 +0000 -Subject: [PATCH 031/201] clk-bcm2835: Read max core clock from firmware +Subject: [PATCH 032/134] 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 @@ -1958,10 +2006,10 @@ index e0d28add45efdf70d1eba590282a3a2654af328d..39f72da6ba1f6ec6ec41d5dc1bf46344 for (i = 0; !of_property_read_u32_index(pdev->dev.of_node, "claim-clocks", -From 7572e437a8ad3f1835cada2ce983dd4091b9099c Mon Sep 17 00:00:00 2001 +From c42a2992e8bc03bcd4c4a8aec6dc8a7349e36101 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 9 Feb 2017 14:36:44 +0000 -Subject: [PATCH 032/201] sound: Demote deferral errors to INFO level +Subject: [PATCH 033/134] 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. @@ -1974,7 +2022,7 @@ Signed-off-by: Phil Elwell 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c -index 98d60f471c5d705d383c5edca4850bd8facdd030..d2da3077fd980c846c1c86697f73c342b981485f 100644 +index aae099c0e50280d67f153d6769ac4237d531e169..de76fefb878bb2e6b71eb75bf62e8022960a6374 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1057,7 +1057,7 @@ static int soc_bind_dai_link(struct snd_soc_card *card, @@ -1996,10 +2044,10 @@ index 98d60f471c5d705d383c5edca4850bd8facdd030..d2da3077fd980c846c1c86697f73c342 goto _err_defer; } -From 03e93e82444fb14a5a05e2452b27f4cd2840a6f1 Mon Sep 17 00:00:00 2001 +From 58f7b0828a36fe21c74d8cdf84e4dee701b9af32 Mon Sep 17 00:00:00 2001 From: Claggy3 Date: Sat, 11 Feb 2017 14:00:30 +0000 -Subject: [PATCH 033/201] Update vfpmodule.c +Subject: [PATCH 034/134] 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 @@ -2136,10 +2184,10 @@ index a71a48e71fffa8626fe90106815376c44bbe679b..d6c0a5a0a5ae3510db3ace5e3f5d3410 /* * Save the userland NEON/VFP state. Under UP, -From 0c4ce6528dbca00148bebd7a0902954e4390efe5 Mon Sep 17 00:00:00 2001 +From a8b9f9851c3934173e3ad5cb11317ce74ee45f74 Mon Sep 17 00:00:00 2001 From: Matt Flax Date: Wed, 8 Mar 2017 21:13:24 +1100 -Subject: [PATCH 034/201] ASoC: bcm2835_i2s.c: relax the ch2 register setting +Subject: [PATCH 035/134] 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. @@ -2160,10 +2208,10 @@ index 6ba20498202ed36906b52096893a88867a79269f..56df7d8a43d0aac055a91b0d24aca8e1 format |= BCM2835_I2S_CH1(BCM2835_I2S_CHPOS(ch1pos)); format |= BCM2835_I2S_CH2(BCM2835_I2S_CHPOS(ch2pos)); -From d7ac9bc10aed6d94b50b3536e0f331114c5cf34b Mon Sep 17 00:00:00 2001 +From 4370581c73bbf8eaf89815d991f03fe2dc90ac1e 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 035/201] i2c: bcm2835: Add debug support +Subject: [PATCH 036/134] i2c: bcm2835: Add debug support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -2352,10 +2400,10 @@ index cd07a69e2e9355540442785f95e90823b05c9d10..47167f403cc8329bd811b47c7011c299 if (i2c_dev->msg_err & BCM2835_I2C_S_ERR) return -EREMOTEIO; -From 2895f28b44040322d3922e409e55c3d838a390ec Mon Sep 17 00:00:00 2001 +From c1b63aec64fb089a9e7035f9dd2a645e73ff3e8a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Sun, 12 May 2013 12:24:19 +0100 -Subject: [PATCH 036/201] Main bcm2708/bcm2709 linux port +Subject: [PATCH 037/134] Main bcm2708/bcm2709 linux port MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -2386,7 +2434,7 @@ Signed-off-by: Noralf Trønnes 5 files changed, 44 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-bcm/Kconfig b/arch/arm/mach-bcm/Kconfig -index 4ff30d5278a7ce093c9629d4c25d37e3bbbda752..333dc3c2e5ffbb2c5ab8fcfb6115b6162643cf20 100644 +index 307fcf9c9d92c1e9eee5111260997cbc5514b5fc..567601148318bf4a5fbc581d6c9881d9e190c409 100644 --- a/arch/arm/mach-bcm/Kconfig +++ b/arch/arm/mach-bcm/Kconfig @@ -155,6 +155,7 @@ config ARCH_BCM2835 @@ -2543,10 +2591,10 @@ index cfb4b4496dd9f61362dea012176c146120fada07..d9c6c217c4d6a2408abe2665bf7f2700 MODULE_AUTHOR("Lubomir Rintel "); MODULE_DESCRIPTION("BCM2835 mailbox IPC driver"); -From 40eb87366553984ff93c60c9dd047460a81b2215 Mon Sep 17 00:00:00 2001 +From f7b1d3eaa890eeebbcb88782c3cc96e93e4b8425 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 1 May 2013 19:46:17 +0100 -Subject: [PATCH 037/201] Add dwc_otg driver +Subject: [PATCH 038/134] Add dwc_otg driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -3052,6 +3100,76 @@ dwc_otg: fix summarize urb->actual_length for isochronous transfers Kernel does not copy input data of ISO transfers to userspace if actual_length is set only in ISO transfers and not summarized in urb->actual_length. Fixes raspberrypi/linux#903 + +fiq_fsm: Use correct states when starting isoc OUT transfers + +In fiq_fsm_start_next_periodic() if an isochronous OUT transfer +was selected, no regard was given as to whether this was a single-packet +transfer or a multi-packet staged transfer. + +For single-packet transfers, this had the effect of repeatedly sending +OUT packets with bogus data and lengths. + +Eventually if the channel was repeatedly enabled enough times, this +would lock up the OTG core and no further bus transfers would happen. + +Set the FSM state up properly if we select a single-packet transfer. + +Fixes https://github.com/raspberrypi/linux/issues/1842 + +dwc_otg: make nak_holdoff work as intended with empty queues + +If URBs reading from non-periodic split endpoints were dequeued and +the last transfer from the endpoint was a NAK handshake, the resulting +qh->nak_frame value was stale which would result in unnecessarily long +polling intervals for the first subsequent transfer with a fresh URB. + +Fixup qh->nak_frame in dwc_otg_hcd_urb_dequeue and also guard against +a case where a single URB is submitted to the endpoint, a NAK was +received on the transfer immediately prior to receiving data and the +device subsequently resubmits another URB past the qh->nak_frame interval. + +Fixes https://github.com/raspberrypi/linux/issues/1709 + +dwc_otg: fix split transaction data toggle handling around dequeues + +See https://github.com/raspberrypi/linux/issues/1709 + +Fix several issues regarding endpoint state when URBs are dequeued +- If the HCD is disconnected, flush FIQ-enabled channels properly +- Save the data toggle state for bulk endpoints if the last transfer + from an endpoint where URBs were dequeued returned a data packet +- Reset hc->start_pkt_count properly in assign_and_init_hc() + +dwc_otg: fix several potential crash sources + +On root port disconnect events, the host driver state is cleared and +in-progress host channels are forcibly stopped. This doesn't play +well with the FIQ running in the background, so: +- Guard the disconnect callback with both the host spinlock and FIQ + spinlock +- Move qtd dereference in dwc_otg_handle_hc_fsm() after the early-out + so we don't dereference a qtd that has gone away +- Turn catch-all BUG()s in dwc_otg_handle_hc_fsm() into warnings. + +dwc_otg: delete hcd->channel_lock + +The lock serves no purpose as it is only held while the HCD spinlock +is already being held. + +dwc_otg: remove unnecessary dma-mode channel halts on disconnect interrupt + +Host channels are already halted in kill_urbs_in_qh_list() with the +subsequent interrupt processing behaving as if the URB was dequeued +via HCD callback. + +There's no need to clobber the host channel registers a second time +as this exposes races between the driver and host channel resulting +in hcd->free_hc_list becoming corrupted. + +dwcotg: Allow to build without FIQ on ARM64 + +Signed-off-by: popcornmix --- arch/arm/include/asm/irqflags.h | 16 +- arch/arm/kernel/fiqasm.S | 4 + @@ -3097,21 +3215,21 @@ in urb->actual_length. Fixes raspberrypi/linux#903 drivers/usb/host/dwc_otg/dwc_otg_cfi.h | 320 + drivers/usb/host/dwc_otg/dwc_otg_cil.c | 7141 ++++++++++++++++++++ drivers/usb/host/dwc_otg/dwc_otg_cil.h | 1464 ++++ - drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c | 1594 +++++ + drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c | 1596 +++++ drivers/usb/host/dwc_otg/dwc_otg_core_if.h | 705 ++ drivers/usb/host/dwc_otg/dwc_otg_dbg.h | 117 + drivers/usb/host/dwc_otg/dwc_otg_driver.c | 1757 +++++ drivers/usb/host/dwc_otg/dwc_otg_driver.h | 86 + - drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c | 1355 ++++ + drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c | 1358 ++++ drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.h | 370 + drivers/usb/host/dwc_otg/dwc_otg_fiq_stub.S | 80 + - drivers/usb/host/dwc_otg/dwc_otg_hcd.c | 4260 ++++++++++++ - drivers/usb/host/dwc_otg/dwc_otg_hcd.h | 868 +++ - drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c | 1139 ++++ + drivers/usb/host/dwc_otg/dwc_otg_hcd.c | 4242 ++++++++++++ + drivers/usb/host/dwc_otg/dwc_otg_hcd.h | 867 +++ + drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c | 1134 ++++ drivers/usb/host/dwc_otg/dwc_otg_hcd_if.h | 417 ++ - drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c | 2727 ++++++++ + drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c | 2749 ++++++++ drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c | 1007 +++ - drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c | 963 +++ + drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c | 967 +++ drivers/usb/host/dwc_otg/dwc_otg_os_dep.h | 188 + drivers/usb/host/dwc_otg/dwc_otg_pcd.c | 2725 ++++++++ drivers/usb/host/dwc_otg/dwc_otg_pcd.h | 273 + @@ -3123,7 +3241,7 @@ in urb->actual_length. Fixes raspberrypi/linux#903 drivers/usb/host/dwc_otg/test/dwc_otg_test.pm | 337 + drivers/usb/host/dwc_otg/test/test_mod_param.pl | 133 + drivers/usb/host/dwc_otg/test/test_sysfs.pl | 193 + - 70 files changed, 59910 insertions(+), 16 deletions(-) + 70 files changed, 59917 insertions(+), 16 deletions(-) create mode 100644 drivers/usb/gadget/file_storage.c create mode 100644 drivers/usb/host/dwc_common_port/Makefile create mode 100644 drivers/usb/host/dwc_common_port/Makefile.fbsd @@ -3230,7 +3348,7 @@ index 8dd26e1a9bd69051a1548d99c157cad2e65ba81b..eef484756af2179be8acd76b9ddbd3e9 + mov pc, r8 +ENDPROC(__FIQ_Branch) diff --git a/drivers/usb/Makefile b/drivers/usb/Makefile -index 7791af6c102c7f4ea2c8ecdeda5cbc08fb03a55c..4f9e217700551a55b64b8ee8eaebbd8822741d4e 100644 +index 9650b351c26c7f2064facc118435cb1cea1b12ee..2acdb2b92f96d8a08c2472d903df5d88e7d0d476 100644 --- a/drivers/usb/Makefile +++ b/drivers/usb/Makefile @@ -7,6 +7,7 @@ @@ -3267,10 +3385,10 @@ index b8bb20d7acdb9f1480009605f10e2f5ae4045ec9..155d360a98b0db439d5d0e4e2997accf USB_PORT_FEAT_C_OVER_CURRENT); msleep(100); /* Cool down */ diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c -index 2184ef40a82ae494c11e82b4090545bd0dad30c8..39e932ea9a0e80aea29101ac5bb02f2fc35cae56 100644 +index 4c38ea41ae969e6fac8ced209a655957322ba36f..abb0d9b614f469a4fb356f47ca22fb9684fffa2f 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c -@@ -1908,6 +1908,85 @@ int usb_set_configuration(struct usb_device *dev, int configuration) +@@ -1909,6 +1909,85 @@ int usb_set_configuration(struct usb_device *dev, int configuration) if (cp->string == NULL && !(dev->quirks & USB_QUIRK_CONFIG_INTF_STRINGS)) cp->string = usb_cache_string(dev, cp->desc.iConfiguration); @@ -7196,7 +7314,7 @@ index 0000000000000000000000000000000000000000..a896d73f7a9336f5a34015c44ea5a6b0 +} +module_exit(fsg_cleanup); diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig -index 407d947b34ea5b524c467c7c992d9774ded5414a..ed0cd59de37e8f47369f86dba751c78933722abc 100644 +index ababb91d654ab2a7ee3885da9c35ae8465290013..e9a40ded5d11c4e2cc7309b303be08c0a98f2fd3 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig @@ -763,6 +763,19 @@ config USB_HWA_HCD @@ -7205,7 +7323,7 @@ index 407d947b34ea5b524c467c7c992d9774ded5414a..ed0cd59de37e8f47369f86dba751c789 +config USB_DWCOTG + tristate "Synopsis DWC host support" -+ depends on USB ++ depends on USB && (FIQ || ARM64) + help + The Synopsis DWC controller is a dual-role + host/peripheral/OTG ("On The Go") USB controllers. @@ -7220,10 +7338,10 @@ index 407d947b34ea5b524c467c7c992d9774ded5414a..ed0cd59de37e8f47369f86dba751c789 tristate "i.MX21 HCD support" depends on ARM && ARCH_MXC diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile -index 2644537b7bcfb5cc8452243838815d3aa5669409..d555089559bc2feef1a07f1f4147135f591bf087 100644 +index c77b0a38557b5bfcd6339302fc780ccdf9a14e35..f527fff7282e26c670fc6b3d9c8c273c0305d5ce 100644 --- a/drivers/usb/host/Makefile +++ b/drivers/usb/host/Makefile -@@ -75,6 +75,8 @@ obj-$(CONFIG_USB_SL811_CS) += sl811_cs.o +@@ -73,6 +73,8 @@ obj-$(CONFIG_USB_SL811_CS) += sl811_cs.o obj-$(CONFIG_USB_U132_HCD) += u132-hcd.o obj-$(CONFIG_USB_R8A66597_HCD) += r8a66597-hcd.o obj-$(CONFIG_USB_HWA_HCD) += hwa-hc.o @@ -32807,10 +32925,10 @@ index 0000000000000000000000000000000000000000..79dbf8374f023e262e3bfb755ff0f676 +#endif diff --git a/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c b/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c new file mode 100644 -index 0000000000000000000000000000000000000000..96c76e38cd372b8ca8c375ae8d8653f32a3faf80 +index 0000000000000000000000000000000000000000..9fb7229f43ae4561c9dc1980065381a48711ae41 --- /dev/null +++ b/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c -@@ -0,0 +1,1594 @@ +@@ -0,0 +1,1596 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_cil_intr.c $ + * $Revision: #32 $ @@ -33786,7 +33904,9 @@ index 0000000000000000000000000000000000000000..96c76e38cd372b8ca8c375ae8d8653f3 + } else { + if (core_if->op_state == A_HOST) { + /* A-Cable still connected but device disconnected. */ ++ DWC_SPINUNLOCK(core_if->lock); + cil_hcd_disconnect(core_if); ++ DWC_SPINLOCK(core_if->lock); + if (core_if->adp_enable) { + gpwrdn_data_t gpwrdn = { .d32 = 0 }; + cil_hcd_stop(core_if); @@ -37096,10 +37216,10 @@ index 0000000000000000000000000000000000000000..6a8be63a0ab20f4e1c56251b85648aa2 +#endif diff --git a/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c b/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c new file mode 100644 -index 0000000000000000000000000000000000000000..13047c08fb71cc6e44c66096720d4654d3f9e4e1 +index 0000000000000000000000000000000000000000..2035e0762dc6d60673c8fbc47a90b72254f50b69 --- /dev/null +++ b/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c -@@ -0,0 +1,1355 @@ +@@ -0,0 +1,1358 @@ +/* + * dwc_otg_fiq_fsm.c - The finite state machine FIQ + * @@ -37576,7 +37696,10 @@ index 0000000000000000000000000000000000000000..13047c08fb71cc6e44c66096720d4654 + if (st->channel[n].fsm == FIQ_PER_ISO_OUT_PENDING) { + if (!fiq_fsm_tt_in_use(st, num_channels, n)) { + fiq_print(FIQDBG_INT, st, "NEXTISO "); -+ st->channel[n].fsm = FIQ_PER_ISO_OUT_ACTIVE; ++ if (st->channel[n].nrpackets == 1) ++ st->channel[n].fsm = FIQ_PER_ISO_OUT_LAST; ++ else ++ st->channel[n].fsm = FIQ_PER_ISO_OUT_ACTIVE; + fiq_fsm_restart_channel(st, n, 0); + break; + } @@ -38919,10 +39042,10 @@ index 0000000000000000000000000000000000000000..ffa8d21bc61e893fee86ba04955587e7 +END(_dwc_otg_fiq_stub) diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c new file mode 100644 -index 0000000000000000000000000000000000000000..027414bb2bf9fc3f3652407724187f3c6dc5ff68 +index 0000000000000000000000000000000000000000..5e4d4ffe7966486d40a5b5e2423ac4df0de772a8 --- /dev/null +++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c -@@ -0,0 +1,4260 @@ +@@ -0,0 +1,4242 @@ + +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_hcd.c $ @@ -39118,10 +39241,13 @@ index 0000000000000000000000000000000000000000..027414bb2bf9fc3f3652407724187f3c + * It is possible that the channel has already halted + * but not yet been through the IRQ handler. + */ -+ dwc_otg_hc_halt(hcd->core_if, qh->channel, -+ DWC_OTG_HC_XFER_URB_DEQUEUE); -+ if(microframe_schedule) -+ hcd->available_host_channels++; ++ if (fiq_fsm_enable && (hcd->fiq_state->channel[qh->channel->hc_num].fsm != FIQ_PASSTHROUGH)) { ++ qh->channel->halt_status = DWC_OTG_HC_XFER_URB_DEQUEUE; ++ qh->channel->halt_pending = 1; ++ } else { ++ dwc_otg_hc_halt(hcd->core_if, qh->channel, ++ DWC_OTG_HC_XFER_URB_DEQUEUE); ++ } + qh->channel = NULL; + } + dwc_otg_hcd_qh_remove(hcd, qh); @@ -39210,13 +39336,16 @@ index 0000000000000000000000000000000000000000..027414bb2bf9fc3f3652407724187f3c + gintsts_data_t intr; + dwc_otg_hcd_t *dwc_otg_hcd = p; + ++ DWC_SPINLOCK(dwc_otg_hcd->lock); + /* + * Set status flags for the hub driver. + */ + dwc_otg_hcd->flags.b.port_connect_status_change = 1; + dwc_otg_hcd->flags.b.port_connect_status = 0; -+ if(fiq_enable) ++ if(fiq_enable) { + local_fiq_disable(); ++ fiq_fsm_spin_lock(&dwc_otg_hcd->fiq_state->lock); ++ } + /* + * Shutdown any transfers in process by clearing the Tx FIFO Empty + * interrupt mask and status bits and disabling subsequent host @@ -39286,47 +39415,23 @@ index 0000000000000000000000000000000000000000..027414bb2bf9fc3f3652407724187f3c + } + } + -+ for (i = 0; i < num_channels; i++) { -+ channel = dwc_otg_hcd->hc_ptr_array[i]; -+ if (DWC_CIRCLEQ_EMPTY_ENTRY(channel, hc_list_entry)) { -+ hc_regs = -+ dwc_otg_hcd->core_if->host_if->hc_regs[i]; -+ hcchar.d32 = DWC_READ_REG32(&hc_regs->hcchar); -+ if (hcchar.b.chen) { -+ /* Halt the channel. */ -+ hcchar.b.chdis = 1; -+ DWC_WRITE_REG32(&hc_regs->hcchar, -+ hcchar.d32); -+ } -+ -+ dwc_otg_hc_cleanup(dwc_otg_hcd->core_if, -+ channel); -+ DWC_CIRCLEQ_INSERT_TAIL -+ (&dwc_otg_hcd->free_hc_list, channel, -+ hc_list_entry); -+ /* -+ * Added for Descriptor DMA to prevent channel double cleanup -+ * in release_channel_ddma(). Which called from ep_disable -+ * when device disconnect. -+ */ -+ channel->qh = NULL; -+ } -+ } + if(fiq_fsm_enable) { + for(i=0; i < 128; i++) { + dwc_otg_hcd->hub_port[i] = 0; + } + } -+ + } + -+ if(fiq_enable) ++ if(fiq_enable) { ++ fiq_fsm_spin_unlock(&dwc_otg_hcd->fiq_state->lock); + local_fiq_enable(); ++ } + + if (dwc_otg_hcd->fops->disconnect) { + dwc_otg_hcd->fops->disconnect(dwc_otg_hcd); + } + ++ DWC_SPINUNLOCK(dwc_otg_hcd->lock); + return 1; +} + @@ -39541,7 +39646,7 @@ index 0000000000000000000000000000000000000000..027414bb2bf9fc3f3652407724187f3c + if (fiq_fsm_enable && (hcd->fiq_state->channel[n].fsm != FIQ_PASSTHROUGH)) { + qh->channel->halt_status = DWC_OTG_HC_XFER_URB_DEQUEUE; + qh->channel->halt_pending = 1; -+ hcd->fiq_state->channel[n].fsm = FIQ_DEQUEUE_ISSUED; ++ //hcd->fiq_state->channel[n].fsm = FIQ_DEQUEUE_ISSUED; + } else { + dwc_otg_hc_halt(hcd->core_if, qh->channel, + DWC_OTG_HC_XFER_URB_DEQUEUE); @@ -39559,6 +39664,8 @@ index 0000000000000000000000000000000000000000..027414bb2bf9fc3f3652407724187f3c + hcd->core_if->dma_desc_enable?"DMA ":""); + if (!hcd->core_if->dma_desc_enable) { + uint8_t b = urb_qtd->in_process; ++ if (nak_holdoff && qh->do_split && dwc_qh_is_non_per(qh)) ++ qh->nak_frame = 0xFFFF; + dwc_otg_hcd_qtd_remove_and_free(hcd, urb_qtd, qh); + if (b) { + dwc_otg_hcd_qh_deactivate(hcd, qh, 0); @@ -39849,7 +39956,6 @@ index 0000000000000000000000000000000000000000..027414bb2bf9fc3f3652407724187f3c + } else if (dwc_otg_hcd->status_buf != NULL) { + DWC_FREE(dwc_otg_hcd->status_buf); + } -+ DWC_SPINLOCK_FREE(dwc_otg_hcd->channel_lock); + DWC_SPINLOCK_FREE(dwc_otg_hcd->lock); + /* Set core_if's lock pointer to NULL */ + dwc_otg_hcd->core_if->lock = NULL; @@ -39880,10 +39986,8 @@ index 0000000000000000000000000000000000000000..027414bb2bf9fc3f3652407724187f3c + +#if (defined(DWC_LINUX) && defined(CONFIG_DEBUG_SPINLOCK)) + DWC_SPINLOCK_ALLOC_LINUX_DEBUG(hcd->lock); -+ DWC_SPINLOCK_ALLOC_LINUX_DEBUG(hcd->channel_lock); +#else + hcd->lock = DWC_SPINLOCK_ALLOC(); -+ hcd->channel_lock = DWC_SPINLOCK_ALLOC(); +#endif + DWC_DEBUGPL(DBG_HCDV, "init of HCD %p given core_if %p\n", + hcd, core_if); @@ -40189,6 +40293,7 @@ index 0000000000000000000000000000000000000000..027414bb2bf9fc3f3652407724187f3c + if (qh->do_split) { + uint32_t hub_addr, port_addr; + hc->do_split = 1; ++ hc->start_pkt_count = 1; + hc->xact_pos = qtd->isoc_split_pos; + /* We don't need to do complete splits anymore */ +// if(fiq_fsm_enable) @@ -40663,8 +40768,20 @@ index 0000000000000000000000000000000000000000..027414bb2bf9fc3f3652407724187f3c + int hub_addr, port_addr, frame, uframe; + struct fiq_channel_state *st = &hcd->fiq_state->channel[hc->hc_num]; + -+ if (st->fsm != FIQ_PASSTHROUGH) ++ /* ++ * Non-periodic channel assignments stay in the non_periodic_active queue. ++ * Therefore we get repeatedly called until the FIQ's done processing this channel. ++ */ ++ if (qh->channel->xfer_started == 1) + return 0; ++ ++ if (st->fsm != FIQ_PASSTHROUGH) { ++ pr_warn_ratelimited("%s:%d: Queue called for an active channel\n", __func__, __LINE__); ++ return 0; ++ } ++ ++ qh->channel->xfer_started = 1; ++ + st->nr_errors = 0; + + st->hcchar_copy.d32 = 0; @@ -40891,7 +41008,6 @@ index 0000000000000000000000000000000000000000..027414bb2bf9fc3f3652407724187f3c + dwc_otg_qh_t *qh; + int num_channels; + dwc_irqflags_t flags; -+ dwc_spinlock_t *channel_lock = hcd->channel_lock; + dwc_otg_transaction_type_e ret_val = DWC_OTG_TRANSACTION_NONE; + +#ifdef DEBUG_HOST_CHANNELS @@ -40910,13 +41026,10 @@ index 0000000000000000000000000000000000000000..027414bb2bf9fc3f3652407724187f3c + + if (microframe_schedule) { + // Make sure we leave one channel for non periodic transactions. -+ DWC_SPINLOCK_IRQSAVE(channel_lock, &flags); + if (hcd->available_host_channels <= 1) { -+ DWC_SPINUNLOCK_IRQRESTORE(channel_lock, flags); + break; + } + hcd->available_host_channels--; -+ DWC_SPINUNLOCK_IRQRESTORE(channel_lock, flags); +#ifdef DEBUG_HOST_CHANNELS + last_sel_trans_num_per_scheduled++; +#endif /* DEBUG_HOST_CHANNELS */ @@ -40929,10 +41042,8 @@ index 0000000000000000000000000000000000000000..027414bb2bf9fc3f3652407724187f3c + * periodic assigned schedule. + */ + qh_ptr = DWC_LIST_NEXT(qh_ptr); -+ DWC_SPINLOCK_IRQSAVE(channel_lock, &flags); + DWC_LIST_MOVE_HEAD(&hcd->periodic_sched_assigned, + &qh->qh_list_entry); -+ DWC_SPINUNLOCK_IRQRESTORE(channel_lock, flags); + } + + /* @@ -40970,13 +41081,10 @@ index 0000000000000000000000000000000000000000..027414bb2bf9fc3f3652407724187f3c + } + + if (microframe_schedule) { -+ DWC_SPINLOCK_IRQSAVE(channel_lock, &flags); + if (hcd->available_host_channels < 1) { -+ DWC_SPINUNLOCK_IRQRESTORE(channel_lock, flags); + break; + } + hcd->available_host_channels--; -+ DWC_SPINUNLOCK_IRQRESTORE(channel_lock, flags); +#ifdef DEBUG_HOST_CHANNELS + last_sel_trans_num_nonper_scheduled++; +#endif /* DEBUG_HOST_CHANNELS */ @@ -40989,11 +41097,8 @@ index 0000000000000000000000000000000000000000..027414bb2bf9fc3f3652407724187f3c + * non-periodic active schedule. + */ + qh_ptr = DWC_LIST_NEXT(qh_ptr); -+ DWC_SPINLOCK_IRQSAVE(channel_lock, &flags); + DWC_LIST_MOVE_HEAD(&hcd->non_periodic_sched_active, + &qh->qh_list_entry); -+ DWC_SPINUNLOCK_IRQRESTORE(channel_lock, flags); -+ + + if (!microframe_schedule) + hcd->non_periodic_channels++; @@ -43185,10 +43290,10 @@ index 0000000000000000000000000000000000000000..027414bb2bf9fc3f3652407724187f3c +#endif /* DWC_DEVICE_ONLY */ diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd.h b/drivers/usb/host/dwc_otg/dwc_otg_hcd.h new file mode 100644 -index 0000000000000000000000000000000000000000..4539cd7b802d3e49ac9a6cb3f1d88b475a1ace16 +index 0000000000000000000000000000000000000000..7f7e9eaffd6a3c3d898855562fbec11289f77f53 --- /dev/null +++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd.h -@@ -0,0 +1,868 @@ +@@ -0,0 +1,867 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_hcd.h $ + * $Revision: #58 $ @@ -43759,7 +43864,6 @@ index 0000000000000000000000000000000000000000..4539cd7b802d3e49ac9a6cb3f1d88b47 + + /* */ + dwc_spinlock_t *lock; -+ dwc_spinlock_t *channel_lock; + /** + * Private data that could be used by OS wrapper. + */ @@ -44059,10 +44163,10 @@ index 0000000000000000000000000000000000000000..4539cd7b802d3e49ac9a6cb3f1d88b47 +#endif /* DWC_DEVICE_ONLY */ diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c new file mode 100644 -index 0000000000000000000000000000000000000000..126e99ab2fc43f11d89a08ff0476181ead84029f +index 0000000000000000000000000000000000000000..bd8a20403713442f6748137d6b5de67e94c3893f --- /dev/null +++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c -@@ -0,0 +1,1139 @@ +@@ -0,0 +1,1134 @@ +/*========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_hcd_ddma.c $ + * $Revision: #10 $ @@ -44344,17 +44448,12 @@ index 0000000000000000000000000000000000000000..126e99ab2fc43f11d89a08ff0476181e + +static void release_channel_ddma(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh) +{ -+ dwc_irqflags_t flags; -+ dwc_spinlock_t *channel_lock = hcd->channel_lock; -+ + dwc_hc_t *hc = qh->channel; + if (dwc_qh_is_non_per(qh)) { -+ DWC_SPINLOCK_IRQSAVE(channel_lock, &flags); + if (!microframe_schedule) + hcd->non_periodic_channels--; + else + hcd->available_host_channels++; -+ DWC_SPINUNLOCK_IRQRESTORE(channel_lock, flags); + } else + update_frame_list(hcd, qh, 0); + @@ -45627,10 +45726,10 @@ index 0000000000000000000000000000000000000000..fb57db09378f4ab95d57cb58aa570a91 +#endif /* DWC_DEVICE_ONLY */ diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c new file mode 100644 -index 0000000000000000000000000000000000000000..e6b38ac330b72152204c2a6879c20f0ce02ac2e5 +index 0000000000000000000000000000000000000000..fc52495e4749f45dcf270c1c22960f163b6dc86d --- /dev/null +++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c -@@ -0,0 +1,2727 @@ +@@ -0,0 +1,2749 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_hcd_intr.c $ + * $Revision: #89 $ @@ -46577,7 +46676,6 @@ index 0000000000000000000000000000000000000000..e6b38ac330b72152204c2a6879c20f0c + dwc_otg_transaction_type_e tr_type; + int free_qtd; + dwc_irqflags_t flags; -+ dwc_spinlock_t *channel_lock = hcd->channel_lock; + + int hog_port = 0; + @@ -46666,11 +46764,8 @@ index 0000000000000000000000000000000000000000..e6b38ac330b72152204c2a6879c20f0c + break; + } + } else { -+ -+ DWC_SPINLOCK_IRQSAVE(channel_lock, &flags); + hcd->available_host_channels++; + fiq_print(FIQDBG_INT, hcd->fiq_state, "AHC = %d ", hcd->available_host_channels); -+ DWC_SPINUNLOCK_IRQRESTORE(channel_lock, flags); + } + + /* Try to queue more transfers now that there's a free channel. */ @@ -48006,23 +48101,35 @@ index 0000000000000000000000000000000000000000..e6b38ac330b72152204c2a6879c20f0c +{ + struct fiq_channel_state *st = &hcd->fiq_state->channel[num]; + dwc_hc_t *hc = hcd->hc_ptr_array[num]; -+ dwc_otg_qtd_t *qtd = DWC_CIRCLEQ_FIRST(&hc->qh->qtd_list); -+ dwc_otg_qh_t *qh = hc->qh; ++ dwc_otg_qtd_t *qtd; + dwc_otg_hc_regs_t *hc_regs = hcd->core_if->host_if->hc_regs[num]; + hcint_data_t hcint = hcd->fiq_state->channel[num].hcint_copy; ++ hctsiz_data_t hctsiz = hcd->fiq_state->channel[num].hctsiz_copy; + int hostchannels = 0; + fiq_print(FIQDBG_INT, hcd->fiq_state, "OUT %01d %01d ", num , st->fsm); + + hostchannels = hcd->available_host_channels; ++ if (hc->halt_pending) { ++ /* Dequeue: The FIQ was allowed to complete the transfer but state has been cleared. */ ++ if (hc->qh && st->fsm == FIQ_NP_SPLIT_DONE && ++ hcint.b.xfercomp && hc->qh->ep_type == UE_BULK) { ++ if (hctsiz.b.pid == DWC_HCTSIZ_DATA0) { ++ hc->qh->data_toggle = DWC_OTG_HC_PID_DATA1; ++ } else { ++ hc->qh->data_toggle = DWC_OTG_HC_PID_DATA0; ++ } ++ } ++ release_channel(hcd, hc, NULL, hc->halt_status); ++ return; ++ } ++ ++ qtd = DWC_CIRCLEQ_FIRST(&hc->qh->qtd_list); + switch (st->fsm) { + case FIQ_TEST: + break; + + case FIQ_DEQUEUE_ISSUED: -+ /* hc_halt was called. QTD no longer exists. */ -+ /* TODO: for a nonperiodic split transaction, need to issue a -+ * CLEAR_TT_BUFFER hub command if we were in the start-split phase. -+ */ ++ /* Handled above, but keep for posterity */ + release_channel(hcd, hc, NULL, hc->halt_status); + break; + @@ -48035,6 +48142,11 @@ index 0000000000000000000000000000000000000000..e6b38ac330b72152204c2a6879c20f0c + handle_hc_xfercomp_intr(hcd, hc, hc_regs, qtd); + } else if (hcint.b.nak) { + handle_hc_nak_intr(hcd, hc, hc_regs, qtd); ++ } else { ++ DWC_WARN("Unexpected IRQ state on FSM transaction:" ++ "dev_addr=%d ep=%d fsm=%d, hcint=0x%08x\n", ++ hc->dev_addr, hc->ep_num, st->fsm, hcint.d32); ++ release_channel(hcd, hc, qtd, DWC_OTG_HC_XFER_NO_HALT_STATUS); + } + break; + @@ -48050,8 +48162,10 @@ index 0000000000000000000000000000000000000000..e6b38ac330b72152204c2a6879c20f0c + } else if (hcint.b.ahberr) { + handle_hc_ahberr_intr(hcd, hc, hc_regs, qtd); + } else { -+ local_fiq_disable(); -+ BUG(); ++ DWC_WARN("Unexpected IRQ state on FSM transaction:" ++ "dev_addr=%d ep=%d fsm=%d, hcint=0x%08x\n", ++ hc->dev_addr, hc->ep_num, st->fsm, hcint.d32); ++ release_channel(hcd, hc, qtd, DWC_OTG_HC_XFER_NO_HALT_STATUS); + } + break; + @@ -48067,8 +48181,10 @@ index 0000000000000000000000000000000000000000..e6b38ac330b72152204c2a6879c20f0c + } else if (hcint.b.ahberr) { + handle_hc_ahberr_intr(hcd, hc, hc_regs, qtd); + } else { -+ local_fiq_disable(); -+ BUG(); ++ DWC_WARN("Unexpected IRQ state on FSM transaction:" ++ "dev_addr=%d ep=%d fsm=%d, hcint=0x%08x\n", ++ hc->dev_addr, hc->ep_num, st->fsm, hcint.d32); ++ release_channel(hcd, hc, qtd, DWC_OTG_HC_XFER_NO_HALT_STATUS); + } + break; + @@ -48126,7 +48242,7 @@ index 0000000000000000000000000000000000000000..e6b38ac330b72152204c2a6879c20f0c + } else { + frame_desc->status = 0; + /* Unswizzle dma */ -+ len = dwc_otg_fiq_unsetup_per_dma(hcd, qh, qtd, num); ++ len = dwc_otg_fiq_unsetup_per_dma(hcd, hc->qh, qtd, num); + frame_desc->actual_length = len; + } + qtd->isoc_frame_index++; @@ -48188,7 +48304,7 @@ index 0000000000000000000000000000000000000000..e6b38ac330b72152204c2a6879c20f0c + * The status is recorded as the interrupt state should the transaction + * fail. + */ -+ dwc_otg_fiq_unmangle_isoc(hcd, qh, qtd, num); ++ dwc_otg_fiq_unmangle_isoc(hcd, hc->qh, qtd, num); + hcd->fops->complete(hcd, qtd->urb->priv, qtd->urb, 0); + release_channel(hcd, hc, qtd, DWC_OTG_HC_XFER_URB_COMPLETE); + break; @@ -48271,10 +48387,15 @@ index 0000000000000000000000000000000000000000..e6b38ac330b72152204c2a6879c20f0c + hc = dwc_otg_hcd->hc_ptr_array[num]; + hc_regs = dwc_otg_hcd->core_if->host_if->hc_regs[num]; + if(hc->halt_status == DWC_OTG_HC_XFER_URB_DEQUEUE) { -+ /* We are responding to a channel disable. Driver -+ * state is cleared - our qtd has gone away. ++ /* A dequeue was issued for this transfer. Our QTD has gone away ++ * but in the case of a FIQ transfer, the transfer would have run ++ * to completion. + */ -+ release_channel(dwc_otg_hcd, hc, NULL, hc->halt_status); ++ if (fiq_fsm_enable && dwc_otg_hcd->fiq_state->channel[num].fsm != FIQ_PASSTHROUGH) { ++ dwc_otg_hcd_handle_hc_fsm(dwc_otg_hcd, num); ++ } else { ++ release_channel(dwc_otg_hcd, hc, NULL, hc->halt_status); ++ } + return 1; + } + qtd = DWC_CIRCLEQ_FIRST(&hc->qh->qtd_list); @@ -49373,10 +49494,10 @@ index 0000000000000000000000000000000000000000..96ec6338bbcb8ebe69a233d21a4b9d24 +#endif /* DWC_DEVICE_ONLY */ diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c new file mode 100644 -index 0000000000000000000000000000000000000000..c2dff94e8e6edd22e4427aaa1eac7aad972cb6bd +index 0000000000000000000000000000000000000000..85a6d431ca54b47dc10573aa72d1ad69d06f2e36 --- /dev/null +++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c -@@ -0,0 +1,963 @@ +@@ -0,0 +1,967 @@ +/* ========================================================================== + * $File: //dwh/usb_iip/dev/software/otg/linux/drivers/dwc_otg_hcd_queue.c $ + * $Revision: #44 $ @@ -50172,6 +50293,10 @@ index 0000000000000000000000000000000000000000..c2dff94e8e6edd22e4427aaa1eac7aad + /* Add back to inactive non-periodic schedule. */ + dwc_otg_hcd_qh_add(hcd, qh); + //hcd->fiq_state->kick_np_queues = 1; ++ } else { ++ if(nak_holdoff && qh->do_split) { ++ qh->nak_frame = 0xFFFF; ++ } + } + } else { + uint16_t frame_number = dwc_otg_hcd_get_frame_number(hcd); @@ -63611,34 +63736,10 @@ index 0000000000000000000000000000000000000000..cdc9963176e5a4a0d5250613b61e26c5 +test_main(); +0; -From ba7ddd1bab280b8bb631527782640f1947a73170 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Wed, 10 May 2017 12:47:46 +0100 -Subject: [PATCH 038/201] dwcotg: Allow to build without FIQ on ARM64 - -Signed-off-by: popcornmix ---- - drivers/usb/host/Kconfig | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig -index ed0cd59de37e8f47369f86dba751c78933722abc..53aedbe9727ca5c34e46f5cf998f14c7ee7f0ff6 100644 ---- a/drivers/usb/host/Kconfig -+++ b/drivers/usb/host/Kconfig -@@ -765,7 +765,7 @@ config USB_HWA_HCD - - config USB_DWCOTG - tristate "Synopsis DWC host support" -- depends on USB -+ depends on USB && (FIQ || ARM64) - help - The Synopsis DWC controller is a dual-role - host/peripheral/OTG ("On The Go") USB controllers. - -From b43f62b159ddb125a2a6018caec6d456b0a661a8 Mon Sep 17 00:00:00 2001 +From b197cc2131091ff673a2a415fc13bf347f8c665a Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 17:06:34 +0100 -Subject: [PATCH 039/201] bcm2708 framebuffer driver +Subject: [PATCH 039/134] bcm2708 framebuffer driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -63720,7 +63821,7 @@ Signed-off-by: Noralf Trønnes create mode 100644 drivers/video/fbdev/bcm2708_fb.c diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig -index 922e4eaed9c5b5278572a79eb1cfc14e267a8bd5..2fae1676fafc16900d56622e3eef887e27b01eed 100644 +index 5c6696bb56da89d1ca86f00f16c3c408303ca5ad..7b44601d1c58007cdb3adafdf5f3c33a0801b8c6 100644 --- a/drivers/video/fbdev/Kconfig +++ b/drivers/video/fbdev/Kconfig @@ -236,6 +236,20 @@ config FB_TILEBLITTING @@ -67097,10 +67198,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 78418ecc0a58dff14b3c7040a13170b06cb840a8 Mon Sep 17 00:00:00 2001 +From 7949539f234107a0875b70076d2f9dbbf9778fce Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 14:22:53 +0100 -Subject: [PATCH 040/201] dmaengine: Add support for BCM2708 +Subject: [PATCH 040/134] dmaengine: Add support for BCM2708 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -67259,7 +67360,7 @@ bcm2708-dmaengine - Fix arm64 portability/build issues create mode 100644 include/linux/platform_data/dma-bcm2708.h diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig -index a754288fb8bec3dafea4952f5133703f4e42f7df..5485ce0b2004d87e0ac012e2559479b1f7da28e5 100644 +index 3b3d2c56ae7a57ec41722a060c1a93b0a61c5e98..45a7ee981b7f7f8cec6eada56e3f4ff4b63cabe1 100644 --- a/drivers/dma/Kconfig +++ b/drivers/dma/Kconfig @@ -108,7 +108,7 @@ config COH901318 @@ -67280,8 +67381,8 @@ index a754288fb8bec3dafea4952f5133703f4e42f7df..5485ce0b2004d87e0ac012e2559479b1 + depends on DMA_BCM2835 + config TI_CPPI41 - tristate "AM33xx CPPI41 DMA support" - depends on ARCH_OMAP + tristate "CPPI 4.1 DMA support" + depends on (ARCH_OMAP || ARCH_DAVINCI_DA8XX) diff --git a/drivers/dma/Makefile b/drivers/dma/Makefile index 0b723e94d9e6d3751d1ceea4509b173cbd84b458..a114b110fc2277615ca2e3f4c58a9a20166ee58b 100644 --- a/drivers/dma/Makefile @@ -67731,10 +67832,10 @@ index 0000000000000000000000000000000000000000..c5bfff2765be4606077e6c8af73040ec + +#endif /* _PLAT_BCM2708_DMA_H */ -From 93472c5a3219c12e889901146f958b63a930bcef Mon Sep 17 00:00:00 2001 +From 6b2a39b5cd66235715c52f1622a46d3156ad9b4d Mon Sep 17 00:00:00 2001 From: gellert Date: Fri, 15 Aug 2014 16:35:06 +0100 -Subject: [PATCH 041/201] MMC: added alternative MMC driver +Subject: [PATCH 041/134] MMC: added alternative MMC driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -67824,7 +67925,7 @@ Signed-off-by: Phil Elwell create mode 100644 drivers/mmc/host/bcm2835-mmc.c diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig -index f08691a58d7e02220e8a3ef7d6c552eef7c2a79d..77142222a730b76d46a2492fef8f6f1773072687 100644 +index 2db84dd664d7616f5fc07bd12a794b822f72b1fb..ac2376b7324473f2cf888b800d79552ce489eff9 100644 --- a/drivers/mmc/host/Kconfig +++ b/drivers/mmc/host/Kconfig @@ -4,6 +4,35 @@ @@ -67864,7 +67965,7 @@ index f08691a58d7e02220e8a3ef7d6c552eef7c2a79d..77142222a730b76d46a2492fef8f6f17 tristate "ARM AMBA Multimedia Card Interface support" depends on ARM_AMBA diff --git a/drivers/mmc/host/Makefile b/drivers/mmc/host/Makefile -index 6d548c4ee2fa311ce75b02bbbdd3ca53e9d68788..c987038c9f3a1cea98931efe868c933b767c1664 100644 +index 926347c2eeb49709a567928e9b31971b73e219d9..00ceba92f1057a14aae1f22907fd37ea4504e521 100644 --- a/drivers/mmc/host/Makefile +++ b/drivers/mmc/host/Makefile @@ -18,6 +18,7 @@ obj-$(CONFIG_MMC_SDHCI_S3C) += sdhci-s3c.o @@ -69456,10 +69557,10 @@ index 0000000000000000000000000000000000000000..4fe8d1fe44578fbefcd48f8c327ba3d0 +MODULE_LICENSE("GPL v2"); +MODULE_AUTHOR("Gellert Weisz"); -From 8e9dc81807ebc5bfcd14e73212cdf17792ae395b Mon Sep 17 00:00:00 2001 +From 29038a5057584d723dc05c759f2b5139f7faa668 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 25 Mar 2015 17:49:47 +0000 -Subject: [PATCH 042/201] Adding bcm2835-sdhost driver, and an overlay to +Subject: [PATCH 042/134] Adding bcm2835-sdhost driver, and an overlay to enable it BCM2835 has two SD card interfaces. This driver uses the other one. @@ -69618,16 +69719,22 @@ Also: See: https://github.com/raspberrypi/linux/pull/1492 +Signed-off-by: Phil Elwell + +bcm2835-sdhost: mmc_card_blockaddr fix + +Get the definition of mmc_card_blockaddr from drivers/mmc/core/card.h. + Signed-off-by: Phil Elwell --- drivers/mmc/host/Kconfig | 10 + drivers/mmc/host/Makefile | 1 + - drivers/mmc/host/bcm2835-sdhost.c | 2189 +++++++++++++++++++++++++++++++++++++ - 3 files changed, 2200 insertions(+) + drivers/mmc/host/bcm2835-sdhost.c | 2193 +++++++++++++++++++++++++++++++++++++ + 3 files changed, 2204 insertions(+) create mode 100644 drivers/mmc/host/bcm2835-sdhost.c diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig -index 77142222a730b76d46a2492fef8f6f1773072687..94f0a180596cba76e67edac5b9f3797215109e18 100644 +index ac2376b7324473f2cf888b800d79552ce489eff9..6300af1eff1a52608455682fdc412c96e8438ad4 100644 --- a/drivers/mmc/host/Kconfig +++ b/drivers/mmc/host/Kconfig @@ -33,6 +33,16 @@ config MMC_BCM2835_PIO_DMA_BARRIER @@ -69648,7 +69755,7 @@ index 77142222a730b76d46a2492fef8f6f1773072687..94f0a180596cba76e67edac5b9f37972 tristate "ARM AMBA Multimedia Card Interface support" depends on ARM_AMBA diff --git a/drivers/mmc/host/Makefile b/drivers/mmc/host/Makefile -index c987038c9f3a1cea98931efe868c933b767c1664..9f7e1930f8e85e8994a8d3e7d2537cc1903ba3dc 100644 +index 00ceba92f1057a14aae1f22907fd37ea4504e521..f4b8951af214fd0b0392d4fb38b29a0b41c7340e 100644 --- a/drivers/mmc/host/Makefile +++ b/drivers/mmc/host/Makefile @@ -19,6 +19,7 @@ obj-$(CONFIG_MMC_SDHCI_SIRF) += sdhci-sirf.o @@ -69661,10 +69768,10 @@ index c987038c9f3a1cea98931efe868c933b767c1664..9f7e1930f8e85e8994a8d3e7d2537cc1 obj-$(CONFIG_MMC_MTK) += mtk-sd.o diff --git a/drivers/mmc/host/bcm2835-sdhost.c b/drivers/mmc/host/bcm2835-sdhost.c new file mode 100644 -index 0000000000000000000000000000000000000000..a9bc79bfdbb71807819dfe2d8f1651445997f92a +index 0000000000000000000000000000000000000000..9c6f199a7830959f31012d86bc1f8b1a9922185f --- /dev/null +++ b/drivers/mmc/host/bcm2835-sdhost.c -@@ -0,0 +1,2189 @@ +@@ -0,0 +1,2193 @@ +/* + * BCM2835 SD host driver. + * @@ -69718,8 +69825,12 @@ index 0000000000000000000000000000000000000000..a9bc79bfdbb71807819dfe2d8f165144 +#include +#include +#include ++#include +#include + ++/* For mmc_card_blockaddr */ ++#include "../core/card.h" ++ +#define DRIVER_NAME "sdhost-bcm2835" + +#define SDCMD 0x00 /* Command to SD card - 16 R/W */ @@ -71855,10 +71966,10 @@ index 0000000000000000000000000000000000000000..a9bc79bfdbb71807819dfe2d8f165144 +MODULE_LICENSE("GPL v2"); +MODULE_AUTHOR("Phil Elwell"); -From 29ea9d4afe3e3d8ddb7232f3c5c9bf5cabcbc145 Mon Sep 17 00:00:00 2001 +From 809a0dffbc985286b74f27759d7c2e607a6a0817 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Fri, 28 Oct 2016 15:36:43 +0100 -Subject: [PATCH 043/201] vc_mem: Add vc_mem driver for querying firmware +Subject: [PATCH 043/134] vc_mem: Add vc_mem driver for querying firmware memory addresses MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -71915,7 +72026,7 @@ index 0000000000000000000000000000000000000000..06c5c8ad00e75204ae1ec200f690a8cb +obj-$(CONFIG_BCM2708_VCMEM) += vc_mem.o diff --git a/drivers/char/broadcom/vc_mem.c b/drivers/char/broadcom/vc_mem.c new file mode 100644 -index 0000000000000000000000000000000000000000..be64f238ee0cc1e57f9401b0ee16c23e9fa238cc +index 0000000000000000000000000000000000000000..d063c106de2f920483d3eb558dcb8c5af24046f1 --- /dev/null +++ b/drivers/char/broadcom/vc_mem.c @@ -0,0 +1,422 @@ @@ -71941,7 +72052,7 @@ index 0000000000000000000000000000000000000000..be64f238ee0cc1e57f9401b0ee16c23e +#include +#include +#include -+#include ++#include +#include +#include + @@ -72383,10 +72494,10 @@ index 0000000000000000000000000000000000000000..20a475377eb3078ea1ecaef2b24efc35 + +#endif /* _VC_MEM_H */ -From 8a0df556bd1d4e671df5ce60051e1cf82045b5ef Mon Sep 17 00:00:00 2001 +From 6952d79707b63996f0d42d0dda2b70a059447ca8 Mon Sep 17 00:00:00 2001 From: Tim Gover Date: Tue, 22 Jul 2014 15:41:04 +0100 -Subject: [PATCH 044/201] vcsm: VideoCore shared memory service for BCM2835 +Subject: [PATCH 044/134] vcsm: VideoCore shared memory service for BCM2835 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -72426,6 +72537,15 @@ vcsm: Add ioctl for custom cache flushing vc-sm: Move headers out of arch directory Signed-off-by: Noralf Trønnes + +vcsm: Treat EBUSY as success rather than SIGBUS + +Currently if two cores access the same page concurrently one will return VM_FAULT_NOPAGE +and the other VM_FAULT_SIGBUS crashing the user code. + +Also report when mapping fails. + +Signed-off-by: popcornmix --- drivers/char/Kconfig | 2 + drivers/char/Makefile | 1 + @@ -72436,9 +72556,9 @@ Signed-off-by: Noralf Trønnes drivers/char/broadcom/vc_sm/vc_sm_knl.h | 55 + drivers/char/broadcom/vc_sm/vc_vchi_sm.c | 499 +++++ drivers/char/broadcom/vc_sm/vc_vchi_sm.h | 82 + - drivers/char/broadcom/vc_sm/vmcs_sm.c | 3213 ++++++++++++++++++++++++++++++ + drivers/char/broadcom/vc_sm/vmcs_sm.c | 3222 ++++++++++++++++++++++++++++++ include/linux/broadcom/vmcs_sm_ioctl.h | 248 +++ - 11 files changed, 4300 insertions(+) + 11 files changed, 4309 insertions(+) create mode 100644 drivers/char/broadcom/vc_sm/Makefile create mode 100644 drivers/char/broadcom/vc_sm/vc_sm_defs.h create mode 100644 drivers/char/broadcom/vc_sm/vc_sm_knl.h @@ -73351,10 +73471,10 @@ index 0000000000000000000000000000000000000000..5e279f5a95fac7227cea15941bf0570d +#endif /* __VC_VCHI_SM_H__INCLUDED__ */ diff --git a/drivers/char/broadcom/vc_sm/vmcs_sm.c b/drivers/char/broadcom/vc_sm/vmcs_sm.c new file mode 100644 -index 0000000000000000000000000000000000000000..fd71d9fbb400d71bb8cfb8672080e7c3053e3ae9 +index 0000000000000000000000000000000000000000..fd2ca788dcd56b1702454d71b7bedd4203179500 --- /dev/null +++ b/drivers/char/broadcom/vc_sm/vmcs_sm.c -@@ -0,0 +1,3213 @@ +@@ -0,0 +1,3222 @@ +/***************************************************************************** +* Copyright 2011-2012 Broadcom Corporation. All rights reserved. +* @@ -74538,11 +74658,20 @@ index 0000000000000000000000000000000000000000..fd71d9fbb400d71bb8cfb8672080e7c3 + switch (ret) { + case 0: + case -ERESTARTSYS: ++ /* ++ * EBUSY is ok: this just means that another thread ++ * already did the job. ++ */ ++ case -EBUSY: + return VM_FAULT_NOPAGE; + case -ENOMEM: + case -EAGAIN: ++ pr_err("[%s]: failed to map page pfn:%lx virt:%lx ret:%d\n", __func__, ++ pfn, (unsigned long)vmf->address, ret); + return VM_FAULT_OOM; + default: ++ pr_err("[%s]: failed to map page pfn:%lx virt:%lx ret:%d\n", __func__, ++ pfn, (unsigned long)vmf->address, ret); + return VM_FAULT_SIGBUS; + } +} @@ -76823,10 +76952,10 @@ index 0000000000000000000000000000000000000000..334f36d0d697b047df2922b5f2db67f3 + +#endif /* __VMCS_SM_IOCTL_H__INCLUDED__ */ -From a22a5d6e18f2588aacd8bb62205d2e17a59cee11 Mon Sep 17 00:00:00 2001 +From ba7395e4c6fb0435003beae02f3c8b2bc8791cf4 Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Fri, 21 Aug 2015 23:14:48 +0100 -Subject: [PATCH 045/201] Add /dev/gpiomem device for rootless user GPIO access +Subject: [PATCH 045/134] Add /dev/gpiomem device for rootless user GPIO access Signed-off-by: Luke Wren @@ -77134,10 +77263,10 @@ index 0000000000000000000000000000000000000000..f5e7f1ba8fb6f18dee77fad06a17480c +MODULE_DESCRIPTION("gpiomem driver for accessing GPIO from userspace"); +MODULE_AUTHOR("Luke Wren "); -From ff7403341e19fab40fb0aa0271c36981f883f03b Mon Sep 17 00:00:00 2001 +From 515a938fe8576bc8cc4a3601c86d73ba4b6551ca Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Sat, 5 Sep 2015 01:14:45 +0100 -Subject: [PATCH 046/201] Add SMI driver +Subject: [PATCH 046/134] Add SMI driver Signed-off-by: Luke Wren --- @@ -77669,7 +77798,7 @@ index 0000000000000000000000000000000000000000..d6efd92fdfe46df5cfe219d2123e0dff + "Character device driver for BCM2835's secondary memory interface"); +MODULE_AUTHOR("Luke Wren "); diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig -index c290990d73edf87ece9b179ac3d845eef27531e9..a1594b7ca53bca17a9c2ca3a66ba14cb9de21e37 100644 +index 07bbd4cc18526514a2f1029b3d12b4d1b4724613..ea1570ed43b8ee3fb158948bf4e9ad6f98b6148d 100644 --- a/drivers/misc/Kconfig +++ b/drivers/misc/Kconfig @@ -10,6 +10,14 @@ config SENSORS_LIS3LV02D @@ -77688,7 +77817,7 @@ index c290990d73edf87ece9b179ac3d845eef27531e9..a1594b7ca53bca17a9c2ca3a66ba14cb tristate "Analog Devices Digital Potentiometers" depends on (I2C || SPI) && SYSFS diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile -index 7a3ea89339b4d07c34289a539c4f9bd2f12d2aff..7323ce864f409213c3187dcfc3118335149d2989 100644 +index 81ef3e67acc96a6dde7d5a0227760f399bb902ad..2190d89353058e7b236711d074ff26ed44fd5ff9 100644 --- a/drivers/misc/Makefile +++ b/drivers/misc/Makefile @@ -9,6 +9,7 @@ obj-$(CONFIG_AD525X_DPOT_SPI) += ad525x_dpot-spi.o @@ -79088,10 +79217,10 @@ index 0000000000000000000000000000000000000000..ee3a75edfc033eeb0d90a687ffb68b10 + +#endif /* BCM2835_SMI_H */ -From 2432214ed30234f9edd07b4af978a6770ffe39be Mon Sep 17 00:00:00 2001 +From 72783ecf88bd49e4260f9f9f0c07662f90b7eab8 Mon Sep 17 00:00:00 2001 From: Martin Sperl Date: Tue, 26 Apr 2016 14:59:21 +0000 -Subject: [PATCH 047/201] MISC: bcm2835: smi: use clock manager and fix reload +Subject: [PATCH 047/134] MISC: bcm2835: smi: use clock manager and fix reload issues Use clock manager instead of self-made clockmanager. @@ -79261,10 +79390,10 @@ index 63a4ea08b9930a3a31a985f0a1d969b488ed49ec..1261540703127d1d63b9f3c87042c6e5 return 0; } -From 0fd3409e408e9a0cf555a32c0244cf155fe99ba7 Mon Sep 17 00:00:00 2001 +From aa1fdfae8bf8b75cc9d97ce03fdde2c9925f2415 Mon Sep 17 00:00:00 2001 From: Luke Wren Date: Sat, 5 Sep 2015 01:16:10 +0100 -Subject: [PATCH 048/201] Add SMI NAND driver +Subject: [PATCH 048/134] Add SMI NAND driver Signed-off-by: Luke Wren --- @@ -79326,10 +79455,10 @@ index 0000000000000000000000000000000000000000..159544d6579070d376d146bd24a86653 +}; \ No newline at end of file diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig -index 6d4d5672d1d8ea0945cdaebcbf06d17f5984017b..a3b161befa01064add2b561cb0404306d83efb7e 100644 +index c3029528063b8578e79746c51038d643631920b2..42c706d22ec20c3476a2de8356dec18a34f7b800 100644 --- a/drivers/mtd/nand/Kconfig +++ b/drivers/mtd/nand/Kconfig -@@ -41,6 +41,13 @@ config MTD_SM_COMMON +@@ -40,6 +40,13 @@ config MTD_SM_COMMON tristate default n @@ -79344,10 +79473,10 @@ index 6d4d5672d1d8ea0945cdaebcbf06d17f5984017b..a3b161befa01064add2b561cb0404306 tristate diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile -index 19a66e404d5ba949a16a7ba358df25f033e7a51c..3e2cecac083a6bdb340127233c10f40ce567814f 100644 +index ade5fc4c3819a79ffd575119ed6bbf5607bd8b7f..4312f9ac34ed8f3ae5d73dd1973a07e94f557c03 100644 --- a/drivers/mtd/nand/Makefile +++ b/drivers/mtd/nand/Makefile -@@ -14,6 +14,7 @@ obj-$(CONFIG_MTD_NAND_DENALI) += denali.o +@@ -13,6 +13,7 @@ obj-$(CONFIG_MTD_NAND_DENALI) += denali.o obj-$(CONFIG_MTD_NAND_DENALI_PCI) += denali_pci.o obj-$(CONFIG_MTD_NAND_DENALI_DT) += denali_dt.o obj-$(CONFIG_MTD_NAND_AU1550) += au1550nd.o @@ -79629,10 +79758,10 @@ index 0000000000000000000000000000000000000000..02adda6da18bd0ba9ab19a104975b79d + ("Driver for NAND chips using Broadcom Secondary Memory Interface"); +MODULE_AUTHOR("Luke Wren "); -From f1f1bfe0594085c9ade05becf5eca430a5127066 Mon Sep 17 00:00:00 2001 +From 6d55d11f5e25cf0bc8ed3a011fcca9aca259324b Mon Sep 17 00:00:00 2001 From: Aron Szabo Date: Sat, 16 Jun 2012 12:15:55 +0200 -Subject: [PATCH 049/201] lirc: added support for RaspberryPi GPIO +Subject: [PATCH 049/134] 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 @@ -79697,7 +79826,7 @@ spurious interrupts. create mode 100644 include/linux/platform_data/bcm2708.h diff --git a/drivers/staging/media/lirc/Kconfig b/drivers/staging/media/lirc/Kconfig -index bc67da254262318f43cb81ab58fb2053339f2e73..d2f72463a1bad7a44d67e0329cadc4cf63e0268f 100644 +index 3e350a9922de8d4dd8637102e262c9b42222422e..2224542f8eb8e67eee83a69c454ff1546d1d42a1 100644 --- a/drivers/staging/media/lirc/Kconfig +++ b/drivers/staging/media/lirc/Kconfig @@ -12,6 +12,12 @@ menuconfig LIRC_STAGING @@ -79710,20 +79839,18 @@ index bc67da254262318f43cb81ab58fb2053339f2e73..d2f72463a1bad7a44d67e0329cadc4cf + help + Driver for Homebrew GPIO Port Receiver/Transmitter for the RaspberryPi + - config LIRC_SASEM - tristate "Sasem USB IR Remote" - depends on LIRC && USB + config LIRC_ZILOG + tristate "Zilog/Hauppauge IR Transmitter" + depends on LIRC && I2C diff --git a/drivers/staging/media/lirc/Makefile b/drivers/staging/media/lirc/Makefile -index 28740c94349c4e412ee0b77bc800c8fb0705297c..89d5544045bc8275f43cf0df9c711f6c067dd48a 100644 +index 665562436e30dd19d74b67fb8ef600e3815f282a..9bb9f1455759c4bd30a2ab1d7c9dc95f899b1865 100644 --- a/drivers/staging/media/lirc/Makefile +++ b/drivers/staging/media/lirc/Makefile -@@ -3,6 +3,7 @@ +@@ -3,4 +3,5 @@ # Each configuration option enables a list of files. +obj-$(CONFIG_LIRC_RPI) += lirc_rpi.o - obj-$(CONFIG_LIRC_SASEM) += lirc_sasem.o - obj-$(CONFIG_LIRC_SIR) += lirc_sir.o obj-$(CONFIG_LIRC_ZILOG) += lirc_zilog.o diff --git a/drivers/staging/media/lirc/lirc_rpi.c b/drivers/staging/media/lirc/lirc_rpi.c new file mode 100644 @@ -80495,10 +80622,10 @@ index 0000000000000000000000000000000000000000..fb69624ccef00ddbdccf8256d6baf1b1 + +#endif -From f8bb77ef9fa137dcc00bb90e4bc5cbe1b2bd8cfe Mon Sep 17 00:00:00 2001 +From 48f95755c474182114162618044ac0f1175c7f89 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 3 Jul 2013 00:49:20 +0100 -Subject: [PATCH 050/201] Add cpufreq driver +Subject: [PATCH 050/134] Add cpufreq driver Signed-off-by: popcornmix --- @@ -80509,7 +80636,7 @@ Signed-off-by: popcornmix create mode 100644 drivers/cpufreq/bcm2835-cpufreq.c diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm -index 74fa5c5904d388444f357bc7b7e9e1737a45fd29..d5d9ec0bd5d6f5d5c9cc2f8df881d28e081ebb97 100644 +index 74ed7e9a7f27cd333a6bdf48144c0de4e6e7469e..f752ce90a1d46f6f605e49db6fae010d27269ad0 100644 --- a/drivers/cpufreq/Kconfig.arm +++ b/drivers/cpufreq/Kconfig.arm @@ -233,6 +233,15 @@ config ARM_STI_CPUFREQ @@ -80529,7 +80656,7 @@ index 74fa5c5904d388444f357bc7b7e9e1737a45fd29..d5d9ec0bd5d6f5d5c9cc2f8df881d28e bool "Tegra20 CPUFreq support" depends on ARCH_TEGRA diff --git a/drivers/cpufreq/Makefile b/drivers/cpufreq/Makefile -index 9f5a8045f36d37710c8196e8ddf1145817664f05..3de3eebd30a3f5e5e6c0a94c47e39545e9d8cbfe 100644 +index b7e78f063c4f1d373bc892f84f68d6b8000a3051..da7b9bab804b9305f02033be188519284dd8c136 100644 --- a/drivers/cpufreq/Makefile +++ b/drivers/cpufreq/Makefile @@ -75,6 +75,7 @@ obj-$(CONFIG_ARM_SA1110_CPUFREQ) += sa1110-cpufreq.o @@ -80539,7 +80666,7 @@ index 9f5a8045f36d37710c8196e8ddf1145817664f05..3de3eebd30a3f5e5e6c0a94c47e39545 +obj-$(CONFIG_ARM_BCM2835_CPUFREQ) += bcm2835-cpufreq.o obj-$(CONFIG_ARM_TEGRA20_CPUFREQ) += tegra20-cpufreq.o obj-$(CONFIG_ARM_TEGRA124_CPUFREQ) += tegra124-cpufreq.o - obj-$(CONFIG_ARM_TI_CPUFREQ) += ti-cpufreq.o + obj-$(CONFIG_ARM_TEGRA186_CPUFREQ) += tegra186-cpufreq.o diff --git a/drivers/cpufreq/bcm2835-cpufreq.c b/drivers/cpufreq/bcm2835-cpufreq.c new file mode 100644 index 0000000000000000000000000000000000000000..414fbdc10dfbfc6e4bb47870a7af3fd5780f9c9a @@ -80765,10 +80892,10 @@ index 0000000000000000000000000000000000000000..414fbdc10dfbfc6e4bb47870a7af3fd5 +module_init(bcm2835_cpufreq_module_init); +module_exit(bcm2835_cpufreq_module_exit); -From e97f66b369faf21b26e47da721a98b96b94ddb62 Mon Sep 17 00:00:00 2001 +From 0bf5a3595ea205edec12f78627f951f57d55a138 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 26 Mar 2013 19:24:24 +0000 -Subject: [PATCH 051/201] Added hwmon/thermal driver for reporting core +Subject: [PATCH 051/134] Added hwmon/thermal driver for reporting core temperature. Thanks Dorian MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -80781,18 +80908,33 @@ Add thermal sensor device to Device Tree. Don't add platform device when booting in DT mode. Signed-off-by: Noralf Trønnes + +thermal: Compatible strings for bcm2836, bcm2837 + +The upstream dt-bindings documentation for bcm2835-thermal (which +exists even though the driver isn't upstreamed) says to use +dedicated compatible strings on bcm2836 and bcm2837, even though +the downstream driver doesn't support them. The Pi2 DTB uses +"brcm,bcm2836-thermal", so the driver doesn't load. The Pi3 DTB +doesn't override the base value, but the arm64 Pi3 support uses "brcm,bcm2837-thermal". + +Solve the documentation problem by adding "brcm,bcm2836-thermal" and +"brcm,bcm2837-thermal" as alternative compatible strings for the +bcm2835-thermal driver. + +Signed-off-by: Phil Elwell --- drivers/thermal/Kconfig | 7 +++ drivers/thermal/Makefile | 1 + - drivers/thermal/bcm2835-thermal.c | 109 ++++++++++++++++++++++++++++++++++++++ - 3 files changed, 117 insertions(+) + drivers/thermal/bcm2835-thermal.c | 111 ++++++++++++++++++++++++++++++++++++++ + 3 files changed, 119 insertions(+) create mode 100644 drivers/thermal/bcm2835-thermal.c diff --git a/drivers/thermal/Kconfig b/drivers/thermal/Kconfig -index 776b34396144a4612ec5ebfff5a549be9f6e33ca..592a1c319ca130f0d82649c60989c05d4ec184b2 100644 +index b5b5facb87473e4de8c30fa29a105251965cd027..257e2d59d1b0fbb13827f7a12ab062a905ffee40 100644 --- a/drivers/thermal/Kconfig +++ b/drivers/thermal/Kconfig -@@ -313,6 +313,13 @@ config INTEL_POWERCLAMP +@@ -328,6 +328,13 @@ config INTEL_POWERCLAMP enforce idle time which results in more package C-state residency. The user interface is exposed via generic thermal framework. @@ -80807,12 +80949,12 @@ index 776b34396144a4612ec5ebfff5a549be9f6e33ca..592a1c319ca130f0d82649c60989c05d tristate "X86 package temperature thermal driver" depends on X86_THERMAL_VECTOR diff --git a/drivers/thermal/Makefile b/drivers/thermal/Makefile -index 7adae2029355639b03359fb542c6030f93808ab5..adc17796d5e17787f632b3f36c48d0bba141132d 100644 +index 094d7039981ca3eb2371562c16393fa35e19bd10..a654feeaca0796880183b24d8374fbb04af399fc 100644 --- a/drivers/thermal/Makefile +++ b/drivers/thermal/Makefile -@@ -43,6 +43,7 @@ obj-$(CONFIG_MAX77620_THERMAL) += max77620_thermal.o +@@ -44,6 +44,7 @@ obj-$(CONFIG_MAX77620_THERMAL) += max77620_thermal.o obj-$(CONFIG_QORIQ_THERMAL) += qoriq_thermal.o - obj-$(CONFIG_DB8500_CPUFREQ_COOLING) += db8500_cpufreq_cooling.o + obj-$(CONFIG_DA9062_THERMAL) += da9062-thermal.o obj-$(CONFIG_INTEL_POWERCLAMP) += intel_powerclamp.o +obj-$(CONFIG_THERMAL_BCM2835) += bcm2835-thermal.o obj-$(CONFIG_X86_PKG_TEMP_THERMAL) += x86_pkg_temp_thermal.o @@ -80820,10 +80962,10 @@ index 7adae2029355639b03359fb542c6030f93808ab5..adc17796d5e17787f632b3f36c48d0bb obj-$(CONFIG_INTEL_SOC_DTS_THERMAL) += intel_soc_dts_thermal.o diff --git a/drivers/thermal/bcm2835-thermal.c b/drivers/thermal/bcm2835-thermal.c new file mode 100644 -index 0000000000000000000000000000000000000000..c63fb9f9d143e19612a18fe530c7b2b3518a22a4 +index 0000000000000000000000000000000000000000..25b78c3eac1503fbc9e679b963a6284b673b2ed3 --- /dev/null +++ b/drivers/thermal/bcm2835-thermal.c -@@ -0,0 +1,109 @@ +@@ -0,0 +1,111 @@ +/***************************************************************************** +* Copyright 2011 Broadcom Corporation. All rights reserved. +* @@ -80915,6 +81057,8 @@ index 0000000000000000000000000000000000000000..c63fb9f9d143e19612a18fe530c7b2b3 + +static const struct of_device_id bcm2835_thermal_of_match_table[] = { + { .compatible = "brcm,bcm2835-thermal", }, ++ { .compatible = "brcm,bcm2836-thermal", }, ++ { .compatible = "brcm,bcm2837-thermal", }, + {}, +}; +MODULE_DEVICE_TABLE(of, bcm2835_thermal_of_match_table); @@ -80934,10 +81078,10 @@ index 0000000000000000000000000000000000000000..c63fb9f9d143e19612a18fe530c7b2b3 +MODULE_DESCRIPTION("Thermal driver for bcm2835 chip"); +MODULE_LICENSE("GPL"); -From 65111c8028b443d0b43056347018ff7e8c9abb94 Mon Sep 17 00:00:00 2001 +From b1495be3d315402a0db42644dd5ecc53fecb5deb Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 17 Jun 2015 15:44:08 +0100 -Subject: [PATCH 052/201] Add Chris Boot's i2c driver +Subject: [PATCH 052/134] Add Chris Boot's i2c driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -81041,7 +81185,7 @@ both bcm2708_bsc_fifo_fill and ~drain are changed as well. create mode 100644 drivers/i2c/busses/i2c-bcm2708.c diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig -index 8adc0f1d7ad0ba72240fcae0ff2feb8e7c517456..c893a2b75eacb717b508bab60b1e5b175712fdf2 100644 +index 144cbadc7c728d38661cd231f704751cce6b0227..d3f9fffd26920d517f456cfe3a6b5c4603ad3acf 100644 --- a/drivers/i2c/busses/Kconfig +++ b/drivers/i2c/busses/Kconfig @@ -8,6 +8,25 @@ menu "I2C Hardware Bus support" @@ -81602,10 +81746,10 @@ index 0000000000000000000000000000000000000000..962f2e5c7455d91bf32925d785f5f16b +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:" DRV_NAME); -From ba62b545bf14ea7b7d590e2f2ed578b5463a4a7b Mon Sep 17 00:00:00 2001 +From ab9a6fe8d650c560be66560575e74fd340e78c5f 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 053/201] char: broadcom: Add vcio module +Subject: [PATCH 053/134] char: broadcom: Add vcio module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -81830,10 +81974,10 @@ index 0000000000000000000000000000000000000000..c19bc2075c77879563ef5e59038b5a14 +MODULE_DESCRIPTION("Mailbox userspace access"); +MODULE_LICENSE("GPL"); -From 88a4d118a5ed2bb7c19f3a89c4faea03e958366c Mon Sep 17 00:00:00 2001 +From 1e19f0206104e59cd027f18fb5c5fc9ced464c10 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 054/201] firmware: bcm2835: Support ARCH_BCM270x +Subject: [PATCH 054/134] firmware: bcm2835: Support ARCH_BCM270x MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -81916,10 +82060,10 @@ index dd506cd3a5b874f9e1acd07efb8cd151bb6145d1..3f070bd38a91511c986e3fb114b15bd4 MODULE_AUTHOR("Eric Anholt "); MODULE_DESCRIPTION("Raspberry Pi firmware driver"); -From 28241ee1f16b399b58e3f2ea3ccbf724c92068b6 Mon Sep 17 00:00:00 2001 +From 1584499b7961aa2c6efd0e532fc240f2d537b2a7 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 11 May 2015 09:00:42 +0100 -Subject: [PATCH 055/201] scripts: Add mkknlimg and knlinfo scripts from tools +Subject: [PATCH 055/134] scripts: Add mkknlimg and knlinfo scripts from tools repo The Raspberry Pi firmware looks for a trailer on the kernel image to @@ -81984,10 +82128,16 @@ With the death of ARCH_BCM2708 and ARCH_BCM2709, a new way is needed to determine if this is a "downstream" build that wants the firmware to load a bcm27xx .dtb. The vc_cma driver is used downstream but not upstream, making vc_cma_init a suitable predicate symbol. + +mkknlimg: Find some more downstream-only strings + +See: https://github.com/raspberrypi/linux/issues/1920 + +Signed-off-by: Phil Elwell --- scripts/knlinfo | 171 +++++++++++++++++++++++++++++++++++ - scripts/mkknlimg | 264 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 435 insertions(+) + scripts/mkknlimg | 265 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 436 insertions(+) create mode 100755 scripts/knlinfo create mode 100755 scripts/mkknlimg @@ -82170,10 +82320,10 @@ index 0000000000000000000000000000000000000000..263ec937eaa70b4fd00bff18599db7f2 +} diff --git a/scripts/mkknlimg b/scripts/mkknlimg new file mode 100755 -index 0000000000000000000000000000000000000000..60206de7fa9a49bd027c635306674a29a568652f +index 0000000000000000000000000000000000000000..84be2593ec1de8f97b0167ff06b3e05d231c4ba0 --- /dev/null +++ b/scripts/mkknlimg -@@ -0,0 +1,264 @@ +@@ -0,0 +1,265 @@ +#!/usr/bin/env perl +# ---------------------------------------------------------------------- +# mkknlimg by Phil Elwell for Raspberry Pi @@ -82244,7 +82394,7 @@ index 0000000000000000000000000000000000000000..60206de7fa9a49bd027c635306674a29 + +my $wanted_strings = +{ -+ 'bcm2708_fb' => FLAG_PI, ++ 'bcm2708_fb' => FLAG_PI | FLAG_270X, + 'brcm,bcm2835-mmc' => FLAG_PI, + 'brcm,bcm2835-sdhost' => FLAG_PI, + 'brcm,bcm2708-pinctrl' => FLAG_PI | FLAG_DTOK, @@ -82255,6 +82405,7 @@ index 0000000000000000000000000000000000000000..60206de7fa9a49bd027c635306674a29 + 'brcm,bcm2836' => FLAG_PI | FLAG_DTOK | FLAG_283X, + 'of_cfs_init' => FLAG_DTOK | FLAG_DDTK, + 'vc_cma_init' => FLAG_PI | FLAG_270X, ++ 'vc-mem' => FLAG_PI | FLAG_270X, +}; + +my $res = try_extract($kernel_file, $tmpfile1); @@ -82439,10 +82590,10 @@ index 0000000000000000000000000000000000000000..60206de7fa9a49bd027c635306674a29 + return $trailer; +} -From a24bb0a19e5f1f72ba27e498634a9e8e46f47171 Mon Sep 17 00:00:00 2001 +From 1ad57d32fa61983dc993af793ca1de7656541adc Mon Sep 17 00:00:00 2001 From: notro Date: Wed, 9 Jul 2014 14:46:08 +0200 -Subject: [PATCH 056/201] BCM2708: Add core Device Tree support +Subject: [PATCH 056/134] BCM2708: Add core Device Tree support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @@ -82623,35 +82774,52 @@ Patch the kernel, which has faulty rules to generate .dtbo the way yocto does Signed-off-by: Herve Jourdain Signed-off-by: Khem Raj + +BCM270X: Drop position requirement for CMA in VC4 overlay. + +No longer necessary since 2aefcd576195a739a7a256099571c9c4a401005f, +and will probably let peeople that want to choose a larger CMA +allocation (particularly on pi0/1). + +Signed-off-by: Eric Anholt + +BCM270X_DT: RPi Device Tree tidy + +Use the upstream sdhost node, add thermal-zones, and factor out some +common elements. + +Signed-off-by: Phil Elwell --- arch/arm/Makefile | 2 + arch/arm/boot/.gitignore | 2 +- arch/arm/boot/dts/Makefile | 20 + - arch/arm/boot/dts/bcm2708-rpi-0-w.dts | 197 +++ - arch/arm/boot/dts/bcm2708-rpi-b-plus.dts | 157 +++ - arch/arm/boot/dts/bcm2708-rpi-b.dts | 147 ++ - arch/arm/boot/dts/bcm2708-rpi-cm.dts | 110 ++ - arch/arm/boot/dts/bcm2708-rpi-cm.dtsi | 50 + - arch/arm/boot/dts/bcm2708-rpi.dtsi | 113 ++ - arch/arm/boot/dts/bcm2708.dtsi | 16 + - arch/arm/boot/dts/bcm2709-rpi-2-b.dts | 157 +++ + arch/arm/boot/dts/bcm2708-rpi-0-w.dts | 162 +++ + arch/arm/boot/dts/bcm2708-rpi-b-plus.dts | 122 ++ + arch/arm/boot/dts/bcm2708-rpi-b.dts | 112 ++ + arch/arm/boot/dts/bcm2708-rpi-cm.dts | 95 ++ + arch/arm/boot/dts/bcm2708-rpi-cm.dtsi | 17 + + arch/arm/boot/dts/bcm2708-rpi.dtsi | 174 +++ + arch/arm/boot/dts/bcm2708.dtsi | 20 + + arch/arm/boot/dts/bcm2709-rpi-2-b.dts | 122 ++ arch/arm/boot/dts/bcm2709.dtsi | 22 + - arch/arm/boot/dts/bcm270x.dtsi | 157 +++ - arch/arm/boot/dts/bcm2710-rpi-3-b.dts | 226 +++ - arch/arm/boot/dts/bcm2710-rpi-cm3.dts | 167 +++ + arch/arm/boot/dts/bcm270x.dtsi | 145 ++ + arch/arm/boot/dts/bcm2710-rpi-3-b.dts | 191 +++ + arch/arm/boot/dts/bcm2710-rpi-cm3.dts | 129 ++ arch/arm/boot/dts/bcm2710.dtsi | 148 ++ - arch/arm/boot/dts/bcm283x.dtsi | 1 + - arch/arm/boot/dts/overlays/Makefile | 114 ++ - arch/arm/boot/dts/overlays/README | 1458 ++++++++++++++++++++ + arch/arm/boot/dts/bcm283x.dtsi | 13 +- + arch/arm/boot/dts/overlays/Makefile | 118 ++ + arch/arm/boot/dts/overlays/README | 1517 ++++++++++++++++++++ .../arm/boot/dts/overlays/adau1977-adc-overlay.dts | 40 + .../boot/dts/overlays/adau7002-simple-overlay.dts | 52 + arch/arm/boot/dts/overlays/ads1015-overlay.dts | 98 ++ arch/arm/boot/dts/overlays/ads1115-overlay.dts | 103 ++ arch/arm/boot/dts/overlays/ads7846-overlay.dts | 89 ++ .../dts/overlays/akkordion-iqdacplus-overlay.dts | 49 + + .../allo-boss-dac-pcm512x-audio-overlay.dts | 59 + .../allo-piano-dac-pcm512x-audio-overlay.dts | 54 + + .../allo-piano-dac-plus-pcm512x-audio-overlay.dts | 55 + arch/arm/boot/dts/overlays/at86rf233-overlay.dts | 57 + - .../dts/overlays/audioinjector-addons-overlay.dts | 50 + + .../dts/overlays/audioinjector-addons-overlay.dts | 55 + .../audioinjector-wm8731-audio-overlay.dts | 39 + arch/arm/boot/dts/overlays/audremap-overlay.dts | 19 + .../dts/overlays/bmp085_i2c-sensor-overlay.dts | 23 + @@ -82661,10 +82829,11 @@ Signed-off-by: Khem Raj arch/arm/boot/dts/overlays/dpi18-overlay.dts | 31 + arch/arm/boot/dts/overlays/dpi24-overlay.dts | 31 + arch/arm/boot/dts/overlays/dwc-otg-overlay.dts | 20 + - arch/arm/boot/dts/overlays/dwc2-overlay.dts | 29 + + arch/arm/boot/dts/overlays/dwc2-overlay.dts | 28 + arch/arm/boot/dts/overlays/enc28j60-overlay.dts | 53 + .../boot/dts/overlays/enc28j60-spi2-overlay.dts | 47 + arch/arm/boot/dts/overlays/fe-pi-audio-overlay.dts | 70 + + .../overlays/googlevoicehat-soundcard-overlay.dts | 49 + arch/arm/boot/dts/overlays/gpio-ir-overlay.dts | 44 + .../boot/dts/overlays/gpio-poweroff-overlay.dts | 34 + .../boot/dts/overlays/hifiberry-amp-overlay.dts | 39 + @@ -82679,7 +82848,7 @@ Signed-off-by: Khem Raj arch/arm/boot/dts/overlays/i2c-mux-overlay.dts | 139 ++ .../boot/dts/overlays/i2c-pwm-pca9685a-overlay.dts | 26 + arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts | 83 ++ - arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts | 41 + + arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts | 49 + .../arm/boot/dts/overlays/i2c0-bcm2708-overlay.dts | 61 + .../arm/boot/dts/overlays/i2c1-bcm2708-overlay.dts | 37 + .../boot/dts/overlays/i2s-gpio28-31-overlay.dts | 18 + @@ -82695,7 +82864,7 @@ Signed-off-by: Khem Raj .../arm/boot/dts/overlays/mcp2515-can1-overlay.dts | 73 + arch/arm/boot/dts/overlays/mcp3008-overlay.dts | 205 +++ arch/arm/boot/dts/overlays/midi-uart0-overlay.dts | 36 + - arch/arm/boot/dts/overlays/mmc-overlay.dts | 38 + + arch/arm/boot/dts/overlays/mmc-overlay.dts | 39 + arch/arm/boot/dts/overlays/mz61581-overlay.dts | 117 ++ arch/arm/boot/dts/overlays/pi3-act-led-overlay.dts | 27 + .../boot/dts/overlays/pi3-disable-bt-overlay.dts | 46 + @@ -82720,12 +82889,13 @@ Signed-off-by: Khem Raj arch/arm/boot/dts/overlays/rpi-ft5406-overlay.dts | 17 + arch/arm/boot/dts/overlays/rpi-proto-overlay.dts | 39 + arch/arm/boot/dts/overlays/rpi-sense-overlay.dts | 47 + + arch/arm/boot/dts/overlays/rpi-tv-overlay.dts | 31 + .../overlays/rra-digidac1-wm8741-audio-overlay.dts | 49 + .../boot/dts/overlays/sc16is750-i2c-overlay.dts | 37 + .../boot/dts/overlays/sc16is752-spi1-overlay.dts | 61 + - arch/arm/boot/dts/overlays/sdhost-overlay.dts | 32 + - arch/arm/boot/dts/overlays/sdio-1bit-overlay.dts | 36 + - arch/arm/boot/dts/overlays/sdio-overlay.dts | 36 + + arch/arm/boot/dts/overlays/sdhost-overlay.dts | 31 + + arch/arm/boot/dts/overlays/sdio-1bit-overlay.dts | 37 + + arch/arm/boot/dts/overlays/sdio-overlay.dts | 37 + arch/arm/boot/dts/overlays/sdtweak-overlay.dts | 23 + arch/arm/boot/dts/overlays/smi-dev-overlay.dts | 18 + arch/arm/boot/dts/overlays/smi-nand-overlay.dts | 69 + @@ -82745,12 +82915,12 @@ Signed-off-by: Khem Raj .../arm/boot/dts/overlays/vc4-fkms-v3d-overlay.dts | 89 ++ arch/arm/boot/dts/overlays/vc4-kms-v3d-overlay.dts | 151 ++ arch/arm/boot/dts/overlays/vga666-overlay.dts | 30 + - arch/arm/boot/dts/overlays/w1-gpio-overlay.dts | 39 + - .../boot/dts/overlays/w1-gpio-pullup-overlay.dts | 41 + + arch/arm/boot/dts/overlays/w1-gpio-overlay.dts | 41 + + .../boot/dts/overlays/w1-gpio-pullup-overlay.dts | 43 + arch/arm/boot/dts/overlays/wittypi-overlay.dts | 44 + - scripts/Makefile.dtbinst | 10 +- + scripts/Makefile.dtbinst | 8 +- scripts/Makefile.lib | 11 + - 126 files changed, 10058 insertions(+), 4 deletions(-) + 130 files changed, 10133 insertions(+), 6 deletions(-) create mode 100644 arch/arm/boot/dts/bcm2708-rpi-0-w.dts create mode 100644 arch/arm/boot/dts/bcm2708-rpi-b-plus.dts create mode 100644 arch/arm/boot/dts/bcm2708-rpi-b.dts @@ -82772,7 +82942,9 @@ Signed-off-by: Khem Raj create mode 100644 arch/arm/boot/dts/overlays/ads1115-overlay.dts create mode 100644 arch/arm/boot/dts/overlays/ads7846-overlay.dts create mode 100644 arch/arm/boot/dts/overlays/akkordion-iqdacplus-overlay.dts + create mode 100644 arch/arm/boot/dts/overlays/allo-boss-dac-pcm512x-audio-overlay.dts create mode 100644 arch/arm/boot/dts/overlays/allo-piano-dac-pcm512x-audio-overlay.dts + create mode 100644 arch/arm/boot/dts/overlays/allo-piano-dac-plus-pcm512x-audio-overlay.dts create mode 100644 arch/arm/boot/dts/overlays/at86rf233-overlay.dts create mode 100644 arch/arm/boot/dts/overlays/audioinjector-addons-overlay.dts create mode 100644 arch/arm/boot/dts/overlays/audioinjector-wm8731-audio-overlay.dts @@ -82788,6 +82960,7 @@ Signed-off-by: Khem Raj create mode 100644 arch/arm/boot/dts/overlays/enc28j60-overlay.dts create mode 100644 arch/arm/boot/dts/overlays/enc28j60-spi2-overlay.dts create mode 100644 arch/arm/boot/dts/overlays/fe-pi-audio-overlay.dts + create mode 100644 arch/arm/boot/dts/overlays/googlevoicehat-soundcard-overlay.dts create mode 100644 arch/arm/boot/dts/overlays/gpio-ir-overlay.dts create mode 100644 arch/arm/boot/dts/overlays/gpio-poweroff-overlay.dts create mode 100644 arch/arm/boot/dts/overlays/hifiberry-amp-overlay.dts @@ -82843,6 +83016,7 @@ Signed-off-by: Khem Raj create mode 100644 arch/arm/boot/dts/overlays/rpi-ft5406-overlay.dts create mode 100644 arch/arm/boot/dts/overlays/rpi-proto-overlay.dts create mode 100644 arch/arm/boot/dts/overlays/rpi-sense-overlay.dts + create mode 100644 arch/arm/boot/dts/overlays/rpi-tv-overlay.dts create mode 100644 arch/arm/boot/dts/overlays/rra-digidac1-wm8741-audio-overlay.dts create mode 100644 arch/arm/boot/dts/overlays/sc16is750-i2c-overlay.dts create mode 100644 arch/arm/boot/dts/overlays/sc16is752-spi1-overlay.dts @@ -82873,7 +83047,7 @@ Signed-off-by: Khem Raj create mode 100644 arch/arm/boot/dts/overlays/wittypi-overlay.dts diff --git a/arch/arm/Makefile b/arch/arm/Makefile -index ab30cc634d024fdb17b379adac2f2d9fe049f1ff..d92ade49c858e0a50ea7dd7391fccdbfa9479aab 100644 +index 65f4e2a4eb94df1351f0e8e746440b1867c4ae2c..10544a5ca5583a30992b41ae38ef52c5fcf233af 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -338,6 +338,8 @@ $(INSTALL_TARGETS): @@ -82896,7 +83070,7 @@ index 3c79f85975aaa26c7c2e353fefc54d71d89bc5bf..eaaeb17e5986e5f7178b2851169444ac -*.dtb +*.dtb* diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile -index 011808490fed73ee3bc676f96449411119983b0d..35b4276d46354ce02af6456b619e51803ff8232f 100644 +index 9c5e1d944d1c714f0fcd49cfd1614e7957f0bd52..a4cdecbff62d637dc26c1a56c3f47e4506a403c9 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -1,5 +1,14 @@ @@ -82914,7 +83088,7 @@ index 011808490fed73ee3bc676f96449411119983b0d..35b4276d46354ce02af6456b619e5180 dtb-$(CONFIG_ARCH_ALPINE) += \ alpine-db.dtb dtb-$(CONFIG_MACH_ARTPEC6) += \ -@@ -1010,10 +1019,21 @@ dtb-$(CONFIG_ARCH_ZX) += zx296702-ad1.dtb +@@ -1041,10 +1050,21 @@ dtb-$(CONFIG_ARCH_ZX) += zx296702-ad1.dtb dtb-$(CONFIG_ARCH_ASPEED) += aspeed-bmc-opp-palmetto.dtb \ aspeed-bmc-opp-romulus.dtb \ aspeed-ast2500-evb.dtb @@ -82938,10 +83112,10 @@ index 011808490fed73ee3bc676f96449411119983b0d..35b4276d46354ce02af6456b619e5180 +endif diff --git a/arch/arm/boot/dts/bcm2708-rpi-0-w.dts b/arch/arm/boot/dts/bcm2708-rpi-0-w.dts new file mode 100644 -index 0000000000000000000000000000000000000000..db0f99ddf2f46e83827d56e21c4846dd0b414c63 +index 0000000000000000000000000000000000000000..fba0041d5546871be643dc8b671db3a153d5c801 --- /dev/null +++ b/arch/arm/boot/dts/bcm2708-rpi-0-w.dts -@@ -0,0 +1,197 @@ +@@ -0,0 +1,162 @@ +/dts-v1/; + +#include "bcm2708.dtsi" @@ -82951,11 +83125,6 @@ index 0000000000000000000000000000000000000000..db0f99ddf2f46e83827d56e21c4846dd +}; + +&gpio { -+ sdhost_pins: sdhost_pins { -+ brcm,pins = <48 49 50 51 52 53>; -+ brcm,function = <4>; /* alt0 */ -+ }; -+ + spi0_pins: spi0_pins { + brcm,pins = <9 10 11>; + brcm,function = <4>; /* alt0 */ @@ -83011,13 +83180,6 @@ index 0000000000000000000000000000000000000000..db0f99ddf2f46e83827d56e21c4846dd + }; +}; + -+&sdhost { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&sdhost_pins>; -+ bus-width = <4>; -+ status = "okay"; -+}; -+ +&mmc { + pinctrl-names = "default"; + pinctrl-0 = <&sdio_pins>; @@ -83026,10 +83188,6 @@ index 0000000000000000000000000000000000000000..db0f99ddf2f46e83827d56e21c4846dd + status = "okay"; +}; + -+&fb { -+ status = "okay"; -+}; -+ +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins &bt_pins>; @@ -83115,36 +83273,17 @@ index 0000000000000000000000000000000000000000..db0f99ddf2f46e83827d56e21c4846dd + +/ { + __overrides__ { -+ uart0 = <&uart0>,"status"; -+ uart1 = <&uart1>,"status"; -+ i2s = <&i2s>,"status"; -+ spi = <&spi0>,"status"; -+ i2c0 = <&i2c0>,"status"; -+ i2c1 = <&i2c1>,"status"; -+ i2c2_iknowwhatimdoing = <&i2c2>,"status"; -+ i2c0_baudrate = <&i2c0>,"clock-frequency:0"; -+ i2c1_baudrate = <&i2c1>,"clock-frequency:0"; -+ i2c2_baudrate = <&i2c2>,"clock-frequency:0"; -+ + act_led_gpio = <&act_led>,"gpios:4"; + act_led_activelow = <&act_led>,"gpios:8"; + act_led_trigger = <&act_led>,"linux,default-trigger"; -+ -+ audio = <&audio>,"status"; -+ watchdog = <&watchdog>,"status"; -+ random = <&random>,"status"; -+ sd_overclock = <&sdhost>,"brcm,overclock-50:0"; -+ sd_force_pio = <&sdhost>,"brcm,force-pio?"; -+ sd_pio_limit = <&sdhost>,"brcm,pio-limit:0"; -+ sd_debug = <&sdhost>,"brcm,debug"; + }; +}; diff --git a/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts b/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts new file mode 100644 -index 0000000000000000000000000000000000000000..0b66ac9f25a5f7ae51f3d0666cfcb908f85e1d24 +index 0000000000000000000000000000000000000000..373bfd02786c6d912c3fc5ebb2f3dcebb5ebf82b --- /dev/null +++ b/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts -@@ -0,0 +1,157 @@ +@@ -0,0 +1,122 @@ +/dts-v1/; + +#include "bcm2708.dtsi" @@ -83155,11 +83294,6 @@ index 0000000000000000000000000000000000000000..0b66ac9f25a5f7ae51f3d0666cfcb908 +}; + +&gpio { -+ sdhost_pins: sdhost_pins { -+ brcm,pins = <48 49 50 51 52 53>; -+ brcm,function = <4>; /* alt0 */ -+ }; -+ + spi0_pins: spi0_pins { + brcm,pins = <9 10 11>; + brcm,function = <4>; /* alt0 */ @@ -83191,17 +83325,6 @@ index 0000000000000000000000000000000000000000..0b66ac9f25a5f7ae51f3d0666cfcb908 + }; +}; + -+&sdhost { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&sdhost_pins>; -+ bus-width = <4>; -+ status = "okay"; -+}; -+ -+&fb { -+ status = "okay"; -+}; -+ +&uart0 { + status = "okay"; +}; @@ -83274,17 +83397,6 @@ index 0000000000000000000000000000000000000000..0b66ac9f25a5f7ae51f3d0666cfcb908 + +/ { + __overrides__ { -+ uart0 = <&uart0>,"status"; -+ uart1 = <&uart1>,"status"; -+ i2s = <&i2s>,"status"; -+ spi = <&spi0>,"status"; -+ i2c0 = <&i2c0>,"status"; -+ i2c1 = <&i2c1>,"status"; -+ i2c2_iknowwhatimdoing = <&i2c2>,"status"; -+ i2c0_baudrate = <&i2c0>,"clock-frequency:0"; -+ i2c1_baudrate = <&i2c1>,"clock-frequency:0"; -+ i2c2_baudrate = <&i2c2>,"clock-frequency:0"; -+ + act_led_gpio = <&act_led>,"gpios:4"; + act_led_activelow = <&act_led>,"gpios:8"; + act_led_trigger = <&act_led>,"linux,default-trigger"; @@ -83292,22 +83404,14 @@ index 0000000000000000000000000000000000000000..0b66ac9f25a5f7ae51f3d0666cfcb908 + pwr_led_gpio = <&pwr_led>,"gpios:4"; + pwr_led_activelow = <&pwr_led>,"gpios:8"; + pwr_led_trigger = <&pwr_led>,"linux,default-trigger"; -+ -+ audio = <&audio>,"status"; -+ watchdog = <&watchdog>,"status"; -+ random = <&random>,"status"; -+ sd_overclock = <&sdhost>,"brcm,overclock-50:0"; -+ sd_force_pio = <&sdhost>,"brcm,force-pio?"; -+ sd_pio_limit = <&sdhost>,"brcm,pio-limit:0"; -+ sd_debug = <&sdhost>,"brcm,debug"; + }; +}; diff --git a/arch/arm/boot/dts/bcm2708-rpi-b.dts b/arch/arm/boot/dts/bcm2708-rpi-b.dts new file mode 100644 -index 0000000000000000000000000000000000000000..e99e9d999e4142060c41eb47b93c8ac70a30f384 +index 0000000000000000000000000000000000000000..7e5151ad52a661f482b1de355210b5587417e87c --- /dev/null +++ b/arch/arm/boot/dts/bcm2708-rpi-b.dts -@@ -0,0 +1,147 @@ +@@ -0,0 +1,112 @@ +/dts-v1/; + +#include "bcm2708.dtsi" @@ -83318,11 +83422,6 @@ index 0000000000000000000000000000000000000000..e99e9d999e4142060c41eb47b93c8ac7 +}; + +&gpio { -+ sdhost_pins: sdhost_pins { -+ brcm,pins = <48 49 50 51 52 53>; -+ brcm,function = <4>; /* alt0 */ -+ }; -+ + spi0_pins: spi0_pins { + brcm,pins = <9 10 11>; + brcm,function = <4>; /* alt0 */ @@ -83354,17 +83453,6 @@ index 0000000000000000000000000000000000000000..e99e9d999e4142060c41eb47b93c8ac7 + }; +}; + -+&sdhost { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&sdhost_pins>; -+ bus-width = <4>; -+ status = "okay"; -+}; -+ -+&fb { -+ status = "okay"; -+}; -+ +&uart0 { + status = "okay"; +}; @@ -83431,36 +83519,17 @@ index 0000000000000000000000000000000000000000..e99e9d999e4142060c41eb47b93c8ac7 + +/ { + __overrides__ { -+ uart0 = <&uart0>,"status"; -+ uart1 = <&uart1>,"status"; -+ i2s = <&i2s>,"status"; -+ spi = <&spi0>,"status"; -+ i2c0 = <&i2c0>,"status"; -+ i2c1 = <&i2c1>,"status"; -+ i2c2_iknowwhatimdoing = <&i2c2>,"status"; -+ i2c0_baudrate = <&i2c0>,"clock-frequency:0"; -+ i2c1_baudrate = <&i2c1>,"clock-frequency:0"; -+ i2c2_baudrate = <&i2c2>,"clock-frequency:0"; -+ + act_led_gpio = <&act_led>,"gpios:4"; + act_led_activelow = <&act_led>,"gpios:8"; + act_led_trigger = <&act_led>,"linux,default-trigger"; -+ -+ audio = <&audio>,"status"; -+ watchdog = <&watchdog>,"status"; -+ random = <&random>,"status"; -+ sd_overclock = <&sdhost>,"brcm,overclock-50:0"; -+ sd_force_pio = <&sdhost>,"brcm,force-pio?"; -+ sd_pio_limit = <&sdhost>,"brcm,pio-limit:0"; -+ sd_debug = <&sdhost>,"brcm,debug"; + }; +}; diff --git a/arch/arm/boot/dts/bcm2708-rpi-cm.dts b/arch/arm/boot/dts/bcm2708-rpi-cm.dts new file mode 100644 -index 0000000000000000000000000000000000000000..10be69972bd1440f574e35d515f3d6a0505fd869 +index 0000000000000000000000000000000000000000..935867a7bb46addd9e205f93cb9db45b92722fa3 --- /dev/null +++ b/arch/arm/boot/dts/bcm2708-rpi-cm.dts -@@ -0,0 +1,110 @@ +@@ -0,0 +1,95 @@ +/dts-v1/; + +#include "bcm2708-rpi-cm.dtsi" @@ -83556,43 +83625,14 @@ index 0000000000000000000000000000000000000000..10be69972bd1440f574e35d515f3d6a0 +&hdmi { + hpd-gpios = <&gpio 46 GPIO_ACTIVE_HIGH>; +}; -+ -+/ { -+ __overrides__ { -+ uart0 = <&uart0>,"status"; -+ uart1 = <&uart1>,"status"; -+ i2s = <&i2s>,"status"; -+ spi = <&spi0>,"status"; -+ i2c0 = <&i2c0>,"status"; -+ i2c1 = <&i2c1>,"status"; -+ i2c2_iknowwhatimdoing = <&i2c2>,"status"; -+ i2c0_baudrate = <&i2c0>,"clock-frequency:0"; -+ i2c1_baudrate = <&i2c1>,"clock-frequency:0"; -+ i2c2_baudrate = <&i2c2>,"clock-frequency:0"; -+ }; -+}; diff --git a/arch/arm/boot/dts/bcm2708-rpi-cm.dtsi b/arch/arm/boot/dts/bcm2708-rpi-cm.dtsi new file mode 100644 -index 0000000000000000000000000000000000000000..d33d462b4090e4a4f967a37212918b9cf500bf76 +index 0000000000000000000000000000000000000000..d0299e3d9a09ddcdad80cb0957b30b14887b8a9a --- /dev/null +++ b/arch/arm/boot/dts/bcm2708-rpi-cm.dtsi -@@ -0,0 +1,50 @@ +@@ -0,0 +1,17 @@ +#include "bcm2708.dtsi" + -+&gpio { -+ sdhost_pins: sdhost_pins { -+ brcm,pins = <48 49 50 51 52 53>; -+ brcm,function = <4>; /* alt0 */ -+ }; -+}; -+ -+&gpio { -+ mmc_pins: mmc_pins { -+ brcm,pins = <48 49 50 51 52 53>; -+ brcm,function = <7>; /* alt3 */ -+ }; -+}; -+ +&leds { + act_led: act { + label = "led0"; @@ -83601,38 +83641,19 @@ index 0000000000000000000000000000000000000000..d33d462b4090e4a4f967a37212918b9c + }; +}; + -+ -+&sdhost { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&sdhost_pins>; -+ non-removable; -+ bus-width = <4>; -+ status = "okay"; -+ brcm,overclock-50 = <0>; -+}; -+ -+&fb { -+ status = "okay"; -+}; -+ +/ { + __overrides__ { + act_led_gpio = <&act_led>,"gpios:4"; + act_led_activelow = <&act_led>,"gpios:8"; + act_led_trigger = <&act_led>,"linux,default-trigger"; -+ -+ audio = <&audio>,"status"; -+ watchdog = <&watchdog>,"status"; -+ random = <&random>,"status"; -+ sd_overclock = <&mmc>,"brcm,overclock-50:0"; + }; +}; diff --git a/arch/arm/boot/dts/bcm2708-rpi.dtsi b/arch/arm/boot/dts/bcm2708-rpi.dtsi new file mode 100644 -index 0000000000000000000000000000000000000000..ef14e9ac6cd2092efb1681682dd2d3c52b8abfd5 +index 0000000000000000000000000000000000000000..29dde110e769082a24640d3c7284afb8e99b226c --- /dev/null +++ b/arch/arm/boot/dts/bcm2708-rpi.dtsi -@@ -0,0 +1,113 @@ +@@ -0,0 +1,174 @@ +/* Downstream version of bcm2835-rpi.dtsi */ + +#include @@ -83656,6 +83677,7 @@ index 0000000000000000000000000000000000000000..ef14e9ac6cd2092efb1681682dd2d3c5 + gpio = &gpio; + uart0 = &uart0; + sdhost = &sdhost; ++ mmc0 = &sdhost; + i2s = &i2s; + spi0 = &spi0; + i2c0 = &i2c0; @@ -83663,6 +83685,7 @@ index 0000000000000000000000000000000000000000..ef14e9ac6cd2092efb1681682dd2d3c5 + spi1 = &spi1; + spi2 = &spi2; + mmc = &mmc; ++ mmc1 = &mmc; + i2c1 = &i2c1; + i2c2 = &i2c2; + usb = &usb; @@ -83708,7 +83731,7 @@ index 0000000000000000000000000000000000000000..ef14e9ac6cd2092efb1681682dd2d3c5 + }; + + thermal: thermal@7e212000 { -+ firmware = <&firmware>; ++ #thermal-sensor-cells = <0>; + status = "okay"; + }; + @@ -83724,10 +83747,52 @@ index 0000000000000000000000000000000000000000..ef14e9ac6cd2092efb1681682dd2d3c5 + status = "disabled"; + }; + ++ thermal-zones { ++ cpu_thermal: cpu-thermal { ++ polling-delay-passive = <0>; ++ polling-delay = <1000>; ++ ++ thermal-sensors = <&thermal>; ++ ++ /* No trips ++ trips { ++ cpu-crit { ++ temperature = <80000>; ++ hysteresis = <0>; ++ type = "critical"; ++ }; ++ }; ++ */ ++ ++ coefficients = <(-538) 407000>; ++ ++ cooling-maps { ++ }; ++ }; ++ }; + }; + + __overrides__ { + cache_line_size = <&vchiq>, "cache-line-size:0"; ++ ++ uart0 = <&uart0>,"status"; ++ uart1 = <&uart1>,"status"; ++ i2s = <&i2s>,"status"; ++ spi = <&spi0>,"status"; ++ i2c0 = <&i2c0>,"status"; ++ i2c1 = <&i2c1>,"status"; ++ i2c2_iknowwhatimdoing = <&i2c2>,"status"; ++ i2c0_baudrate = <&i2c0>,"clock-frequency:0"; ++ i2c1_baudrate = <&i2c1>,"clock-frequency:0"; ++ i2c2_baudrate = <&i2c2>,"clock-frequency:0"; ++ ++ audio = <&audio>,"status"; ++ watchdog = <&watchdog>,"status"; ++ random = <&random>,"status"; ++ sd_overclock = <&sdhost>,"brcm,overclock-50:0"; ++ sd_force_pio = <&sdhost>,"brcm,force-pio?"; ++ sd_pio_limit = <&sdhost>,"brcm,pio-limit:0"; ++ sd_debug = <&sdhost>,"brcm,debug"; + }; +}; + @@ -83746,12 +83811,29 @@ index 0000000000000000000000000000000000000000..ef14e9ac6cd2092efb1681682dd2d3c5 +&clocks { + firmware = <&firmware>; +}; ++ ++sdhost_pins: &sdhost_gpio48 { ++ /* Add alias */ ++}; ++ ++&sdhost { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&sdhost_gpio48>; ++ bus-width = <4>; ++ brcm,overclock-50 = <0>; ++ brcm,pio-limit = <1>; ++ status = "okay"; ++}; ++ ++&fb { ++ status = "okay"; ++}; diff --git a/arch/arm/boot/dts/bcm2708.dtsi b/arch/arm/boot/dts/bcm2708.dtsi new file mode 100644 -index 0000000000000000000000000000000000000000..0f72bd90c591a2e8752d7437fa7e8c6308bd8c3f +index 0000000000000000000000000000000000000000..756bd3687b488da98f749b27ddfe098693990045 --- /dev/null +++ b/arch/arm/boot/dts/bcm2708.dtsi -@@ -0,0 +1,16 @@ +@@ -0,0 +1,20 @@ +#include "bcm2835.dtsi" +#include "bcm270x.dtsi" +#include "bcm2708-rpi.dtsi" @@ -83767,13 +83849,17 @@ index 0000000000000000000000000000000000000000..0f72bd90c591a2e8752d7437fa7e8c63 + }; + + /delete-node/ cpus; ++ ++ __overrides__ { ++ arm_freq; ++ }; +}; diff --git a/arch/arm/boot/dts/bcm2709-rpi-2-b.dts b/arch/arm/boot/dts/bcm2709-rpi-2-b.dts new file mode 100644 -index 0000000000000000000000000000000000000000..20674f250af922e9f9a43e3e8b13aee42e3930be +index 0000000000000000000000000000000000000000..434c451928b4830530d008d9c9ede9b0fc0c1b92 --- /dev/null +++ b/arch/arm/boot/dts/bcm2709-rpi-2-b.dts -@@ -0,0 +1,157 @@ +@@ -0,0 +1,122 @@ +/dts-v1/; + +#include "bcm2709.dtsi" @@ -83784,11 +83870,6 @@ index 0000000000000000000000000000000000000000..20674f250af922e9f9a43e3e8b13aee4 +}; + +&gpio { -+ sdhost_pins: sdhost_pins { -+ brcm,pins = <48 49 50 51 52 53>; -+ brcm,function = <4>; /* alt0 */ -+ }; -+ + spi0_pins: spi0_pins { + brcm,pins = <9 10 11>; + brcm,function = <4>; /* alt0 */ @@ -83820,17 +83901,6 @@ index 0000000000000000000000000000000000000000..20674f250af922e9f9a43e3e8b13aee4 + }; +}; + -+&sdhost { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&sdhost_pins>; -+ bus-width = <4>; -+ status = "okay"; -+}; -+ -+&fb { -+ status = "okay"; -+}; -+ +&uart0 { + status = "okay"; +}; @@ -83903,17 +83973,6 @@ index 0000000000000000000000000000000000000000..20674f250af922e9f9a43e3e8b13aee4 + +/ { + __overrides__ { -+ uart0 = <&uart0>,"status"; -+ uart1 = <&uart1>,"status"; -+ i2s = <&i2s>,"status"; -+ spi = <&spi0>,"status"; -+ i2c0 = <&i2c0>,"status"; -+ i2c1 = <&i2c1>,"status"; -+ i2c2_iknowwhatimdoing = <&i2c2>,"status"; -+ i2c0_baudrate = <&i2c0>,"clock-frequency:0"; -+ i2c1_baudrate = <&i2c1>,"clock-frequency:0"; -+ i2c2_baudrate = <&i2c2>,"clock-frequency:0"; -+ + act_led_gpio = <&act_led>,"gpios:4"; + act_led_activelow = <&act_led>,"gpios:8"; + act_led_trigger = <&act_led>,"linux,default-trigger"; @@ -83921,14 +83980,6 @@ index 0000000000000000000000000000000000000000..20674f250af922e9f9a43e3e8b13aee4 + pwr_led_gpio = <&pwr_led>,"gpios:4"; + pwr_led_activelow = <&pwr_led>,"gpios:8"; + pwr_led_trigger = <&pwr_led>,"linux,default-trigger"; -+ -+ audio = <&audio>,"status"; -+ watchdog = <&watchdog>,"status"; -+ random = <&random>,"status"; -+ sd_overclock = <&sdhost>,"brcm,overclock-50:0"; -+ sd_force_pio = <&sdhost>,"brcm,force-pio?"; -+ sd_pio_limit = <&sdhost>,"brcm,pio-limit:0"; -+ sd_debug = <&sdhost>,"brcm,debug"; + }; +}; diff --git a/arch/arm/boot/dts/bcm2709.dtsi b/arch/arm/boot/dts/bcm2709.dtsi @@ -83961,10 +84012,10 @@ index 0000000000000000000000000000000000000000..343437db94820bb75a9b81e8bc6ecf6f +}; diff --git a/arch/arm/boot/dts/bcm270x.dtsi b/arch/arm/boot/dts/bcm270x.dtsi new file mode 100644 -index 0000000000000000000000000000000000000000..36d853715f2379e1952ce3d3be58dd670e305159 +index 0000000000000000000000000000000000000000..81914a615c8b011fe7d70a2e14f16491947c49b7 --- /dev/null +++ b/arch/arm/boot/dts/bcm270x.dtsi -@@ -0,0 +1,157 @@ +@@ -0,0 +1,145 @@ +/* Downstream bcm283x.dtsi diff */ +#include "dt-bindings/power/raspberrypi-power.h" + @@ -83993,18 +84044,6 @@ index 0000000000000000000000000000000000000000..36d853715f2379e1952ce3d3be58dd67 + interrupts = <2 17>, <2 18>; + }; + -+ sdhost: sdhost@7e202000 { -+ compatible = "brcm,bcm2835-sdhost"; -+ reg = <0x7e202000 0x100>; -+ interrupts = <2 24>; -+ clocks = <&clocks BCM2835_CLOCK_VPU>; -+ dmas = <&dma 13>; -+ dma-names = "rx-tx"; -+ brcm,overclock-50 = <0>; -+ brcm,pio-limit = <1>; -+ status = "disabled"; -+ }; -+ + i2s@7e203000 { /* i2s */ + #sound-dai-cells = <0>; + reg = <0x7e203000 0x24>; @@ -84124,10 +84163,10 @@ index 0000000000000000000000000000000000000000..36d853715f2379e1952ce3d3be58dd67 +}; diff --git a/arch/arm/boot/dts/bcm2710-rpi-3-b.dts b/arch/arm/boot/dts/bcm2710-rpi-3-b.dts new file mode 100644 -index 0000000000000000000000000000000000000000..616cfd5c7094596b497101e8feca25e25e77c3e8 +index 0000000000000000000000000000000000000000..634add7ab8bc0aa5501508c97050b101aa0e94f4 --- /dev/null +++ b/arch/arm/boot/dts/bcm2710-rpi-3-b.dts -@@ -0,0 +1,226 @@ +@@ -0,0 +1,191 @@ +/dts-v1/; + +#ifdef RPI364 @@ -84142,11 +84181,6 @@ index 0000000000000000000000000000000000000000..616cfd5c7094596b497101e8feca25e2 +}; + +&gpio { -+ sdhost_pins: sdhost_pins { -+ brcm,pins = <48 49 50 51 52 53>; -+ brcm,function = <4>; /* alt0 */ -+ }; -+ + spi0_pins: spi0_pins { + brcm,pins = <9 10 11>; + brcm,function = <4>; /* alt0 */ @@ -84202,13 +84236,6 @@ index 0000000000000000000000000000000000000000..616cfd5c7094596b497101e8feca25e2 + }; +}; + -+&sdhost { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&sdhost_pins>; -+ bus-width = <4>; -+ status = "okay"; -+}; -+ +&mmc { + pinctrl-names = "default"; + pinctrl-0 = <&sdio_pins>; @@ -84236,10 +84263,6 @@ index 0000000000000000000000000000000000000000..616cfd5c7094596b497101e8feca25e2 + }; +}; + -+&fb { -+ status = "okay"; -+}; -+ +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins &bt_pins>; @@ -84305,7 +84328,7 @@ index 0000000000000000000000000000000000000000..616cfd5c7094596b497101e8feca25e2 + pwr_led: pwr { + label = "led1"; + linux,default-trigger = "input"; -+ gpios = <&expgpio 7 GPIO_ACTIVE_LOW>; ++ gpios = <&expgpio 7 0>; + }; +}; + @@ -84326,17 +84349,6 @@ index 0000000000000000000000000000000000000000..616cfd5c7094596b497101e8feca25e2 + +/ { + __overrides__ { -+ uart0 = <&uart0>,"status"; -+ uart1 = <&uart1>,"status"; -+ i2s = <&i2s>,"status"; -+ spi = <&spi0>,"status"; -+ i2c0 = <&i2c0>,"status"; -+ i2c1 = <&i2c1>,"status"; -+ i2c2_iknowwhatimdoing = <&i2c2>,"status"; -+ i2c0_baudrate = <&i2c0>,"clock-frequency:0"; -+ i2c1_baudrate = <&i2c1>,"clock-frequency:0"; -+ i2c2_baudrate = <&i2c2>,"clock-frequency:0"; -+ + act_led_gpio = <&act_led>,"gpios:4"; + act_led_activelow = <&act_led>,"gpios:8"; + act_led_trigger = <&act_led>,"linux,default-trigger"; @@ -84344,22 +84356,14 @@ index 0000000000000000000000000000000000000000..616cfd5c7094596b497101e8feca25e2 + pwr_led_gpio = <&pwr_led>,"gpios:4"; + pwr_led_activelow = <&pwr_led>,"gpios:8"; + pwr_led_trigger = <&pwr_led>,"linux,default-trigger"; -+ -+ audio = <&audio>,"status"; -+ watchdog = <&watchdog>,"status"; -+ random = <&random>,"status"; -+ sd_overclock = <&sdhost>,"brcm,overclock-50:0"; -+ sd_force_pio = <&sdhost>,"brcm,force-pio?"; -+ sd_pio_limit = <&sdhost>,"brcm,pio-limit:0"; -+ sd_debug = <&sdhost>,"brcm,debug"; + }; +}; diff --git a/arch/arm/boot/dts/bcm2710-rpi-cm3.dts b/arch/arm/boot/dts/bcm2710-rpi-cm3.dts new file mode 100644 -index 0000000000000000000000000000000000000000..fe402e84cdda884583336422289ac8b3cc12fb28 +index 0000000000000000000000000000000000000000..a84552eca6a54dafd6d016dfb60e9d4ce064041f --- /dev/null +++ b/arch/arm/boot/dts/bcm2710-rpi-cm3.dts -@@ -0,0 +1,167 @@ +@@ -0,0 +1,129 @@ +/dts-v1/; + +#include "bcm2710.dtsi" @@ -84373,12 +84377,6 @@ index 0000000000000000000000000000000000000000..fe402e84cdda884583336422289ac8b3 +}; + +&gpio { -+ sdhost_pins: sdhost_pins { -+ brcm,pins = <48 49 50 51 52 53>; -+ brcm,function = <4>; /* alt0 */ -+ brcm,pull = <0 2 2 2 2 2>; -+ }; -+ + spi0_pins: spi0_pins { + brcm,pins = <9 10 11>; + brcm,function = <4>; /* alt0 */ @@ -84410,15 +84408,6 @@ index 0000000000000000000000000000000000000000..fe402e84cdda884583336422289ac8b3 + }; +}; + -+&sdhost { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&sdhost_pins>; -+ non-removable; -+ bus-width = <4>; -+ status = "okay"; -+ brcm,overclock-50 = <0>; -+}; -+ +&soc { + virtgpio: virtgpio { + compatible = "brcm,bcm2835-virtgpio"; @@ -84437,10 +84426,6 @@ index 0000000000000000000000000000000000000000..fe402e84cdda884583336422289ac8b3 + }; +}; + -+&fb { -+ status = "okay"; -+}; -+ +&spi0 { + pinctrl-names = "default"; + pinctrl-0 = <&spi0_pins &spi0_cs_pins>; @@ -84503,28 +84488,9 @@ index 0000000000000000000000000000000000000000..fe402e84cdda884583336422289ac8b3 + +/ { + __overrides__ { -+ uart0 = <&uart0>,"status"; -+ uart1 = <&uart1>,"status"; -+ i2s = <&i2s>,"status"; -+ spi = <&spi0>,"status"; -+ i2c0 = <&i2c0>,"status"; -+ i2c1 = <&i2c1>,"status"; -+ i2c2_iknowwhatimdoing = <&i2c2>,"status"; -+ i2c0_baudrate = <&i2c0>,"clock-frequency:0"; -+ i2c1_baudrate = <&i2c1>,"clock-frequency:0"; -+ i2c2_baudrate = <&i2c2>,"clock-frequency:0"; -+ + act_led_gpio = <&act_led>,"gpios:4"; + act_led_activelow = <&act_led>,"gpios:8"; + act_led_trigger = <&act_led>,"linux,default-trigger"; -+ -+ audio = <&audio>,"status"; -+ watchdog = <&watchdog>,"status"; -+ random = <&random>,"status"; -+ sd_overclock = <&sdhost>,"brcm,overclock-50:0"; -+ sd_force_pio = <&sdhost>,"brcm,force-pio?"; -+ sd_pio_limit = <&sdhost>,"brcm,pio-limit:0"; -+ sd_debug = <&sdhost>,"brcm,debug"; + }; +}; diff --git a/arch/arm/boot/dts/bcm2710.dtsi b/arch/arm/boot/dts/bcm2710.dtsi @@ -84682,10 +84648,10 @@ index 0000000000000000000000000000000000000000..3e134a1208610b90e2d0fc22f03c6e9f +}; + diff --git a/arch/arm/boot/dts/bcm283x.dtsi b/arch/arm/boot/dts/bcm283x.dtsi -index a3106aa446c6906108c90952cd39520ff195ef79..72cb9dc60ca9ad9aa2813972a299c50dcea7cd89 100644 +index 561f27d8d92224fe8f4f8c3224a5441f2d41175a..dae54df8dfc945962cf6f0680159e8d369142ab0 100644 --- a/arch/arm/boot/dts/bcm283x.dtsi +++ b/arch/arm/boot/dts/bcm283x.dtsi -@@ -366,6 +366,7 @@ +@@ -383,6 +383,7 @@ #address-cells = <1>; #size-cells = <0>; status = "disabled"; @@ -84693,12 +84659,50 @@ index a3106aa446c6906108c90952cd39520ff195ef79..72cb9dc60ca9ad9aa2813972a299c50d }; i2c0: i2c@7e205000 { +@@ -438,12 +439,16 @@ + #clock-cells = <1>; + reg = <0x7e215000 0x8>; + clocks = <&clocks BCM2835_CLOCK_VPU>; ++ interrupts = <1 29>; ++ interrupt-controller; ++ #interrupt-cells = <1>; + }; + + uart1: serial@7e215040 { + compatible = "brcm,bcm2835-aux-uart"; + reg = <0x7e215040 0x40>; +- interrupts = <1 29>; ++ interrupt-parent = <&aux>; ++ interrupts = <0>; + clocks = <&aux BCM2835_AUX_CLOCK_UART>; + status = "disabled"; + }; +@@ -451,7 +456,8 @@ + spi1: spi@7e215080 { + compatible = "brcm,bcm2835-aux-spi"; + reg = <0x7e215080 0x40>; +- interrupts = <1 29>; ++ interrupt-parent = <&aux>; ++ interrupts = <1>; + clocks = <&aux BCM2835_AUX_CLOCK_SPI1>; + #address-cells = <1>; + #size-cells = <0>; +@@ -461,7 +467,8 @@ + spi2: spi@7e2150c0 { + compatible = "brcm,bcm2835-aux-spi"; + reg = <0x7e2150c0 0x40>; +- interrupts = <1 29>; ++ interrupt-parent = <&aux>; ++ interrupts = <2>; + clocks = <&aux BCM2835_AUX_CLOCK_SPI2>; + #address-cells = <1>; + #size-cells = <0>; diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile new file mode 100644 -index 0000000000000000000000000000000000000000..0f7340799fb465ba1fb5aaa1e970cbf6295d75c4 +index 0000000000000000000000000000000000000000..e2f66a55dc5afe13d690c2c17827054ac94b7168 --- /dev/null +++ b/arch/arm/boot/dts/overlays/Makefile -@@ -0,0 +1,114 @@ +@@ -0,0 +1,118 @@ +# Overlays for the Raspberry Pi platform + +dtbo-$(CONFIG_ARCH_BCM2835) += \ @@ -84708,7 +84712,9 @@ index 0000000000000000000000000000000000000000..0f7340799fb465ba1fb5aaa1e970cbf6 + ads1115.dtbo \ + ads7846.dtbo \ + akkordion-iqdacplus.dtbo \ ++ allo-boss-dac-pcm512x-audio.dtbo \ + allo-piano-dac-pcm512x-audio.dtbo \ ++ allo-piano-dac-plus-pcm512x-audio.dtbo \ + at86rf233.dtbo \ + audioinjector-addons.dtbo \ + audioinjector-wm8731-audio.dtbo \ @@ -84724,6 +84730,7 @@ index 0000000000000000000000000000000000000000..0f7340799fb465ba1fb5aaa1e970cbf6 + enc28j60.dtbo \ + enc28j60-spi2.dtbo \ + fe-pi-audio.dtbo \ ++ googlevoicehat-soundcard.dtbo \ + gpio-ir.dtbo \ + gpio-poweroff.dtbo \ + hifiberry-amp.dtbo \ @@ -84779,6 +84786,7 @@ index 0000000000000000000000000000000000000000..0f7340799fb465ba1fb5aaa1e970cbf6 + rpi-ft5406.dtbo \ + rpi-proto.dtbo \ + rpi-sense.dtbo \ ++ rpi-tv.dtbo \ + rra-digidac1-wm8741-audio.dtbo \ + sc16is750-i2c.dtbo \ + sc16is752-spi1.dtbo \ @@ -84815,10 +84823,10 @@ index 0000000000000000000000000000000000000000..0f7340799fb465ba1fb5aaa1e970cbf6 +clean-files := *.dtbo diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README new file mode 100644 -index 0000000000000000000000000000000000000000..c1883bba938290f03826026651c764cfd4ac278b +index 0000000000000000000000000000000000000000..e2a803e5180cf78d67b6723cfd2f6d3b2b54e53b --- /dev/null +++ b/arch/arm/boot/dts/overlays/README -@@ -0,0 +1,1458 @@ +@@ -0,0 +1,1517 @@ +Introduction +============ + @@ -85084,6 +85092,30 @@ index 0000000000000000000000000000000000000000..c1883bba938290f03826026651c764cf + that does not result in clipping/distortion!) + + ++Name: allo-boss-dac-pcm512x-audio ++Info: Configures the Allo Boss DAC audio cards. ++Load: dtoverlay=allo-boss-dac-pcm512x-audio, ++Params: 24db_digital_gain Allow gain to be applied via the PCM512x codec ++ Digital volume control. Enable with ++ "dtoverlay=allo-boss-dac-pcm512x-audio, ++ 24db_digital_gain" ++ (The default behaviour is that the Digital ++ volume control is limited to a maximum of ++ 0dB. ie. it can attenuate but not provide ++ gain. For most users, this will be desired ++ as it will prevent clipping. By appending ++ the 24db_digital_gain parameter, the Digital ++ volume control will allow up to 24dB of ++ gain. If this parameter is enabled, it is the ++ responsibility of the user to ensure that ++ the Digital volume control is set to a value ++ that does not result in clipping/distortion!) ++ slave Force Boss DAC into slave mode, using Pi a ++ master for bit clock and frame clock. Enable ++ with "dtoverlay=allo-boss-dac-pcm512x-audio, ++ slave" ++ ++ +Name: allo-piano-dac-pcm512x-audio +Info: Configures the Allo Piano DAC (2.0/2.1) audio cards. + (NB. This initial support is for 2.0 channel audio ONLY! ie. stereo. @@ -85104,6 +85136,27 @@ index 0000000000000000000000000000000000000000..c1883bba938290f03826026651c764cf + that does not result in clipping/distortion!) + + ++Name: allo-piano-dac-plus-pcm512x-audio ++Info: Configures the Allo Piano DAC (2.1) audio cards. ++Load: dtoverlay=allo-piano-dac-plus-pcm512x-audio, ++Params: 24db_digital_gain Allow gain to be applied via the PCM512x codec ++ Digital volume control. ++ (The default behaviour is that the Digital ++ volume control is limited to a maximum of ++ 0dB. ie. it can attenuate but not provide ++ gain. For most users, this will be desired ++ as it will prevent clipping. By appending ++ the 24db_digital_gain parameter, the Digital ++ volume control will allow up to 24dB of ++ gain. If this parameter is enabled, it is the ++ responsibility of the user to ensure that ++ the Digital volume control is set to a value ++ that does not result in clipping/distortion!) ++ glb_mclk This option is only with Kali board. If enabled, ++ MCLK for Kali is used and PLL is disabled for ++ better voice quality. (default Off) ++ ++ +Name: at86rf233 +Info: Configures the Atmel AT86RF233 802.15.4 low-power WPAN transceiver, + connected to spi0.0 @@ -85209,9 +85262,6 @@ index 0000000000000000000000000000000000000000..c1883bba938290f03826026651c764cf + g-np-tx-fifo-size Size of non-periodic tx fifo size in gadget + mode + -+ g-tx-fifo-size Size of periodic tx fifo per endpoint -+ (except ep0) in gadget mode -+ + +[ The ds1307-rtc overlay has been deleted. See i2c-rtc. ] + @@ -85238,6 +85288,12 @@ index 0000000000000000000000000000000000000000..c1883bba938290f03826026651c764cf +Params: + + ++Name: googlevoicehat-soundcard ++Info: Configures the Google voiceHAT soundcard ++Load: dtoverlay=googlevoicehat-soundcard ++Params: ++ ++ +Name: gpio-ir +Info: Use GPIO pin as rc-core style infrared receiver input. The rc-core- + based gpio_ir_recv driver maps received keys directly to a @@ -85429,6 +85485,11 @@ index 0000000000000000000000000000000000000000..c1883bba938290f03826026651c764cf + + bmp280 Select the Bosch sensortronic BMP280 + ++ lm75 Select the Maxim LM75 temperature sensor ++ ++ lm75addr Choose the address for the LM75 (0x48-0x4f - ++ default 0x4f) ++ + si7020 Select the Silicon Labs Si7013/20/21 humidity/ + temperature sensor + @@ -85910,6 +85971,12 @@ index 0000000000000000000000000000000000000000..c1883bba938290f03826026651c764cf +Params: + + ++Name: rpi-tv ++Info: Raspberry Pi TV HAT ++Load: dtoverlay=rpi-tv ++Params: ++ ++ +Name: rra-digidac1-wm8741-audio +Info: Configures the Red Rocks Audio DigiDAC1 soundcard +Load: dtoverlay=rra-digidac1-wm8741-audio @@ -86744,6 +86811,71 @@ index 0000000000000000000000000000000000000000..241d03b9b79ef5e833cc28819003946a + 24db_digital_gain = <&frag2>,"iqaudio,24db_digital_gain?"; + }; +}; +diff --git a/arch/arm/boot/dts/overlays/allo-boss-dac-pcm512x-audio-overlay.dts b/arch/arm/boot/dts/overlays/allo-boss-dac-pcm512x-audio-overlay.dts +new file mode 100644 +index 0000000000000000000000000000000000000000..ac1cfe093d9aa8a77ef25cc62a9d8100d81ca684 +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/allo-boss-dac-pcm512x-audio-overlay.dts +@@ -0,0 +1,59 @@ ++/* ++ * Definitions for Allo Boss DAC board ++ */ ++ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target-path = "/clocks"; ++ __overlay__ { ++ boss_osc: boss_osc { ++ compatible = "allo,dac-clk"; ++ #clock-cells = <0>; ++ }; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&i2s>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&i2c1>; ++ __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ pcm5122@4d { ++ #sound-dai-cells = <0>; ++ compatible = "ti,pcm5122"; ++ clocks = <&boss_osc>; ++ reg = <0x4d>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ fragment@3 { ++ target = <&sound>; ++ boss_dac: __overlay__ { ++ compatible = "allo,boss-dac"; ++ i2s-controller = <&i2s>; ++ mute-gpios = <&gpio 6 1>; ++ status = "okay"; ++ }; ++ }; ++ ++ __overrides__ { ++ 24db_digital_gain = <&boss_dac>,"allo,24db_digital_gain?"; ++ slave = <&boss_dac>,"allo,slave?"; ++ }; ++}; diff --git a/arch/arm/boot/dts/overlays/allo-piano-dac-pcm512x-audio-overlay.dts b/arch/arm/boot/dts/overlays/allo-piano-dac-pcm512x-audio-overlay.dts new file mode 100644 index 0000000000000000000000000000000000000000..a5468d850a911cd509365cf25f8ffa6ad071b90a @@ -86804,6 +86936,67 @@ index 0000000000000000000000000000000000000000..a5468d850a911cd509365cf25f8ffa6a + <&piano_dac>,"allo,24db_digital_gain?"; + }; +}; +diff --git a/arch/arm/boot/dts/overlays/allo-piano-dac-plus-pcm512x-audio-overlay.dts b/arch/arm/boot/dts/overlays/allo-piano-dac-plus-pcm512x-audio-overlay.dts +new file mode 100644 +index 0000000000000000000000000000000000000000..5c1c81c427a8b396ca9e9c903e97f2711850d4c6 +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/allo-piano-dac-plus-pcm512x-audio-overlay.dts +@@ -0,0 +1,55 @@ ++// Definitions for Piano DAC ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target = <&i2s>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&i2c1>; ++ __overlay__ { ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "okay"; ++ ++ allo_pcm5122_4c: pcm5122@4c { ++ #sound-dai-cells = <0>; ++ compatible = "ti,pcm5122"; ++ reg = <0x4c>; ++ status = "okay"; ++ }; ++ allo_pcm5122_4d: pcm5122@4d { ++ #sound-dai-cells = <0>; ++ compatible = "ti,pcm5122"; ++ reg = <0x4d>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ fragment@2 { ++ target = <&sound>; ++ piano_dac: __overlay__ { ++ compatible = "allo,piano-dac-plus"; ++ audio-codec = <&allo_pcm5122_4c &allo_pcm5122_4d>; ++ i2s-controller = <&i2s>; ++ mute1-gpios = <&gpio 6 1>; ++ mute2-gpios = <&gpio 25 1>; ++ status = "okay"; ++ }; ++ }; ++ ++ __overrides__ { ++ 24db_digital_gain = ++ <&piano_dac>,"allo,24db_digital_gain?"; ++ glb_mclk = ++ <&piano_dac>,"allo,glb_mclk?"; ++ }; ++}; diff --git a/arch/arm/boot/dts/overlays/at86rf233-overlay.dts b/arch/arm/boot/dts/overlays/at86rf233-overlay.dts new file mode 100644 index 0000000000000000000000000000000000000000..880c7539d496fb10672ee573f7c51b8a213cecf7 @@ -86869,10 +87062,10 @@ index 0000000000000000000000000000000000000000..880c7539d496fb10672ee573f7c51b8a +}; diff --git a/arch/arm/boot/dts/overlays/audioinjector-addons-overlay.dts b/arch/arm/boot/dts/overlays/audioinjector-addons-overlay.dts new file mode 100644 -index 0000000000000000000000000000000000000000..dbf2f3cacc2e6bf5b7116fbadd97f2781580a79c +index 0000000000000000000000000000000000000000..a40bb1193a4cebc5672709e8db861e1167d3a699 --- /dev/null +++ b/arch/arm/boot/dts/overlays/audioinjector-addons-overlay.dts -@@ -0,0 +1,50 @@ +@@ -0,0 +1,55 @@ +// Definitions for audioinjector.net audio add on soundcard +/dts-v1/; +/plugin/; @@ -86900,6 +87093,10 @@ index 0000000000000000000000000000000000000000..dbf2f3cacc2e6bf5b7116fbadd97f278 + reg = <0x48>; + clocks = <&cs42448_mclk>; + clock-names = "mclk"; ++ VA-supply = <&vdd_5v0_reg>; ++ VD-supply = <&vdd_3v3_reg>; ++ VLS-supply = <&vdd_3v3_reg>; ++ VLC-supply = <&vdd_3v3_reg>; + status = "okay"; + }; + @@ -86917,6 +87114,7 @@ index 0000000000000000000000000000000000000000..dbf2f3cacc2e6bf5b7116fbadd97f278 + compatible = "ai,audioinjector-octo-soundcard"; + mult-gpios = <&gpio 27 0>, <&gpio 22 0>, <&gpio 23 0>, + <&gpio 24 0>; ++ reset-gpios = <&gpio 5 0>; + i2s-controller = <&i2s>; + codec = <&cs42448>; + status = "okay"; @@ -87269,10 +87467,10 @@ index 0000000000000000000000000000000000000000..fc48bd1eac605115c3b89fddfe39f5ea +}; diff --git a/arch/arm/boot/dts/overlays/dwc2-overlay.dts b/arch/arm/boot/dts/overlays/dwc2-overlay.dts new file mode 100644 -index 0000000000000000000000000000000000000000..527abc9f0ddf71f4dc7d58336d87684c931cc2f3 +index 0000000000000000000000000000000000000000..265a16bab008453edba198cf2366c423509d60d6 --- /dev/null +++ b/arch/arm/boot/dts/overlays/dwc2-overlay.dts -@@ -0,0 +1,29 @@ +@@ -0,0 +1,28 @@ +/dts-v1/; +/plugin/; + @@ -87290,7 +87488,7 @@ index 0000000000000000000000000000000000000000..527abc9f0ddf71f4dc7d58336d87684c + dr_mode = "otg"; + g-np-tx-fifo-size = <32>; + g-rx-fifo-size = <256>; -+ g-tx-fifo-size = <256 128 128 64 64 64 32>; ++ g-tx-fifo-size = <512 512 512 512 512 768>; + status = "okay"; + }; + }; @@ -87299,7 +87497,6 @@ index 0000000000000000000000000000000000000000..527abc9f0ddf71f4dc7d58336d87684c + dr_mode = <&dwc2_usb>, "dr_mode"; + g-np-tx-fifo-size = <&dwc2_usb>,"g-np-tx-fifo-size:0"; + g-rx-fifo-size = <&dwc2_usb>,"g-rx-fifo-size:0"; -+ g-tx-fifo-size = <&dwc2_usb>,"g-tx-fifo-size:0"; + }; +}; diff --git a/arch/arm/boot/dts/overlays/enc28j60-overlay.dts b/arch/arm/boot/dts/overlays/enc28j60-overlay.dts @@ -87490,6 +87687,61 @@ index 0000000000000000000000000000000000000000..81a07ed5a8c7594e65f0df2176418cac + }; + }; +}; +diff --git a/arch/arm/boot/dts/overlays/googlevoicehat-soundcard-overlay.dts b/arch/arm/boot/dts/overlays/googlevoicehat-soundcard-overlay.dts +new file mode 100644 +index 0000000000000000000000000000000000000000..9a9e9a0ca28cf774a868b2882ae57b00de1cf7b7 +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/googlevoicehat-soundcard-overlay.dts +@@ -0,0 +1,49 @@ ++// Definitions for Google voiceHAT v1 soundcard overlay ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2708"; ++ ++ fragment@0 { ++ target = <&i2s>; ++ __overlay__ { ++ status = "okay"; ++ }; ++ }; ++ ++ fragment@1 { ++ target = <&gpio>; ++ __overlay__ { ++ googlevoicehat_pins: googlevoicehat_pins { ++ brcm,pins = <16>; ++ brcm,function = <1>; /* out */ ++ brcm,pull = <0>; /* up */ ++ }; ++ }; ++ }; ++ ++ ++ fragment@2 { ++ target-path = "/"; ++ __overlay__ { ++ voicehat-codec { ++ #sound-dai-cells = <0>; ++ compatible = "google,voicehat"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&googlevoicehat_pins>; ++ sdmode-gpios= <&gpio 16 0>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ fragment@3 { ++ target = <&sound>; ++ __overlay__ { ++ compatible = "googlevoicehat,googlevoicehat-soundcard"; ++ i2s-controller = <&i2s>; ++ status = "okay"; ++ }; ++ }; ++}; diff --git a/arch/arm/boot/dts/overlays/gpio-ir-overlay.dts b/arch/arm/boot/dts/overlays/gpio-ir-overlay.dts new file mode 100644 index 0000000000000000000000000000000000000000..af5baf7ddc92be7a59ad3d5f9a9fefba915bed05 @@ -88415,10 +88667,10 @@ index 0000000000000000000000000000000000000000..1efcf0b712c9c5c19210545002ac1f09 +}; diff --git a/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts b/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts new file mode 100644 -index 0000000000000000000000000000000000000000..31bda8da4cb6a56bfe493a81b918900995fb0589 +index 0000000000000000000000000000000000000000..606b2d5012abf2e85712be631c42ea40a0b512c5 --- /dev/null +++ b/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts -@@ -0,0 +1,41 @@ +@@ -0,0 +1,49 @@ +// Definitions for I2C based sensors using the Industrial IO interface. +/dts-v1/; +/plugin/; @@ -88446,6 +88698,12 @@ index 0000000000000000000000000000000000000000..31bda8da4cb6a56bfe493a81b9189009 + status = "disable"; + }; + ++ lm75: lm75@4f { ++ compatible = "lm75"; ++ reg = <0x4f>; ++ status = "disable"; ++ }; ++ + si7020: si7020@40 { + compatible = "si7020"; + reg = <0x40>; @@ -88457,6 +88715,8 @@ index 0000000000000000000000000000000000000000..31bda8da4cb6a56bfe493a81b9189009 + __overrides__ { + bmp085 = <&bmp085>,"status"; + bmp280 = <&bmp280>,"status"; ++ lm75 = <&lm75>,"status"; ++ lm75addr = <&lm75>,"reg:0"; + si7020 = <&si7020>,"status"; + }; +}; @@ -90127,10 +90387,10 @@ index 0000000000000000000000000000000000000000..565af7cf79d761877be3bd06191f31aa +}; diff --git a/arch/arm/boot/dts/overlays/mmc-overlay.dts b/arch/arm/boot/dts/overlays/mmc-overlay.dts new file mode 100644 -index 0000000000000000000000000000000000000000..d32b02ca01ced5ab3de00d66d5412c8fda4bc510 +index 0000000000000000000000000000000000000000..88251ad653917674f80c2975de2e425fca00b71f --- /dev/null +++ b/arch/arm/boot/dts/overlays/mmc-overlay.dts -@@ -0,0 +1,38 @@ +@@ -0,0 +1,39 @@ +/dts-v1/; +/plugin/; + @@ -90154,6 +90414,7 @@ index 0000000000000000000000000000000000000000..d32b02ca01ced5ab3de00d66d5412c8f + mmc_pins: mmc_pins { + brcm,pins = <48 49 50 51 52 53>; + brcm,function = <7>; /* alt3 */ ++ brcm,pull = <0 2 2 2 2 2>; + }; + }; + }; @@ -91929,6 +92190,43 @@ index 0000000000000000000000000000000000000000..27153240e1be595ae07c7ec74db16155 + }; + }; +}; +diff --git a/arch/arm/boot/dts/overlays/rpi-tv-overlay.dts b/arch/arm/boot/dts/overlays/rpi-tv-overlay.dts +new file mode 100644 +index 0000000000000000000000000000000000000000..a68f6f793d8efd8b2e2adf9f2fb6426f61ff464a +--- /dev/null ++++ b/arch/arm/boot/dts/overlays/rpi-tv-overlay.dts +@@ -0,0 +1,31 @@ ++// rpi-tv HAT ++ ++/dts-v1/; ++/plugin/; ++ ++/ { ++ compatible = "brcm,bcm2708", "brcm,bcm2709"; ++ ++ fragment@0 { ++ target = <&spi0>; ++ __overlay__ { ++ /* needed to avoid dtc warning */ ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ status = "okay"; ++ ++ spidev@0 { ++ status = "disabled"; ++ }; ++ ++ cxd2880@0 { ++ compatible = "sony,cxd2880"; ++ reg = <0>; /* CE0 */ ++ spi-max-frequency = <50000000>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++}; diff --git a/arch/arm/boot/dts/overlays/rra-digidac1-wm8741-audio-overlay.dts b/arch/arm/boot/dts/overlays/rra-digidac1-wm8741-audio-overlay.dts new file mode 100644 index 0000000000000000000000000000000000000000..f8d48233e28c7c18509b4a95692f6aff29ea33fd @@ -92096,10 +92394,10 @@ index 0000000000000000000000000000000000000000..d0a9e82dbea143e80249064873d8b9f0 +}; diff --git a/arch/arm/boot/dts/overlays/sdhost-overlay.dts b/arch/arm/boot/dts/overlays/sdhost-overlay.dts new file mode 100644 -index 0000000000000000000000000000000000000000..a431177a1c9d320d5432ea448ad4d0f696c34525 +index 0000000000000000000000000000000000000000..de3d1b0a5e403057a8e94f85695de4076d77e31f --- /dev/null +++ b/arch/arm/boot/dts/overlays/sdhost-overlay.dts -@@ -0,0 +1,32 @@ +@@ -0,0 +1,31 @@ +/dts-v1/; +/plugin/; + @@ -92113,7 +92411,6 @@ index 0000000000000000000000000000000000000000..a431177a1c9d320d5432ea448ad4d0f6 + frag0: __overlay__ { + brcm,overclock-50 = <0>; + brcm,pio-limit = <1>; -+ brcm,debug-flags = <0>; + status = "okay"; + }; + }; @@ -92134,18 +92431,19 @@ index 0000000000000000000000000000000000000000..a431177a1c9d320d5432ea448ad4d0f6 +}; diff --git a/arch/arm/boot/dts/overlays/sdio-1bit-overlay.dts b/arch/arm/boot/dts/overlays/sdio-1bit-overlay.dts new file mode 100644 -index 0000000000000000000000000000000000000000..46d453859b31f5c700a8a2e39a2c209330bc108f +index 0000000000000000000000000000000000000000..0b7f2c6f2603b631e1985df7fbf66749149566d6 --- /dev/null +++ b/arch/arm/boot/dts/overlays/sdio-1bit-overlay.dts -@@ -0,0 +1,36 @@ -+/* Enable 1-bit SDIO from MMC interface via GPIOs 22-25. Includes sdhost overlay. */ +@@ -0,0 +1,37 @@ ++/dts-v1/; ++/plugin/; + -+/include/ "sdhost-overlay.dts" ++/* Enable 1-bit SDIO from MMC interface via GPIOs 22-25. Includes sdhost overlay. */ + +/{ + compatible = "brcm,bcm2708"; + -+ fragment@3 { ++ fragment@0 { + target = <&mmc>; + sdio_mmc: __overlay__ { + compatible = "brcm,bcm2835-mmc"; @@ -92158,12 +92456,12 @@ index 0000000000000000000000000000000000000000..46d453859b31f5c700a8a2e39a2c2093 + }; + }; + -+ fragment@4 { ++ fragment@1 { + target = <&gpio>; + __overlay__ { + sdio_pins: sdio_pins { + brcm,pins = <22 23 24 25>; -+ brcm,function = <7 7 7 7>; /* ALT3 = SD1 */ ++ brcm,function = <7>; /* ALT3 = SD1 */ + brcm,pull = <0 2 2 2>; + }; + }; @@ -92176,18 +92474,19 @@ index 0000000000000000000000000000000000000000..46d453859b31f5c700a8a2e39a2c2093 +}; diff --git a/arch/arm/boot/dts/overlays/sdio-overlay.dts b/arch/arm/boot/dts/overlays/sdio-overlay.dts new file mode 100644 -index 0000000000000000000000000000000000000000..398bd812c716c9e472fbac5aba4fe882114c65d1 +index 0000000000000000000000000000000000000000..215d5e3e8a8ca4363457fed1f7425427bb5086d7 --- /dev/null +++ b/arch/arm/boot/dts/overlays/sdio-overlay.dts -@@ -0,0 +1,36 @@ -+/* Enable SDIO from MMC interface via GPIOs 22-27. Includes sdhost overlay. */ +@@ -0,0 +1,37 @@ ++/dts-v1/; ++/plugin/; + -+/include/ "sdhost-overlay.dts" ++/* Enable SDIO from MMC interface via GPIOs 22-27. Includes sdhost overlay. */ + +/{ + compatible = "brcm,bcm2708"; + -+ fragment@3 { ++ fragment@0 { + target = <&mmc>; + sdio_mmc: __overlay__ { + pinctrl-names = "default"; @@ -92199,12 +92498,12 @@ index 0000000000000000000000000000000000000000..398bd812c716c9e472fbac5aba4fe882 + }; + }; + -+ fragment@4 { ++ fragment@1 { + target = <&gpio>; + __overlay__ { + sdio_pins: sdio_pins { + brcm,pins = <22 23 24 25 26 27>; -+ brcm,function = <7 7 7 7 7 7>; /* ALT3 = SD1 */ ++ brcm,function = <7>; /* ALT3 = SD1 */ + brcm,pull = <0 2 2 2 2 2>; + }; + }; @@ -93351,7 +93650,7 @@ index 0000000000000000000000000000000000000000..95a595a35cb4fbb707bf4b18161f6a46 +}; diff --git a/arch/arm/boot/dts/overlays/vc4-kms-v3d-overlay.dts b/arch/arm/boot/dts/overlays/vc4-kms-v3d-overlay.dts new file mode 100644 -index 0000000000000000000000000000000000000000..fb45c6456b181b047d6cff8784f7696eb75da3c7 +index 0000000000000000000000000000000000000000..7d0d659b4886147e7e3b7eb3f60d546592cf2853 --- /dev/null +++ b/arch/arm/boot/dts/overlays/vc4-kms-v3d-overlay.dts @@ -0,0 +1,151 @@ @@ -93370,35 +93669,35 @@ index 0000000000000000000000000000000000000000..fb45c6456b181b047d6cff8784f7696e + fragment@0 { + target-path = "/chosen"; + __overlay__ { -+ bootargs = "cma=256M@256M"; ++ bootargs = "cma=256M"; + }; + }; + + fragment@1 { + target-path = "/chosen"; + __dormant__ { -+ bootargs = "cma=192M@256M"; ++ bootargs = "cma=192M"; + }; + }; + + fragment@2 { + target-path = "/chosen"; + __dormant__ { -+ bootargs = "cma=128M@128M"; ++ bootargs = "cma=128M"; + }; + }; + + fragment@3 { + target-path = "/chosen"; + __dormant__ { -+ bootargs = "cma=96M@128M"; ++ bootargs = "cma=96M"; + }; + }; + + fragment@4 { + target-path = "/chosen"; + __dormant__ { -+ bootargs = "cma=64M@64M"; ++ bootargs = "cma=64M"; + }; + }; + @@ -93544,10 +93843,10 @@ index 0000000000000000000000000000000000000000..7fcab963eb4aed4b9edea94c9e60deb7 +}; diff --git a/arch/arm/boot/dts/overlays/w1-gpio-overlay.dts b/arch/arm/boot/dts/overlays/w1-gpio-overlay.dts new file mode 100644 -index 0000000000000000000000000000000000000000..29a3b48d19ab36b814c09e4cc4eef6d9e2022da1 +index 0000000000000000000000000000000000000000..f7f8747512653465d01dd1c41a0fcbd2e3e5fbdb --- /dev/null +++ b/arch/arm/boot/dts/overlays/w1-gpio-overlay.dts -@@ -0,0 +1,39 @@ +@@ -0,0 +1,41 @@ +// Definitions for w1-gpio module (without external pullup) +/dts-v1/; +/plugin/; @@ -93573,7 +93872,7 @@ index 0000000000000000000000000000000000000000..29a3b48d19ab36b814c09e4cc4eef6d9 + fragment@1 { + target = <&gpio>; + __overlay__ { -+ w1_pins: w1_pins { ++ w1_pins: w1_pins@0 { + brcm,pins = <4>; + brcm,function = <0>; // in (initially) + brcm,pull = <0>; // off @@ -93583,16 +93882,18 @@ index 0000000000000000000000000000000000000000..29a3b48d19ab36b814c09e4cc4eef6d9 + + __overrides__ { + gpiopin = <&w1>,"gpios:4", -+ <&w1_pins>,"brcm,pins:0"; ++ <&w1>,"reg:0", ++ <&w1_pins>,"brcm,pins:0", ++ <&w1_pins>,"reg:0"; + pullup = <&w1>,"rpi,parasitic-power:0"; + }; +}; diff --git a/arch/arm/boot/dts/overlays/w1-gpio-pullup-overlay.dts b/arch/arm/boot/dts/overlays/w1-gpio-pullup-overlay.dts new file mode 100644 -index 0000000000000000000000000000000000000000..66a98f6c9601f51483f27803995bec772bb3350e +index 0000000000000000000000000000000000000000..ef8bfbcabdb31231075d5c281df3b38b1b857c7c --- /dev/null +++ b/arch/arm/boot/dts/overlays/w1-gpio-pullup-overlay.dts -@@ -0,0 +1,41 @@ +@@ -0,0 +1,43 @@ +// Definitions for w1-gpio module (with external pullup) +/dts-v1/; +/plugin/; @@ -93618,7 +93919,7 @@ index 0000000000000000000000000000000000000000..66a98f6c9601f51483f27803995bec77 + fragment@1 { + target = <&gpio>; + __overlay__ { -+ w1_pins: w1_pins { ++ w1_pins: w1_pins@0 { + brcm,pins = <4 5>; + brcm,function = <0 1>; // in out + brcm,pull = <0 0>; // off off @@ -93628,7 +93929,9 @@ index 0000000000000000000000000000000000000000..66a98f6c9601f51483f27803995bec77 + + __overrides__ { + gpiopin = <&w1>,"gpios:4", -+ <&w1_pins>,"brcm,pins:0"; ++ <&w1>,"reg:0", ++ <&w1_pins>,"brcm,pins:0", ++ <&w1_pins>,"reg:0"; + extpullup = <&w1>,"gpios:16", + <&w1_pins>,"brcm,pins:4"; + pullup = <&w1>,"rpi,parasitic-power:0"; @@ -93685,24 +93988,18 @@ index 0000000000000000000000000000000000000000..8498134fdbb3912e9ce18282b53084d8 + +}; diff --git a/scripts/Makefile.dtbinst b/scripts/Makefile.dtbinst -index a1be75d0a5fd3fbf4742e555046896ea6fa6fe65..ad8dc1c93d04bc929b551c5a47f67d244116c7e7 100644 +index 34614a48b717eafa2c15f418e6e6769905e32ec1..85dd4074474db8598d78d0c94a3fa9b26ccdd9e7 100644 --- a/scripts/Makefile.dtbinst +++ b/scripts/Makefile.dtbinst -@@ -27,6 +27,7 @@ ifeq ("$(dtbinst-root)", "$(obj)") - endif +@@ -21,6 +21,7 @@ include scripts/Kbuild.include + include $(src)/Makefile dtbinst-files := $(dtb-y) +dtboinst-files := $(dtbo-y) dtbinst-dirs := $(dts-dirs) # Helper targets for Installing DTBs into the boot directory -@@ -35,15 +36,18 @@ quiet_cmd_dtb_install = INSTALL $< - - install-dir = $(patsubst $(dtbinst-root)%,$(INSTALL_DTBS_PATH)%,$(obj)) - --$(dtbinst-files) $(dtbinst-dirs): | __dtbs_install_prep -+$(dtbinst-files) $(dtboinst-files) $(dtbinst-dirs): | __dtbs_install_prep - +@@ -32,10 +33,13 @@ install-dir = $(patsubst $(dtbinst-root)%,$(INSTALL_DTBS_PATH)%,$(obj)) $(dtbinst-files): %.dtb: $(obj)/%.dtb $(call cmd,dtb_install,$(install-dir)) @@ -93719,10 +94016,10 @@ index a1be75d0a5fd3fbf4742e555046896ea6fa6fe65..ad8dc1c93d04bc929b551c5a47f67d24 .PHONY: $(PHONY) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib -index 7234e61e7ce370a775ec6981b391b6d102a01770..1b53cd59e4875d388e4974a3399d5f07df880280 100644 +index 58c05e5d9870b6c18a72da7dc44ff3112994946d..9842523b225a88505d796cc689c04f40359eaf3d 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib -@@ -312,6 +312,17 @@ cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \ +@@ -324,6 +324,17 @@ cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \ $(obj)/%.dtb: $(src)/%.dts FORCE $(call if_changed_dep,dtc) @@ -93741,10 +94038,10 @@ index 7234e61e7ce370a775ec6981b391b6d102a01770..1b53cd59e4875d388e4974a3399d5f07 # Bzip2 -From 5a968c695382ce3b2318826b0242d4411d0df038 Mon Sep 17 00:00:00 2001 +From 9b16807890be501e8b292dc1f91ed23ecb3b019e Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 6 Feb 2015 13:50:57 +0000 -Subject: [PATCH 057/201] BCM270x_DT: Add pwr_led, and the required "input" +Subject: [PATCH 057/134] BCM270x_DT: Add pwr_led, and the required "input" trigger The "input" trigger makes the associated GPIO an input. This is to support @@ -93765,16 +94062,16 @@ recently. See: https://github.com/raspberrypi/linux/issues/1064 --- - drivers/leds/leds-gpio.c | 18 +++++++++++- + drivers/leds/leds-gpio.c | 17 +++++++++++- drivers/leds/trigger/Kconfig | 7 +++++ drivers/leds/trigger/Makefile | 1 + drivers/leds/trigger/ledtrig-input.c | 54 ++++++++++++++++++++++++++++++++++++ include/linux/leds.h | 3 ++ - 5 files changed, 82 insertions(+), 1 deletion(-) + 5 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 drivers/leds/trigger/ledtrig-input.c diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c -index 066fc75907299cc4ecd83bdf83f155c52e87cfb0..934cdb1d7bc7f12a4fb06a5c458ad76727c7b7c7 100644 +index e753ba93ba1e544986f1774d9c33c45aab23a996..809a63b02443b25113f5f134150972d280c49bc5 100644 --- a/drivers/leds/leds-gpio.c +++ b/drivers/leds/leds-gpio.c @@ -50,8 +50,15 @@ static void gpio_led_set(struct led_classdev *led_cdev, @@ -93808,11 +94105,10 @@ index 066fc75907299cc4ecd83bdf83f155c52e87cfb0..934cdb1d7bc7f12a4fb06a5c458ad767 static int gpio_blink_set(struct led_classdev *led_cdev, unsigned long *delay_on, unsigned long *delay_off) { -@@ -122,6 +136,8 @@ static int create_gpio_led(const struct gpio_led *template, +@@ -122,6 +136,7 @@ static int create_gpio_led(const struct gpio_led *template, led_dat->platform_gpio_blink_set = blink_set; led_dat->cdev.blink_set = gpio_blink_set; } -+ led_dat->cdev.brightness_set = gpio_led_set; + led_dat->cdev.brightness_get = gpio_led_get; if (template->default_state == LEDS_GPIO_DEFSTATE_KEEP) { state = gpiod_get_value_cansleep(led_dat->gpiod); @@ -93906,7 +94202,7 @@ index 0000000000000000000000000000000000000000..27f8ebea43d86fc51c98db5c953da05b +MODULE_DESCRIPTION("Set LED GPIO to Input \"trigger\""); +MODULE_LICENSE("GPL"); diff --git a/include/linux/leds.h b/include/linux/leds.h -index 38c0bd7ca1074af234d516275791d05f945ce1f0..2f026646d24bad617c73aa79db30c9aa1f2b0424 100644 +index 64c56d454f7df9f864a5242ce4212df586f66886..3fd74c8737871cb56f0355c858fc135e1188c1f8 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h @@ -49,6 +49,9 @@ struct led_classdev { @@ -93920,10 +94216,10 @@ index 38c0bd7ca1074af234d516275791d05f945ce1f0..2f026646d24bad617c73aa79db30c9aa /* set_brightness_work / blink_timer flags, atomic, private. */ unsigned long work_flags; -From a7003a3e68b959a72a405f147c8b95290c8686c8 Mon Sep 17 00:00:00 2001 +From e673adf32af6d1024f72f179daff0cba7ae0299d Mon Sep 17 00:00:00 2001 From: Siarhei Siamashka Date: Mon, 17 Jun 2013 13:32:11 +0300 -Subject: [PATCH 058/201] fbdev: add FBIOCOPYAREA ioctl +Subject: [PATCH 058/134] fbdev: add FBIOCOPYAREA ioctl Based on the patch authored by Ali Gholami Rudi at https://lkml.org/lkml/2009/7/13/153 @@ -93935,27 +94231,35 @@ Signed-off-by: Siarhei Siamashka bcm2708_fb: Add ioctl for reading gpu memory through dma --- - drivers/video/fbdev/bcm2708_fb.c | 109 +++++++++++++++++++++++++++++++++++++++ + drivers/video/fbdev/bcm2708_fb.c | 111 +++++++++++++++++++++++++++++++++++++++ drivers/video/fbdev/core/fbmem.c | 36 +++++++++++++ include/uapi/linux/fb.h | 12 +++++ - 3 files changed, 157 insertions(+) + 3 files changed, 159 insertions(+) diff --git a/drivers/video/fbdev/bcm2708_fb.c b/drivers/video/fbdev/bcm2708_fb.c -index 37f60813fe1dd95d9f5f725c07ec2e75c09857bf..53c5a0bdadb4be9251affdabed66305842a08e72 100644 +index 37f60813fe1dd95d9f5f725c07ec2e75c09857bf..a048c964b11508042ffc582f452f2a4c43d0770f 100644 --- a/drivers/video/fbdev/bcm2708_fb.c +++ b/drivers/video/fbdev/bcm2708_fb.c @@ -31,8 +31,10 @@ #include #include #include -+#include ++#include #include #include +#include #include //#define BCM2708_FB_DEBUG -@@ -426,6 +428,110 @@ static int bcm2708_fb_pan_display(struct fb_var_screeninfo *var, struct fb_info +@@ -94,6 +96,7 @@ struct bcm2708_fb { + wait_queue_head_t dma_waitq; + struct bcm2708_fb_stats stats; + unsigned long fb_bus_address; ++ struct { u32 base, length; } gpu; + }; + + #define to_bcm2708(info) container_of(info, struct bcm2708_fb, fb) +@@ -426,6 +429,106 @@ static int bcm2708_fb_pan_display(struct fb_var_screeninfo *var, struct fb_info return result; } @@ -94003,7 +94307,6 @@ index 37f60813fe1dd95d9f5f725c07ec2e75c09857bf..53c5a0bdadb4be9251affdabed663058 + dma_addr_t bus_addr; + long rc = 0; + size_t offset; -+ struct { u32 base, length; } gpu = {}; + + /* restrict this to root user */ + if (!uid_eq(current_euid(), GLOBAL_ROOT_UID)) @@ -94022,16 +94325,13 @@ index 37f60813fe1dd95d9f5f725c07ec2e75c09857bf..53c5a0bdadb4be9251affdabed663058 + goto out; + } + -+ rc = rpi_firmware_property(fb->fw, -+ RPI_FIRMWARE_GET_VC_MEMORY, -+ &gpu, sizeof(gpu)); -+ if (rc != 0 || gpu.base == 0 || gpu.length == 0) { -+ pr_err("[%s]: Unable to determine gpu memory %ld,%x,%x)\n", __func__, rc, gpu.base, gpu.length); ++ if (fb->gpu.base == 0 || fb->gpu.length == 0) { ++ pr_err("[%s]: Unable to determine gpu memory (%x,%x)\n", __func__, fb->gpu.base, fb->gpu.length); + return -EFAULT; + } + -+ if (INTALIAS_NORMAL(ioparam.src) < gpu.base || INTALIAS_NORMAL(ioparam.src) >= gpu.base + gpu.length) { -+ pr_err("[%s]: Invalid memory access %x (%x-%x)", __func__, INTALIAS_NORMAL(ioparam.src), gpu.base, gpu.base + gpu.length); ++ if (INTALIAS_NORMAL(ioparam.src) < fb->gpu.base || INTALIAS_NORMAL(ioparam.src) >= fb->gpu.base + fb->gpu.length) { ++ pr_err("[%s]: Invalid memory access %x (%x-%x)", __func__, INTALIAS_NORMAL(ioparam.src), fb->gpu.base, fb->gpu.base + fb->gpu.length); + return -EFAULT; + } + @@ -94066,7 +94366,7 @@ index 37f60813fe1dd95d9f5f725c07ec2e75c09857bf..53c5a0bdadb4be9251affdabed663058 static int bcm2708_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) { struct bcm2708_fb *fb = to_bcm2708(info); -@@ -438,6 +544,9 @@ static int bcm2708_ioctl(struct fb_info *info, unsigned int cmd, unsigned long a +@@ -438,6 +541,9 @@ static int bcm2708_ioctl(struct fb_info *info, unsigned int cmd, unsigned long a RPI_FIRMWARE_FRAMEBUFFER_SET_VSYNC, &dummy, sizeof(dummy)); break; @@ -94076,6 +94376,18 @@ index 37f60813fe1dd95d9f5f725c07ec2e75c09857bf..53c5a0bdadb4be9251affdabed663058 default: dev_dbg(info->device, "Unknown ioctl 0x%x\n", cmd); return -ENOTTY; +@@ -760,6 +866,11 @@ static int bcm2708_fb_probe(struct platform_device *dev) + fb->dev = dev; + fb->fb.device = &dev->dev; + ++ // failure here isn't fatal, but we'll fail in vc_mem_copy if fb->gpu is not valid ++ rpi_firmware_property(fb->fw, ++ RPI_FIRMWARE_GET_VC_MEMORY, ++ &fb->gpu, sizeof(fb->gpu)); ++ + ret = bcm2708_fb_register(fb); + if (ret == 0) { + platform_set_drvdata(dev, fb); diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index 069fe7960df1cedd17c3f7119d2ab6a6989e46c1..2577fca6a93954a499d8b2f94e6a70967874ded2 100644 --- a/drivers/video/fbdev/core/fbmem.c @@ -94175,10 +94487,10 @@ index fb795c3b3c178ad3cd7c9e9e4547ffd492bac181..703fa8a70574323abe2fb32599254582 __u32 dx; /* screen-relative */ __u32 dy; -From 033c85ebdb4897516854768d6ed806194afab0b3 Mon Sep 17 00:00:00 2001 +From d67b3ca2c17e8a84328d0f528431ca6cecfe8832 Mon Sep 17 00:00:00 2001 From: Harm Hanemaaijer Date: Thu, 20 Jun 2013 20:21:39 +0200 -Subject: [PATCH 059/201] Speed up console framebuffer imageblit function +Subject: [PATCH 059/134] 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 @@ -94387,10 +94699,10 @@ index a2bb276a8b2463eee98eb237c4647bc00cd93601..436494fba15abecb400ef28688466faf start_index, pitch_index); } else -From 7f689f58d33dccc2ffba1818048ed0071f93523e Mon Sep 17 00:00:00 2001 +From 7e23eb9405f97370323fe4067ee84ce7b2a6fbe8 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Wed, 8 May 2013 11:46:50 +0100 -Subject: [PATCH 060/201] enabling the realtime clock 1-wire chip DS1307 and +Subject: [PATCH 060/134] 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 @@ -94573,10 +94885,10 @@ index 758a7a6322e983d527c1f26e4262a5f853b877bc..a36f5becf27b8b07b22a0ab28d1edb9b u8, w1_slave_found_callback); }; diff --git a/drivers/w1/w1_int.c b/drivers/w1/w1_int.c -index 2cae7b29bb5fb5b72803b9d82d65d636b130bacc..ad0779966ab207972e64be4b2d8eaf17204870f5 100644 +index 1072a2e620bb16f7546c4c0d89da27b998a3fed3..09bddeca75e6a3b88ea22fb1b5db0db1e506285f 100644 --- a/drivers/w1/w1_int.c +++ b/drivers/w1/w1_int.c -@@ -116,6 +116,20 @@ int w1_add_master_device(struct w1_bus_master *master) +@@ -115,6 +115,20 @@ int w1_add_master_device(struct w1_bus_master *master) return(-EINVAL); } @@ -94598,10 +94910,10 @@ index 2cae7b29bb5fb5b72803b9d82d65d636b130bacc..ad0779966ab207972e64be4b2d8eaf17 mutex_lock(&w1_mlock); /* Search for the first available id (starting at 1). */ diff --git a/drivers/w1/w1_io.c b/drivers/w1/w1_io.c -index de8bebc278967552222d025dc143054af040a8af..ffb8184a33f6b4e932379aae19db8952b6d7c488 100644 +index 1134e6b1eb023b26ea2f978c046d7796be5f69f6..1d2344f3000e8654f3a1ecd800b7e10ff12ad054 100644 --- a/drivers/w1/w1_io.c +++ b/drivers/w1/w1_io.c -@@ -127,10 +127,22 @@ static void w1_pre_write(struct w1_master *dev) +@@ -126,10 +126,22 @@ static void w1_pre_write(struct w1_master *dev) static void w1_post_write(struct w1_master *dev) { if (dev->pullup_duration) { @@ -94640,18 +94952,18 @@ index d58594a3232492e33f1dd4babd3798b03e0f0203..feae94256256316fd9d850c3d83325af unsigned int ext_pullup_enable_pin; unsigned int pullup_duration; -From 11f2494ef87047e45aa5f73d6f9690fca455db31 Mon Sep 17 00:00:00 2001 +From 0ea6eedffcfc2ce99a3ea3607c55f46273537425 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 14 Jul 2014 22:02:09 +0100 -Subject: [PATCH 061/201] hid: Reduce default mouse polling interval to 60Hz +Subject: [PATCH 061/134] hid: Reduce default mouse polling interval to 60Hz Reduces overhead when using X --- - drivers/hid/usbhid/hid-core.c | 10 +++++++--- - 1 file changed, 7 insertions(+), 3 deletions(-) + drivers/hid/usbhid/hid-core.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c -index 961bc6fdd2d908835fa9a07d169a4746fb44189d..c595188a1156a27aa79f111d81636b6d134ed6b2 100644 +index 83772fa7d92a6f6178cd3a4a5c0fea28350040b5..3f4a7e34b3f775e712b1b4d6afe27a2ac8838e16 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c @@ -48,7 +48,7 @@ @@ -94663,26 +94975,22 @@ index 961bc6fdd2d908835fa9a07d169a4746fb44189d..c595188a1156a27aa79f111d81636b6d module_param_named(mousepoll, hid_mousepoll_interval, uint, 0644); MODULE_PARM_DESC(mousepoll, "Polling interval of mice"); -@@ -1082,8 +1082,12 @@ static int usbhid_start(struct hid_device *hid) - } - - /* Change the polling interval of mice. */ -- if (hid->collection->usage == HID_GD_MOUSE && hid_mousepoll_interval > 0) -- interval = hid_mousepoll_interval; -+ if (hid->collection->usage == HID_GD_MOUSE) { -+ if (hid_mousepoll_interval == ~0 && interval < 16) -+ interval = 16; -+ else if (hid_mousepoll_interval != ~0 && hid_mousepoll_interval != 0) -+ interval = hid_mousepoll_interval; -+ } - - ret = -ENOMEM; - if (usb_endpoint_dir_in(endpoint)) { +@@ -1085,7 +1085,9 @@ 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) ++ if (hid_mousepoll_interval == ~0 && interval < 16) ++ interval = 16; ++ else if (hid_mousepoll_interval != ~0 && hid_mousepoll_interval != 0) + interval = hid_mousepoll_interval; + break; + case HID_GD_JOYSTICK: -From 1be0a07d0d274ab14480700363471e075617e63d Mon Sep 17 00:00:00 2001 +From 339f5fb3cfa5c0f02a83928ee8a882ba2a55072a Mon Sep 17 00:00:00 2001 From: Gordon Hollingworth Date: Tue, 12 May 2015 14:47:56 +0100 -Subject: [PATCH 062/201] rpi-ft5406: Add touchscreen driver for pi LCD display +Subject: [PATCH 062/134] 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 @@ -94700,10 +95008,10 @@ Signed-off-by: Gerhard de Clercq create mode 100644 drivers/input/touchscreen/rpi-ft5406.c diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig -index 03359977765156edb0f8d00c04d51e8921358ef9..60504f240239901a50dc024ec46f7cdba8bebc79 100644 +index cf26ca49ae6d623d44d68e654c20082e7cf09d9e..4bb0404d48a40653f79d077c9167a1743fd730b1 100644 --- a/drivers/input/touchscreen/Kconfig +++ b/drivers/input/touchscreen/Kconfig -@@ -626,6 +626,13 @@ config TOUCHSCREEN_EDT_FT5X06 +@@ -628,6 +628,13 @@ config TOUCHSCREEN_EDT_FT5X06 To compile this driver as a module, choose M here: the module will be called edt-ft5x06. @@ -94718,7 +95026,7 @@ index 03359977765156edb0f8d00c04d51e8921358ef9..60504f240239901a50dc024ec46f7cdb tristate "Renesas MIGO-R touchscreen" depends on (SH_MIGOR || COMPILE_TEST) && I2C diff --git a/drivers/input/touchscreen/Makefile b/drivers/input/touchscreen/Makefile -index b622e53441376a7261fe42b1f82598b0aeb3126a..09db22757c88f89619929cc01e79e46c9a577550 100644 +index 18e476948e44e4a44b16acb9e96887ee4a88b606..423ecb4f7728b84c68f79df4a6c4f7618bf5cee7 100644 --- a/drivers/input/touchscreen/Makefile +++ b/drivers/input/touchscreen/Makefile @@ -29,6 +29,7 @@ obj-$(CONFIG_TOUCHSCREEN_DA9034) += da9034-ts.o @@ -95040,10 +95348,10 @@ index 30fb37fe175df604a738258a2a632bca3bfff33f..4a3d79d3b48eb483a4e4bf498f617515 RPI_FIRMWARE_FRAMEBUFFER_SET_BACKLIGHT = 0x0004800f, -From 1480c65d4756c9f0f0ece7995e292f5cfb9dab06 Mon Sep 17 00:00:00 2001 +From c4b4250fd395c0be4b711507fb9eabd921b44b67 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 28 Nov 2016 16:50:04 +0000 -Subject: [PATCH 063/201] Improve __copy_to_user and __copy_from_user +Subject: [PATCH 063/134] Improve __copy_to_user and __copy_from_user performance Provide a __copy_from_user that uses memcpy. On BCM2708, use @@ -95101,10 +95409,10 @@ index cf4f3aad0fc1c2154c6cf3839ff21bb1c46d6499..d69b70a6007dfc647ad164d1ee90d253 #define memset(p,v,n) \ diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h -index b7e0125c0bbf2014a447800a383426b62d5147b8..d135f5af80c255865106561a85998bd9511ba346 100644 +index 2577405d082dab01004f13adee7a91398942d399..11d8f8d9512f4e111f37207597066dbf41dc5b1a 100644 --- a/arch/arm/include/asm/uaccess.h +++ b/arch/arm/include/asm/uaccess.h -@@ -477,6 +477,9 @@ do { \ +@@ -454,6 +454,9 @@ do { \ extern unsigned long __must_check arm_copy_from_user(void *to, const void __user *from, unsigned long n); @@ -95112,7 +95420,7 @@ index b7e0125c0bbf2014a447800a383426b62d5147b8..d135f5af80c255865106561a85998bd9 +__copy_from_user_std(void *to, const void __user *from, unsigned long n); + static inline unsigned long __must_check - __arch_copy_from_user(void *to, const void __user *from, unsigned long n) + raw_copy_from_user(void *to, const void __user *from, unsigned long n) { diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile index 27f4d96258a2e66193d6a3701bb4cf9a44399aad..96b390c9301f816d5c83c6ddb76ac74ba7a3b99d 100644 @@ -96441,7 +96749,7 @@ index 0000000000000000000000000000000000000000..70674158d76cd38d8d70c987aa54a6b4 +ENDPROC(memset) +ENDPROC(mmioset) diff --git a/arch/arm/lib/uaccess_with_memcpy.c b/arch/arm/lib/uaccess_with_memcpy.c -index 6bd1089b07e0960830ed6bd6a8345202b7efd8b0..cd17dd11ebe7bbe00089e70cd2ccea74e0400200 100644 +index 9b4ed172861615fa94f628fb3eea067176ef3bae..9dc1b8517dff3e6b8e5aa090ad957fd3a0a8da43 100644 --- a/arch/arm/lib/uaccess_with_memcpy.c +++ b/arch/arm/lib/uaccess_with_memcpy.c @@ -22,6 +22,14 @@ @@ -96600,7 +96908,7 @@ index 6bd1089b07e0960830ed6bd6a8345202b7efd8b0..cd17dd11ebe7bbe00089e70cd2ccea74 static unsigned long noinline __clear_user_memset(void __user *addr, unsigned long n) diff --git a/arch/arm/mach-bcm/Kconfig b/arch/arm/mach-bcm/Kconfig -index 333dc3c2e5ffbb2c5ab8fcfb6115b6162643cf20..46b787a6474ffa857da9b663948863ecfb46e862 100644 +index 567601148318bf4a5fbc581d6c9881d9e190c409..45ea7866761a71470bd335f6f37ea603f550f968 100644 --- a/arch/arm/mach-bcm/Kconfig +++ b/arch/arm/mach-bcm/Kconfig @@ -174,6 +174,13 @@ config ARCH_BCM_53573 @@ -96618,10 +96926,10 @@ index 333dc3c2e5ffbb2c5ab8fcfb6115b6162643cf20..46b787a6474ffa857da9b663948863ec bool "Broadcom BCM63xx DSL SoC" depends on ARCH_MULTI_V7 -From 60a75e53065cec7187804cb339162a79e64b0898 Mon Sep 17 00:00:00 2001 +From 11c1df4f712118eda289c584c7fa220a64a30ef5 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 25 Jun 2015 12:16:11 +0100 -Subject: [PATCH 064/201] gpio-poweroff: Allow it to work on Raspberry Pi +Subject: [PATCH 064/134] 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 @@ -96656,10 +96964,10 @@ index be3d81ff51cc3f510d85e4eed7a52960e51e7bc1..a030ae9fb1fca325061c093696e82186 "%s: pm_power_off function already registered", __func__); -From dc8e3487d5e041f4ec02c4ac9dda67556dbca5fe Mon Sep 17 00:00:00 2001 +From 7a82effd690ec3312c60297da20a0bf2da2b0f1e Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 14 Jul 2015 14:32:47 +0100 -Subject: [PATCH 065/201] mfd: Add Raspberry Pi Sense HAT core driver +Subject: [PATCH 065/134] mfd: Add Raspberry Pi Sense HAT core driver --- drivers/input/joystick/Kconfig | 8 + @@ -96683,12 +96991,12 @@ Subject: [PATCH 065/201] mfd: Add Raspberry Pi Sense HAT core driver create mode 100644 include/linux/mfd/rpisense/joystick.h diff --git a/drivers/input/joystick/Kconfig b/drivers/input/joystick/Kconfig -index 4215b5382092c15d693e62de6e029626e9fa551d..4364d7c85543b4537c839df95cf5b524948a06c2 100644 +index f3c2f6ea8b447395fd4fc241735a0b4d8f4a6bd1..c6a85b012bd87a8c28d888838babc58c0169401b 100644 --- a/drivers/input/joystick/Kconfig +++ b/drivers/input/joystick/Kconfig -@@ -330,4 +330,12 @@ config JOYSTICK_MAPLE - To compile this as a module choose M here: the module will be called - maplecontrol. +@@ -351,4 +351,12 @@ config JOYSTICK_PSXPAD_SPI_FF + + To drive rumble motor a dedicated power supply is required. +config JOYSTICK_RPISENSE + tristate "Raspberry Pi Sense HAT joystick" @@ -96700,10 +97008,10 @@ index 4215b5382092c15d693e62de6e029626e9fa551d..4364d7c85543b4537c839df95cf5b524 + endif diff --git a/drivers/input/joystick/Makefile b/drivers/input/joystick/Makefile -index 92dc0de9dfeda43171a901f96c40bebe0e7a5ae2..1758160374938dd150b8a380797b6decc00a64aa 100644 +index 496fd56b3f1bccee496b363fd214c5451a594ced..47ee4495a7df5a32b340ce9861cfb94679f9ef2d 100644 --- a/drivers/input/joystick/Makefile +++ b/drivers/input/joystick/Makefile -@@ -32,4 +32,5 @@ obj-$(CONFIG_JOYSTICK_WARRIOR) += warrior.o +@@ -33,4 +33,5 @@ obj-$(CONFIG_JOYSTICK_WARRIOR) += warrior.o obj-$(CONFIG_JOYSTICK_XPAD) += xpad.o obj-$(CONFIG_JOYSTICK_ZHENHUA) += zhenhua.o obj-$(CONFIG_JOYSTICK_WALKERA0701) += walkera0701.o @@ -96869,7 +97177,7 @@ index 0000000000000000000000000000000000000000..6a416769065d2198344792eb02d8e38d +MODULE_AUTHOR("Serge Schneider "); +MODULE_LICENSE("GPL"); diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig -index 55ecdfb74d317a3a5a7943a7d93a1cf37dd1fecb..6279545f979ca5e1461f24b21b49482db2c92583 100644 +index 3eb5c93595f66f0311b73faf65b9c4716044ecff..eca3a195213ec8d99328f7ee6bc1aad14fc0aab0 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -10,6 +10,14 @@ config MFD_CORE @@ -96888,13 +97196,13 @@ index 55ecdfb74d317a3a5a7943a7d93a1cf37dd1fecb..6279545f979ca5e1461f24b21b49482d tristate "AMD CS5535 and CS5536 southbridge core functions" select MFD_CORE diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile -index 31ce07611a6fcbc9854a642587a559ee5d591059..2fae93a57832d636166d689f9a1de444648600f2 100644 +index c16bf1ea0ea9b0a4432539b228a4a48744ac0599..c1b557ca3899ab18cdcd39218d8ec2a7298730d2 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile -@@ -215,3 +215,4 @@ obj-$(CONFIG_MFD_ALTERA_A10SR) += altera-a10sr.o - obj-$(CONFIG_MFD_SUN4I_GPADC) += sun4i-gpadc.o +@@ -221,3 +221,4 @@ obj-$(CONFIG_MFD_SUN4I_GPADC) += sun4i-gpadc.o obj-$(CONFIG_MFD_STM32_TIMERS) += stm32-timers.o + obj-$(CONFIG_MFD_MXS_LRADC) += mxs-lradc.o +obj-$(CONFIG_MFD_RPISENSE_CORE) += rpisense-core.o diff --git a/drivers/mfd/rpisense-core.c b/drivers/mfd/rpisense-core.c new file mode 100644 @@ -97060,10 +97368,10 @@ index 0000000000000000000000000000000000000000..eea9312dc96a496ce846b0c5a83e6e4f +MODULE_LICENSE("GPL"); + diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig -index 2fae1676fafc16900d56622e3eef887e27b01eed..b49ef60bb304f3379a29eb8268ebc3a32829d557 100644 +index 7b44601d1c58007cdb3adafdf5f3c33a0801b8c6..98f8998239199f01374f93260aeafa51c85bbb86 100644 --- a/drivers/video/fbdev/Kconfig +++ b/drivers/video/fbdev/Kconfig -@@ -2512,3 +2512,16 @@ config FB_SM712 +@@ -2510,3 +2510,16 @@ config FB_SM712 This driver is also available as a module. The module will be called sm712fb. If you want to compile it as a module, say M here and read . @@ -97524,10 +97832,10 @@ index 0000000000000000000000000000000000000000..56196dc2af10e464a1e3f98b028dca1c + +#endif -From 7992ee8ed254d66c6e8c2d90aeec686209a328ad Mon Sep 17 00:00:00 2001 +From 644a0e25034a704720de0a6ee5b12572c3c63147 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Fri, 22 Nov 2013 19:19:08 +0100 -Subject: [PATCH 066/201] ASoC: Add support for HifiBerry DAC +Subject: [PATCH 066/134] ASoC: Add support for HifiBerry DAC This adds a machine driver for the HifiBerry DAC. It is a sound card that can @@ -97702,10 +98010,10 @@ index 0000000000000000000000000000000000000000..ee9f133953544629282631e5ef3f73fe +MODULE_DESCRIPTION("ASoC Driver for HifiBerry DAC"); +MODULE_LICENSE("GPL v2"); -From 6c879096c30938ab05174f2f1f524a6eaafdcf88 Mon Sep 17 00:00:00 2001 +From 18db604c90230ab4386547d077cb219d661568b1 Mon Sep 17 00:00:00 2001 From: Florian Meier Date: Mon, 25 Jan 2016 15:48:59 +0000 -Subject: [PATCH 067/201] ASoC: Add support for Rpi-DAC +Subject: [PATCH 067/134] ASoC: Add support for Rpi-DAC --- sound/soc/bcm/Kconfig | 7 +++ @@ -97871,10 +98179,10 @@ index 0000000000000000000000000000000000000000..38224467cbab7d5be3be731e73e2cf78 +MODULE_DESCRIPTION("ASoC Driver for RPi-DAC"); +MODULE_LICENSE("GPL v2"); diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig -index e49e9da7f1f6e41028a0ca832e76e7dce0bc1c01..17b431dc7ea27b1938a1cfe8949e450933ba83e7 100644 +index 883ed4c8a5510fb9090ad1889976003960781d89..fefde2905c505d8cc1049981591234bfef94aae3 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig -@@ -102,6 +102,7 @@ config SND_SOC_ALL_CODECS +@@ -107,6 +107,7 @@ config SND_SOC_ALL_CODECS select SND_SOC_PCM1681 if I2C select SND_SOC_PCM179X_I2C if I2C select SND_SOC_PCM179X_SPI if SPI_MASTER @@ -97882,7 +98190,7 @@ index e49e9da7f1f6e41028a0ca832e76e7dce0bc1c01..17b431dc7ea27b1938a1cfe8949e4509 select SND_SOC_PCM3008 select SND_SOC_PCM3168A_I2C if I2C select SND_SOC_PCM3168A_SPI if SPI_MASTER -@@ -712,6 +713,10 @@ config SND_SOC_RT5616 +@@ -734,6 +735,10 @@ config SND_SOC_RT5616 tristate "Realtek RT5616 CODEC" depends on I2C @@ -97894,10 +98202,10 @@ index e49e9da7f1f6e41028a0ca832e76e7dce0bc1c01..17b431dc7ea27b1938a1cfe8949e4509 tristate "Realtek ALC5631/RT5631 CODEC" depends on I2C diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile -index 1796cb987e712c78b0fe8f3aa8ec71177256b5b2..4dd919b509d11511807a3c3307ca9b472309c810 100644 +index 28a63fdaf982fdf6b15afcdc56fd11f89698c250..a0426bc4f2af97c8aa95fa6f1347c3d6f824a9ee 100644 --- a/sound/soc/codecs/Makefile +++ b/sound/soc/codecs/Makefile -@@ -98,6 +98,7 @@ snd-soc-pcm1681-objs := pcm1681.o +@@ -102,6 +102,7 @@ snd-soc-pcm1681-objs := pcm1681.o snd-soc-pcm179x-codec-objs := pcm179x.o snd-soc-pcm179x-i2c-objs := pcm179x-i2c.o snd-soc-pcm179x-spi-objs := pcm179x-spi.o @@ -97905,7 +98213,7 @@ index 1796cb987e712c78b0fe8f3aa8ec71177256b5b2..4dd919b509d11511807a3c3307ca9b47 snd-soc-pcm3008-objs := pcm3008.o snd-soc-pcm3168a-objs := pcm3168a.o snd-soc-pcm3168a-i2c-objs := pcm3168a-i2c.o -@@ -335,6 +336,7 @@ obj-$(CONFIG_SND_SOC_PCM5102A) += snd-soc-pcm5102a.o +@@ -344,6 +345,7 @@ obj-$(CONFIG_SND_SOC_PCM5102A) += snd-soc-pcm5102a.o obj-$(CONFIG_SND_SOC_PCM512x) += snd-soc-pcm512x.o obj-$(CONFIG_SND_SOC_PCM512x_I2C) += snd-soc-pcm512x-i2c.o obj-$(CONFIG_SND_SOC_PCM512x_SPI) += snd-soc-pcm512x-spi.o @@ -97989,10 +98297,10 @@ index 0000000000000000000000000000000000000000..afe1b419582aa40c4b2729d242bb13cd +MODULE_AUTHOR("Florian Meier "); +MODULE_LICENSE("GPL v2"); -From 7313c3689f01f677a51119b1fc3c89cab351cd4a Mon Sep 17 00:00:00 2001 +From c598b93c8d732538708591e682d33ec46fc42ff8 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Wed, 15 Jan 2014 21:41:23 +0100 -Subject: [PATCH 068/201] ASoC: wm8804: Implement MCLK configuration options, +Subject: [PATCH 068/134] 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 @@ -98041,10 +98349,10 @@ index af95d648265b3e92e345101542b332aee35191d4..513f56ba132929662802d15cdc653af3 .component_driver = { .dapm_widgets = wm8804_dapm_widgets, -From 569793bae8a72238d9e62cbf4601f26f82a890f4 Mon Sep 17 00:00:00 2001 +From e84c80f2e668fe752aac76c478ccef648cc9eab6 Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Wed, 15 Jan 2014 21:42:08 +0100 -Subject: [PATCH 069/201] ASoC: BCM:Add support for HiFiBerry Digi. Driver is +Subject: [PATCH 069/134] ASoC: BCM:Add support for HiFiBerry Digi. Driver is based on the patched WM8804 driver. Signed-off-by: Daniel Matuschek @@ -98388,10 +98696,10 @@ index 0000000000000000000000000000000000000000..7620dd02de40b6d644ff038b445d375d +MODULE_DESCRIPTION("ASoC Driver for HifiBerry Digi"); +MODULE_LICENSE("GPL v2"); -From 586f1ef0b2eab26bda83dde2f8d75fc2c82b55da Mon Sep 17 00:00:00 2001 +From d193f3f66930b94a717d209ee0a4e7a9edbcbd77 Mon Sep 17 00:00:00 2001 From: Gordon Garrity Date: Sat, 8 Mar 2014 16:56:57 +0000 -Subject: [PATCH 070/201] Add IQaudIO Sound Card support for Raspberry Pi +Subject: [PATCH 070/134] Add IQaudIO Sound Card support for Raspberry Pi Set a limit of 0dB on Digital Volume Control @@ -98726,10 +99034,10 @@ index 0000000000000000000000000000000000000000..1ee4097c846376666775272ed692ca33 +MODULE_DESCRIPTION("ASoC Driver for IQAudio DAC"); +MODULE_LICENSE("GPL v2"); -From 97cae591202f7832ee9dd34abefaa9fb955c8a14 Mon Sep 17 00:00:00 2001 +From 73068c3a8482046b21515105df80e74075e6868c Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Mon, 4 Aug 2014 10:06:56 +0200 -Subject: [PATCH 071/201] Added support for HiFiBerry DAC+ +Subject: [PATCH 071/134] 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. @@ -98766,7 +99074,7 @@ Signed-off-by: DigitalDreamtime create mode 100644 sound/soc/bcm/hifiberry_dacplus.c diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile -index 92c12b86c2e86f2022faeb434bb961f2410faa3e..c901caf8988417053d19916172cf8eb8468a59fd 100644 +index c19983afcb81c9d1ec8e5059a1a29d70e97a4ca1..c81646bd1e91fc6f844c2139666d1811eb3313b3 100644 --- a/drivers/clk/Makefile +++ b/drivers/clk/Makefile @@ -26,6 +26,7 @@ obj-$(CONFIG_ARCH_CLPS711X) += clk-clps711x.o @@ -99359,10 +99667,10 @@ index 72b19e62f6267698aea45d2410d616d91c1825cb..c6839ef6e16754ed9de2698507b8986a dev_err(dev, "No LRCLK?\n"); return -EINVAL; -From f5bdf9d90b3355a793ab9744cf9e4272c12479ba Mon Sep 17 00:00:00 2001 +From 065823044ad50b8de36a7db8022437707921b04b Mon Sep 17 00:00:00 2001 From: Daniel Matuschek Date: Mon, 4 Aug 2014 11:09:58 +0200 -Subject: [PATCH 072/201] Added driver for HiFiBerry Amp amplifier add-on board +Subject: [PATCH 072/134] 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. @@ -99562,10 +99870,10 @@ index 0000000000000000000000000000000000000000..221c6c38e6465ffe5d5ad77fa80a0b14 +MODULE_DESCRIPTION("ASoC driver for HiFiBerry-AMP"); +MODULE_LICENSE("GPL v2"); diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig -index 17b431dc7ea27b1938a1cfe8949e450933ba83e7..55812b0b884cf4fc4e86680b11fedd11c863db7a 100644 +index fefde2905c505d8cc1049981591234bfef94aae3..adf3b7b75e303430d6a03a2b457d389596f39c1a 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig -@@ -144,6 +144,7 @@ config SND_SOC_ALL_CODECS +@@ -149,6 +149,7 @@ config SND_SOC_ALL_CODECS select SND_SOC_TFA9879 if I2C select SND_SOC_TLV320AIC23_I2C if I2C select SND_SOC_TLV320AIC23_SPI if SPI_MASTER @@ -99573,7 +99881,7 @@ index 17b431dc7ea27b1938a1cfe8949e450933ba83e7..55812b0b884cf4fc4e86680b11fedd11 select SND_SOC_TLV320AIC26 if SPI_MASTER select SND_SOC_TLV320AIC31XX if I2C select SND_SOC_TLV320AIC32X4_I2C if I2C -@@ -847,6 +848,9 @@ config SND_SOC_TFA9879 +@@ -869,6 +870,9 @@ config SND_SOC_TFA9879 tristate "NXP Semiconductors TFA9879 amplifier" depends on I2C @@ -99584,10 +99892,10 @@ index 17b431dc7ea27b1938a1cfe8949e450933ba83e7..55812b0b884cf4fc4e86680b11fedd11 tristate diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile -index 4dd919b509d11511807a3c3307ca9b472309c810..c675785b3e8d5987f3f7d7aef0bb4b31fbee81e4 100644 +index a0426bc4f2af97c8aa95fa6f1347c3d6f824a9ee..0821306d3f57ad34d48aadefbf77347b5924f046 100644 --- a/sound/soc/codecs/Makefile +++ b/sound/soc/codecs/Makefile -@@ -150,6 +150,7 @@ snd-soc-tas5086-objs := tas5086.o +@@ -154,6 +154,7 @@ snd-soc-tas5086-objs := tas5086.o snd-soc-tas571x-objs := tas571x.o snd-soc-tas5720-objs := tas5720.o snd-soc-tfa9879-objs := tfa9879.o @@ -99595,7 +99903,7 @@ index 4dd919b509d11511807a3c3307ca9b472309c810..c675785b3e8d5987f3f7d7aef0bb4b31 snd-soc-tlv320aic23-objs := tlv320aic23.o snd-soc-tlv320aic23-i2c-objs := tlv320aic23-i2c.o snd-soc-tlv320aic23-spi-objs := tlv320aic23-spi.o -@@ -377,6 +378,7 @@ obj-$(CONFIG_SND_SOC_TAS5086) += snd-soc-tas5086.o +@@ -386,6 +387,7 @@ obj-$(CONFIG_SND_SOC_TAS5086) += snd-soc-tas5086.o obj-$(CONFIG_SND_SOC_TAS571X) += snd-soc-tas571x.o obj-$(CONFIG_SND_SOC_TAS5720) += snd-soc-tas5720.o obj-$(CONFIG_SND_SOC_TFA9879) += snd-soc-tfa9879.o @@ -100197,40 +100505,10 @@ index 0000000000000000000000000000000000000000..8f019e04898754d2f87e9630137be9e8 + +#endif /* _TAS5713_H */ -From c48b293296340297ed6ad390e38aabe3b01b12db Mon Sep 17 00:00:00 2001 -From: Ryan Coe -Date: Sat, 31 Jan 2015 18:25:49 -0700 -Subject: [PATCH 073/201] Update ds1307 driver for device-tree support - -Signed-off-by: Ryan Coe ---- - drivers/rtc/rtc-ds1307.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c -index 4ad97be480430babc3321075f2739114eaad8f04..2ac1c265dc9cea56a5949eb537949a1f8853edc5 100644 ---- a/drivers/rtc/rtc-ds1307.c -+++ b/drivers/rtc/rtc-ds1307.c -@@ -1708,6 +1708,14 @@ static int ds1307_remove(struct i2c_client *client) - return 0; - } - -+#ifdef CONFIG_OF -+static const struct of_device_id ds1307_of_match[] = { -+ { .compatible = "maxim,ds1307" }, -+ { } -+}; -+MODULE_DEVICE_TABLE(of, ds1307_of_match); -+#endif -+ - static struct i2c_driver ds1307_driver = { - .driver = { - .name = "rtc-ds1307", - -From 8fd27529b52ead1bb4c7b971832d8347085e9f4a Mon Sep 17 00:00:00 2001 +From a8f72ba9386d9b928939d53462e2d125eafdefb0 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 25 Mar 2015 09:26:17 +0100 -Subject: [PATCH 074/201] Add driver for rpi-proto +Subject: [PATCH 073/134] 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 @@ -100445,10 +100723,10 @@ index 0000000000000000000000000000000000000000..fadbfade100228aaafabb0d3bdf35c01 +MODULE_DESCRIPTION("ASoC Driver for Raspberry Pi connected to PROTO board (WM8731)"); +MODULE_LICENSE("GPL"); -From 9fcf037ed1a22dcccf093a84cabc696dc4b88505 Mon Sep 17 00:00:00 2001 +From 38fa8a51f9230da582d433cb67acbe75ce4b1417 Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Mon, 24 Aug 2015 16:03:47 +0100 -Subject: [PATCH 075/201] RaspiDAC3 support +Subject: [PATCH 074/134] RaspiDAC3 support Signed-off-by: Jan Grulich @@ -100691,10 +100969,10 @@ index 0000000000000000000000000000000000000000..ad2b5b89bc8213dc2e277306ef50d6e3 +MODULE_DESCRIPTION("ASoC Driver for RaspiDAC Rev.3x"); +MODULE_LICENSE("GPL v2"); -From 8271d6874209a007e84140272ea5775aaf57118b Mon Sep 17 00:00:00 2001 +From ac2e94092d5112fab507ff026191bc45235230b1 Mon Sep 17 00:00:00 2001 From: Aaron Shaw Date: Thu, 7 Apr 2016 21:26:21 +0100 -Subject: [PATCH 076/201] Add Support for JustBoom Audio boards +Subject: [PATCH 075/134] Add Support for JustBoom Audio boards justboom-dac: Adjust for ALSA API change @@ -101150,10 +101428,10 @@ index 0000000000000000000000000000000000000000..909cf8928f2f4313982316f9c5b8a709 +MODULE_DESCRIPTION("ASoC Driver for JustBoom PI Digi HAT Sound Card"); +MODULE_LICENSE("GPL v2"); -From 7a05318ea11550ab991fbd7a699fb808c43a095f Mon Sep 17 00:00:00 2001 +From da337bbc4d6488e7e2c019a76c35b115ffda939f Mon Sep 17 00:00:00 2001 From: Andrey Grodzovsky Date: Tue, 3 May 2016 22:10:59 -0400 -Subject: [PATCH 077/201] ARM: adau1977-adc: Add basic machine driver for +Subject: [PATCH 076/134] ARM: adau1977-adc: Add basic machine driver for adau1977 codec driver. This commit adds basic support for the codec usage including: Device tree overlay, @@ -101335,10 +101613,10 @@ index 0000000000000000000000000000000000000000..f3d7e5db7bb912e1d7ca6f8e8d42df5f +MODULE_DESCRIPTION("ASoC Driver for ADAU1977 ADC"); +MODULE_LICENSE("GPL v2"); -From e26efef460112ba7338dc8b542e8ad769ff11859 Mon Sep 17 00:00:00 2001 +From 6425a4b66d65405ddabd9a728a508a9c08de17f0 Mon Sep 17 00:00:00 2001 From: Matt Flax Date: Mon, 16 May 2016 21:36:31 +1000 -Subject: [PATCH 078/201] New AudioInjector.net Pi soundcard with low jitter +Subject: [PATCH 077/134] 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. @@ -101589,10 +101867,10 @@ index 0000000000000000000000000000000000000000..ef54e0f07ea03f59e9957b5d98f3e7fd +MODULE_ALIAS("platform:audioinjector-pi-soundcard"); + -From 88a6d5405971fa44b0925525eb405fb8539d8775 Mon Sep 17 00:00:00 2001 +From 420a0501be7011cc483e59a117c1d84253ae3253 Mon Sep 17 00:00:00 2001 From: DigitalDreamtime Date: Thu, 30 Jun 2016 18:38:42 +0100 -Subject: [PATCH 079/201] Add IQAudIO Digi WM8804 board support +Subject: [PATCH 078/134] Add IQAudIO Digi WM8804 board support Support IQAudIO Digi board with iqaudio_digi machine driver and iqaudio-digi-wm8804-audio overlay. @@ -101892,10 +102170,10 @@ index 0000000000000000000000000000000000000000..33aa2be8a43a12a12cfb5d844dd9732c +MODULE_DESCRIPTION("ASoC Driver for IQAudIO WM8804 Digi"); +MODULE_LICENSE("GPL v2"); -From 048758a918cb55bc59b072aeaa279935b23e12c0 Mon Sep 17 00:00:00 2001 +From bccf55222180f5899ac499f2b0339f7b12527e4b Mon Sep 17 00:00:00 2001 From: escalator2015 Date: Tue, 24 May 2016 16:20:09 +0100 -Subject: [PATCH 080/201] New driver for RRA DigiDAC1 soundcard using WM8741 + +Subject: [PATCH 079/134] New driver for RRA DigiDAC1 soundcard using WM8741 + WM8804 --- @@ -102368,10 +102646,10 @@ index 0000000000000000000000000000000000000000..f200688bb4ae32b90a0ced555aed94b0 +MODULE_DESCRIPTION("ASoC Driver for RRA DigiDAC1"); +MODULE_LICENSE("GPL v2"); -From fe4acca785e34f68b88bfb6328ed7bc717cab223 Mon Sep 17 00:00:00 2001 +From f9002317442917ebd445c3f3a70aca0d6ddf9c9d Mon Sep 17 00:00:00 2001 From: DigitalDreamtime Date: Sat, 2 Jul 2016 16:26:19 +0100 -Subject: [PATCH 081/201] Add support for Dion Audio LOCO DAC-AMP HAT +Subject: [PATCH 080/134] Add support for Dion Audio LOCO DAC-AMP HAT Using dedicated machine driver and pcm5102a codec driver. @@ -102544,10 +102822,10 @@ index 0000000000000000000000000000000000000000..65e03741d349a2dc5bd91f69855ea952 +MODULE_DESCRIPTION("ASoC Driver for DionAudio LOCO"); +MODULE_LICENSE("GPL v2"); -From 254b1a99f02fac51be898d82634a98d18977bd23 Mon Sep 17 00:00:00 2001 +From 1184ae3d88ed83ca48127fcdfe32b684cb4366ce Mon Sep 17 00:00:00 2001 From: Clive Messer Date: Mon, 19 Sep 2016 14:01:04 +0100 -Subject: [PATCH 082/201] Allo Piano DAC boards: Initial 2 channel (stereo) +Subject: [PATCH 081/134] 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, @@ -102754,10 +103032,1464 @@ index 0000000000000000000000000000000000000000..eaf50fb6dbca1970ae1c6f8662088b0f +MODULE_DESCRIPTION("ALSA ASoC Machine Driver for Allo Piano DAC"); +MODULE_LICENSE("GPL v2"); -From ddbd00360241c4f50dd1734aaa7dc65856498b6c Mon Sep 17 00:00:00 2001 +From 1913487324a6c8f2321ddd6f7a338a28a0fd1955 Mon Sep 17 00:00:00 2001 +From: Raashid Muhammed +Date: Mon, 27 Mar 2017 12:35:00 +0530 +Subject: [PATCH 082/134] Add support for Allo Piano DAC 2.1 plus add-on board + for Raspberry Pi. + +The Piano DAC 2.1 has support for 4 channels with subwoofer. + +Signed-off-by: Baswaraj K +Reviewed-by: Vijay Kumar B. +Reviewed-by: Raashid Muhammed + +Add clock changes and mute gpios (#1938) + +Also improve code style and adhere to ALSA coding conventions. + +Signed-off-by: Baswaraj K +Reviewed-by: Vijay Kumar B. +Reviewed-by: Raashid Muhammed +--- + sound/soc/bcm/Kconfig | 7 + + sound/soc/bcm/Makefile | 2 + + sound/soc/bcm/allo-piano-dac-plus.c | 683 ++++++++++++++++++++++++++++++++++++ + 3 files changed, 692 insertions(+) + create mode 100644 sound/soc/bcm/allo-piano-dac-plus.c + +diff --git a/sound/soc/bcm/Kconfig b/sound/soc/bcm/Kconfig +index b600cfb98ac9baa21b3c6f09eff05149f14fda0a..58c36f2e7bb7226a681ed64843eb9bc0b80a6301 100644 +--- a/sound/soc/bcm/Kconfig ++++ b/sound/soc/bcm/Kconfig +@@ -131,3 +131,10 @@ config SND_BCM2708_SOC_ALLO_PIANO_DAC + select SND_SOC_PCM512x_I2C + help + Say Y or M if you want to add support for Allo Piano DAC. ++ ++config SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS ++ tristate "Support for Allo Piano DAC Plus" ++ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S ++ select SND_SOC_PCM512x_I2C ++ help ++ Say Y or M if you want to add support for Allo Piano DAC Plus. +diff --git a/sound/soc/bcm/Makefile b/sound/soc/bcm/Makefile +index 64f007f8ba38276a42e0bd8db92544db9412544b..023b2c17098b4e64bb188a598f0b4923019758ce 100644 +--- a/sound/soc/bcm/Makefile ++++ b/sound/soc/bcm/Makefile +@@ -25,6 +25,7 @@ snd-soc-audioinjector-pi-soundcard-objs := audioinjector-pi-soundcard.o + snd-soc-digidac1-soundcard-objs := digidac1-soundcard.o + snd-soc-dionaudio-loco-objs := dionaudio_loco.o + snd-soc-allo-piano-dac-objs := allo-piano-dac.o ++snd-soc-allo-piano-dac-plus-objs := allo-piano-dac-plus.o + + obj-$(CONFIG_SND_BCM2708_SOC_ADAU1977_ADC) += snd-soc-adau1977-adc.o + obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_AMP) += snd-soc-hifiberry-amp.o +@@ -42,3 +43,4 @@ obj-$(CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD) += snd-soc-audioinjector-pi-soundca + obj-$(CONFIG_SND_DIGIDAC1_SOUNDCARD) += snd-soc-digidac1-soundcard.o + obj-$(CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO) += snd-soc-dionaudio-loco.o + obj-$(CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC) += snd-soc-allo-piano-dac.o ++obj-$(CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS) += snd-soc-allo-piano-dac-plus.o +diff --git a/sound/soc/bcm/allo-piano-dac-plus.c b/sound/soc/bcm/allo-piano-dac-plus.c +new file mode 100644 +index 0000000000000000000000000000000000000000..56e43f98846b41e487b3089813f7edc3c08517eb +--- /dev/null ++++ b/sound/soc/bcm/allo-piano-dac-plus.c +@@ -0,0 +1,683 @@ ++/* ++ * ALSA ASoC Machine Driver for Allo Piano DAC Plus Subwoofer ++ * ++ * Author: Baswaraj K ++ * Copyright 2016 ++ * based on code by Daniel Matuschek ++ * based on code by Florian Meier ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * version 2 as published by the Free Software Foundation. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "../codecs/pcm512x.h" ++ ++struct dsp_code { ++ char i2c_addr; ++ char offset; ++ char val; ++}; ++ ++struct glb_pool { ++ struct mutex lock; ++ unsigned int set_lowpass; ++ unsigned int set_mode; ++ unsigned int set_rate; ++ unsigned int dsp_page_number; ++}; ++ ++static bool digital_gain_0db_limit = true; ++bool glb_mclk; ++ ++static struct gpio_desc *mute_gpio[2]; ++ ++ ++static const char * const allo_piano_mode_texts[] = { ++ "2.0", ++ "2.1", ++ "2.2", ++}; ++ ++static const SOC_ENUM_SINGLE_DECL(allo_piano_mode_enum, ++ 0, 0, allo_piano_mode_texts); ++ ++static const char * const allo_piano_dsp_low_pass_texts[] = { ++ "60", ++ "70", ++ "80", ++ "90", ++ "100", ++ "110", ++ "120", ++ "130", ++ "140", ++ "150", ++ "160", ++ "170", ++ "180", ++ "190", ++ "200", ++}; ++ ++static const SOC_ENUM_SINGLE_DECL(allo_piano_enum, ++ 0, 0, allo_piano_dsp_low_pass_texts); ++ ++static int __snd_allo_piano_dsp_program(struct snd_soc_pcm_runtime *rtd, ++ unsigned int mode, unsigned int rate, unsigned int lowpass) ++{ ++ const struct firmware *fw; ++ char firmware_name[60]; ++ int ret = 0, dac = 0; ++ struct snd_soc_card *card = rtd->card; ++ struct glb_pool *glb_ptr = card->drvdata; ++ ++ if (rate <= 46000) ++ rate = 44100; ++ else if (rate <= 68000) ++ rate = 48000; ++ else if (rate <= 92000) ++ rate = 88200; ++ else if (rate <= 136000) ++ rate = 96000; ++ else if (rate <= 184000) ++ rate = 176400; ++ else ++ rate = 192000; ++ ++ if ((lowpass > 14) || (lowpass < 0)) ++ lowpass = 3; ++ if ((mode > 2) || (mode < 0)) ++ mode = 0; ++ ++ /* same configuration loaded */ ++ if ((rate == glb_ptr->set_rate) && (lowpass == glb_ptr->set_lowpass) ++ && (mode == glb_ptr->set_mode)) ++ return 0; ++ ++ if (mode == 0) { /* 2.0 */ ++ snd_soc_write(rtd->codec_dais[1]->codec, ++ PCM512x_MUTE, 0x11); ++ glb_ptr->set_rate = rate; ++ glb_ptr->set_mode = mode; ++ glb_ptr->set_lowpass = lowpass; ++ return 1; ++ } else { ++ snd_soc_write(rtd->codec_dais[1]->codec, ++ PCM512x_MUTE, 0x00); ++ } ++ ++ for (dac = 0; dac < rtd->num_codecs; dac++) { ++ struct dsp_code *dsp_code_read; ++ struct snd_soc_codec *codec = rtd->codec_dais[dac]->codec; ++ int i = 1; ++ ++ if (dac == 0) { /* high */ ++ sprintf(firmware_name, ++ "allo/piano/2.2/allo-piano-dsp-%d-%d-%d.bin", ++ rate, ((lowpass * 10) + 60), dac); ++ } else { /* low */ ++ sprintf(firmware_name, ++ "allo/piano/2.%d/allo-piano-dsp-%d-%d-%d.bin", ++ mode, rate, ((lowpass * 10) + 60), dac); ++ } ++ ++ dev_info(codec->dev, "Dsp Firmware File Name: %s\n", ++ firmware_name); ++ ++ ret = request_firmware(&fw, firmware_name, codec->dev); ++ if (ret < 0) { ++ dev_err(codec->dev, ++ "Error: Allo Piano Firmware %s missing. %d\n", ++ firmware_name, ret); ++ goto err; ++ } ++ ++ while (i < (fw->size - 1)) { ++ dsp_code_read = (struct dsp_code *)&fw->data[i]; ++ ++ if (dsp_code_read->offset == 0) { ++ glb_ptr->dsp_page_number = dsp_code_read->val; ++ ret = snd_soc_write(rtd->codec_dais[dac]->codec, ++ PCM512x_PAGE_BASE(0), ++ dsp_code_read->val); ++ ++ } else if (dsp_code_read->offset != 0) { ++ ret = snd_soc_write(rtd->codec_dais[dac]->codec, ++ (PCM512x_PAGE_BASE( ++ glb_ptr->dsp_page_number) + ++ dsp_code_read->offset), ++ dsp_code_read->val); ++ } ++ if (ret < 0) { ++ dev_err(codec->dev, ++ "Failed to write Register: %d\n", ret); ++ release_firmware(fw); ++ goto err; ++ } ++ i = i + 3; ++ } ++ release_firmware(fw); ++ } ++ glb_ptr->set_rate = rate; ++ glb_ptr->set_mode = mode; ++ glb_ptr->set_lowpass = lowpass; ++ return 1; ++ ++err: ++ return ret; ++} ++ ++static int snd_allo_piano_dsp_program(struct snd_soc_pcm_runtime *rtd, ++ unsigned int mode, unsigned int rate, unsigned int lowpass) ++{ ++ struct snd_soc_card *card = rtd->card; ++ struct glb_pool *glb_ptr = card->drvdata; ++ int ret = 0; ++ ++ mutex_lock(&glb_ptr->lock); ++ ++ ret = __snd_allo_piano_dsp_program(rtd, ++ mode, rate, lowpass); ++ mutex_unlock(&glb_ptr->lock); ++ ++ return ret; ++} ++ ++static int snd_allo_piano_mode_get(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); ++ struct glb_pool *glb_ptr = card->drvdata; ++ ++ ucontrol->value.integer.value[0] = glb_ptr->set_mode; ++ return 0; ++} ++ ++static int snd_allo_piano_mode_put(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); ++ struct snd_soc_pcm_runtime *rtd; ++ struct glb_pool *glb_ptr = card->drvdata; ++ ++ rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); ++ return(snd_allo_piano_dsp_program(rtd, ++ ucontrol->value.integer.value[0], ++ glb_ptr->set_rate, glb_ptr->set_lowpass)); ++} ++ ++static int snd_allo_piano_lowpass_get(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); ++ struct glb_pool *glb_ptr = card->drvdata; ++ ++ ucontrol->value.integer.value[0] = glb_ptr->set_lowpass; ++ return 0; ++} ++ ++static int snd_allo_piano_lowpass_put(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); ++ struct snd_soc_pcm_runtime *rtd; ++ struct glb_pool *glb_ptr = card->drvdata; ++ ++ rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); ++ return(snd_allo_piano_dsp_program(rtd, ++ glb_ptr->set_mode, glb_ptr->set_rate, ++ ucontrol->value.integer.value[0])); ++} ++ ++static int pcm512x_get_reg_sub(struct snd_kcontrol *kcontrol, ++ 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 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; ++ ++ ucontrol->value.integer.value[0] = ++ (~(left_val >> mc->shift)) & mc->max; ++ ucontrol->value.integer.value[1] = ++ (~(right_val >> mc->shift)) & mc->max; ++ ++ return 0; ++} ++ ++static int pcm512x_set_reg_sub(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ struct soc_mixer_control *mc = ++ (struct soc_mixer_control *)kcontrol->private_value; ++ struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); ++ struct snd_soc_pcm_runtime *rtd; ++ unsigned int left_val = (ucontrol->value.integer.value[0] & mc->max); ++ unsigned int right_val = (ucontrol->value.integer.value[1] & mc->max); ++ int ret = 0; ++ ++ rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); ++ ret = snd_soc_write(rtd->codec_dais[1]->codec, ++ PCM512x_DIGITAL_VOLUME_2, (~left_val)); ++ if (ret < 0) ++ return ret; ++ ++ ret = snd_soc_write(rtd->codec_dais[1]->codec, ++ PCM512x_DIGITAL_VOLUME_3, (~right_val)); ++ if (ret < 0) ++ return ret; ++ ++ return 1; ++} ++ ++static int pcm512x_get_reg_sub_switch(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); ++ 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[1]->codec, PCM512x_MUTE); ++ if (val < 0) ++ return val; ++ ++ ucontrol->value.integer.value[0] = (val & 0x10) ? 0 : 1; ++ ucontrol->value.integer.value[1] = (val & 0x01) ? 0 : 1; ++ ++ return val; ++} ++ ++static int pcm512x_set_reg_sub_switch(struct snd_kcontrol *kcontrol, ++ struct snd_ctl_elem_value *ucontrol) ++{ ++ struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); ++ struct snd_soc_pcm_runtime *rtd; ++ unsigned int left_val = (ucontrol->value.integer.value[0]); ++ unsigned int right_val = (ucontrol->value.integer.value[1]); ++ int ret = 0; ++ ++ rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); ++ ret = snd_soc_write(rtd->codec_dais[1]->codec, PCM512x_MUTE, ++ ~((left_val & 0x01)<<4 | (right_val & 0x01))); ++ if (ret < 0) ++ return ret; ++ ++ return 1; ++ ++} ++ ++static const DECLARE_TLV_DB_SCALE(digital_tlv_sub, -10350, 50, 1); ++ ++static const struct snd_kcontrol_new allo_piano_controls[] = { ++ SOC_ENUM_EXT("Subwoofer mode Route", ++ allo_piano_mode_enum, ++ snd_allo_piano_mode_get, ++ snd_allo_piano_mode_put), ++ ++ SOC_ENUM_EXT("Lowpass Route", allo_piano_enum, ++ snd_allo_piano_lowpass_get, ++ snd_allo_piano_lowpass_put), ++ ++ SOC_DOUBLE_R_EXT_TLV("Subwoofer Playback Volume", ++ PCM512x_DIGITAL_VOLUME_2, ++ PCM512x_DIGITAL_VOLUME_3, 0, 255, 1, ++ pcm512x_get_reg_sub, ++ pcm512x_set_reg_sub, ++ digital_tlv_sub), ++ ++ SOC_DOUBLE_EXT("Subwoofer Playback Switch", ++ PCM512x_MUTE, ++ PCM512x_RQML_SHIFT, ++ PCM512x_RQMR_SHIFT, 1, 1, ++ pcm512x_get_reg_sub_switch, ++ pcm512x_set_reg_sub_switch), ++}; ++ ++static int snd_allo_piano_dac_init(struct snd_soc_pcm_runtime *rtd) ++{ ++ struct snd_soc_card *card = rtd->card; ++ struct glb_pool *glb_ptr; ++ ++ glb_ptr = kmalloc(sizeof(struct glb_pool), GFP_KERNEL); ++ if (!glb_ptr) ++ return -ENOMEM; ++ ++ memset(glb_ptr, 0x00, sizeof(glb_ptr)); ++ card->drvdata = glb_ptr; ++ ++ mutex_init(&glb_ptr->lock); ++ ++ if (digital_gain_0db_limit) { ++ int ret; ++ ++ ret = snd_soc_limit_volume(card, "Digital Playback Volume", ++ 207); ++ if (ret < 0) ++ dev_warn(card->dev, "Failed to set volume limit: %d\n", ++ ret); ++ } ++ ++ return 0; ++} ++ ++static void snd_allo_piano_gpio_mute(struct snd_soc_card *card) ++{ ++ if (mute_gpio[0]) ++ gpiod_set_value_cansleep(mute_gpio[0], 1); ++ ++ if (mute_gpio[1]) ++ gpiod_set_value_cansleep(mute_gpio[1], 1); ++} ++ ++static void snd_allo_piano_gpio_unmute(struct snd_soc_card *card) ++{ ++ if (mute_gpio[0]) ++ gpiod_set_value_cansleep(mute_gpio[0], 0); ++ ++ if (mute_gpio[1]) ++ gpiod_set_value_cansleep(mute_gpio[1], 0); ++} ++ ++static int snd_allo_piano_set_bias_level(struct snd_soc_card *card, ++ struct snd_soc_dapm_context *dapm, enum snd_soc_bias_level level) ++{ ++ struct snd_soc_pcm_runtime *rtd; ++ struct snd_soc_dai *codec_dai; ++ ++ rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); ++ codec_dai = rtd->codec_dai; ++ ++ if (dapm->dev != codec_dai->dev) ++ return 0; ++ ++ switch (level) { ++ case SND_SOC_BIAS_PREPARE: ++ if (dapm->bias_level != SND_SOC_BIAS_STANDBY) ++ break; ++ /* UNMUTE DAC */ ++ snd_allo_piano_gpio_unmute(card); ++ break; ++ ++ case SND_SOC_BIAS_STANDBY: ++ if (dapm->bias_level != SND_SOC_BIAS_PREPARE) ++ break; ++ /* MUTE DAC */ ++ snd_allo_piano_gpio_mute(card); ++ break; ++ ++ default: ++ break; ++ } ++ ++ return 0; ++} ++ ++static int snd_allo_piano_dac_startup( ++ struct snd_pcm_substream *substream) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_card *card = rtd->card; ++ ++ snd_allo_piano_gpio_mute(card); ++ ++ return 0; ++} ++ ++static int snd_allo_piano_dac_hw_params( ++ struct snd_pcm_substream *substream, ++ struct snd_pcm_hw_params *params) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_dai *cpu_dai = rtd->cpu_dai; ++ unsigned int sample_bits = ++ snd_pcm_format_physical_width(params_format(params)); ++ unsigned int rate = params_rate(params); ++ struct snd_soc_card *card = rtd->card; ++ struct glb_pool *glb_ptr = card->drvdata; ++ int ret = 0, val = 0, dac; ++ ++ for (dac = 0; (glb_mclk && dac < 2); dac++) { ++ /* Configure the PLL clock reference for both the Codecs */ ++ val = snd_soc_read(rtd->codec_dais[dac]->codec, ++ PCM512x_RATE_DET_4); ++ if (val < 0) { ++ dev_err(rtd->codec_dais[dac]->codec->dev, ++ "Failed to read register PCM512x_RATE_DET_4\n"); ++ return val; ++ } ++ ++ if (val & 0x40) { ++ snd_soc_write(rtd->codec_dais[dac]->codec, ++ PCM512x_PLL_REF, ++ PCM512x_SREF_BCK); ++ ++ dev_info(rtd->codec_dais[dac]->codec->dev, ++ "Setting BCLK as input clock & Enable PLL\n"); ++ } else { ++ snd_soc_write(rtd->codec_dais[dac]->codec, ++ PCM512x_PLL_EN, ++ 0x00); ++ ++ snd_soc_write(rtd->codec_dais[dac]->codec, ++ PCM512x_PLL_REF, ++ PCM512x_SREF_SCK); ++ ++ dev_info(rtd->codec_dais[dac]->codec->dev, ++ "Setting SCLK as input clock & disabled PLL\n"); ++ } ++ } ++ ++ 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) ++ return ret; ++ ++ ret = snd_soc_dai_set_bclk_ratio(cpu_dai, sample_bits * 2); ++ ++ return ret; ++} ++ ++static int snd_allo_piano_dac_prepare( ++ struct snd_pcm_substream *substream) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_card *card = rtd->card; ++ ++ snd_allo_piano_gpio_unmute(card); ++ return 0; ++} ++ ++/* machine stream operations */ ++static struct snd_soc_ops snd_allo_piano_dac_ops = { ++ .startup = snd_allo_piano_dac_startup, ++ .hw_params = snd_allo_piano_dac_hw_params, ++ .prepare = snd_allo_piano_dac_prepare, ++}; ++ ++static struct snd_soc_dai_link_component allo_piano_2_1_codecs[] = { ++ { ++ .dai_name = "pcm512x-hifi", ++ }, ++ { ++ .dai_name = "pcm512x-hifi", ++ }, ++}; ++ ++static struct snd_soc_dai_link snd_allo_piano_dac_dai[] = { ++ { ++ .name = "PianoDACPlus", ++ .stream_name = "PianoDACPlus", ++ .cpu_dai_name = "bcm2708-i2s.0", ++ .platform_name = "bcm2708-i2s.0", ++ .codecs = allo_piano_2_1_codecs, ++ .num_codecs = 2, ++ .dai_fmt = SND_SOC_DAIFMT_I2S | ++ SND_SOC_DAIFMT_NB_NF | ++ SND_SOC_DAIFMT_CBS_CFS, ++ .ops = &snd_allo_piano_dac_ops, ++ .init = snd_allo_piano_dac_init, ++ }, ++}; ++ ++/* audio machine driver */ ++static struct snd_soc_card snd_allo_piano_dac = { ++ .name = "PianoDACPlus", ++ .owner = THIS_MODULE, ++ .dai_link = snd_allo_piano_dac_dai, ++ .num_links = ARRAY_SIZE(snd_allo_piano_dac_dai), ++ .controls = allo_piano_controls, ++ .num_controls = ARRAY_SIZE(allo_piano_controls), ++}; ++ ++static int snd_allo_piano_dac_probe(struct platform_device *pdev) ++{ ++ struct snd_soc_card *card = &snd_allo_piano_dac; ++ int ret = 0, i = 0; ++ ++ card->dev = &pdev->dev; ++ platform_set_drvdata(pdev, &snd_allo_piano_dac); ++ ++ if (pdev->dev.of_node) { ++ struct device_node *i2s_node; ++ struct snd_soc_dai_link *dai; ++ ++ dai = &snd_allo_piano_dac_dai[0]; ++ i2s_node = of_parse_phandle(pdev->dev.of_node, ++ "i2s-controller", 0); ++ if (i2s_node) { ++ for (i = 0; i < card->num_links; i++) { ++ dai->cpu_dai_name = NULL; ++ dai->cpu_of_node = i2s_node; ++ dai->platform_name = NULL; ++ dai->platform_of_node = i2s_node; ++ } ++ } ++ digital_gain_0db_limit = ++ !of_property_read_bool(pdev->dev.of_node, ++ "allo,24db_digital_gain"); ++ ++ glb_mclk = of_property_read_bool(pdev->dev.of_node, ++ "allo,glb_mclk"); ++ ++ allo_piano_2_1_codecs[0].of_node = ++ of_parse_phandle(pdev->dev.of_node, "audio-codec", 0); ++ if (!allo_piano_2_1_codecs[0].of_node) { ++ dev_err(&pdev->dev, ++ "Property 'audio-codec' missing or invalid\n"); ++ return -EINVAL; ++ } ++ ++ allo_piano_2_1_codecs[1].of_node = ++ of_parse_phandle(pdev->dev.of_node, "audio-codec", 1); ++ if (!allo_piano_2_1_codecs[1].of_node) { ++ dev_err(&pdev->dev, ++ "Property 'audio-codec' missing or invalid\n"); ++ return -EINVAL; ++ } ++ ++ mute_gpio[0] = devm_gpiod_get_optional(&pdev->dev, "mute1", ++ GPIOD_OUT_LOW); ++ if (IS_ERR(mute_gpio[0])) { ++ ret = PTR_ERR(mute_gpio[0]); ++ dev_err(&pdev->dev, ++ "failed to get mute1 gpio6: %d\n", ret); ++ return ret; ++ } ++ ++ mute_gpio[1] = devm_gpiod_get_optional(&pdev->dev, "mute2", ++ GPIOD_OUT_LOW); ++ if (IS_ERR(mute_gpio[1])) { ++ ret = PTR_ERR(mute_gpio[1]); ++ dev_err(&pdev->dev, ++ "failed to get mute2 gpio25: %d\n", ret); ++ return ret; ++ } ++ ++ if (mute_gpio[0] && mute_gpio[1]) ++ snd_allo_piano_dac.set_bias_level = ++ snd_allo_piano_set_bias_level; ++ ++ ret = snd_soc_register_card(&snd_allo_piano_dac); ++ if (ret < 0) { ++ dev_err(&pdev->dev, ++ "snd_soc_register_card() failed: %d\n", ret); ++ return ret; ++ } ++ ++ if ((mute_gpio[0]) && (mute_gpio[1])) ++ snd_allo_piano_gpio_mute(&snd_allo_piano_dac); ++ ++ return 0; ++ } ++ ++ return -EINVAL; ++} ++ ++static int snd_allo_piano_dac_remove(struct platform_device *pdev) ++{ ++ struct snd_soc_card *card = platform_get_drvdata(pdev); ++ ++ kfree(&card->drvdata); ++ snd_allo_piano_gpio_mute(&snd_allo_piano_dac); ++ return snd_soc_unregister_card(&snd_allo_piano_dac); ++} ++ ++static const struct of_device_id snd_allo_piano_dac_of_match[] = { ++ { .compatible = "allo,piano-dac-plus", }, ++ { /* sentinel */ }, ++}; ++ ++MODULE_DEVICE_TABLE(of, snd_allo_piano_dac_of_match); ++ ++static struct platform_driver snd_allo_piano_dac_driver = { ++ .driver = { ++ .name = "snd-allo-piano-dac-plus", ++ .owner = THIS_MODULE, ++ .of_match_table = snd_allo_piano_dac_of_match, ++ }, ++ .probe = snd_allo_piano_dac_probe, ++ .remove = snd_allo_piano_dac_remove, ++}; ++ ++module_platform_driver(snd_allo_piano_dac_driver); ++ ++MODULE_AUTHOR("Baswaraj K "); ++MODULE_DESCRIPTION("ALSA ASoC Machine Driver for Allo Piano DAC Plus"); ++MODULE_LICENSE("GPL v2"); + +From 7636a70c6eaf31dbca62bca37b57514bad8ea4b3 Mon Sep 17 00:00:00 2001 +From: BabuSubashChandar +Date: Tue, 28 Mar 2017 20:04:42 +0530 +Subject: [PATCH 083/134] Add support for Allo Boss DAC add-on board for + Raspberry Pi. (#1924) + +Signed-off-by: Baswaraj K +Reviewed-by: Deepak +Reviewed-by: BabuSubashChandar + +Add support for new clock rate and mute gpios. + +Signed-off-by: Baswaraj K +Reviewed-by: Deepak +Reviewed-by: BabuSubashChandar +--- + drivers/clk/Makefile | 1 + + drivers/clk/clk-allo-dac.c | 161 +++++++++++++++ + sound/soc/bcm/Kconfig | 7 + + sound/soc/bcm/Makefile | 2 + + sound/soc/bcm/allo-boss-dac.c | 461 ++++++++++++++++++++++++++++++++++++++++++ + 5 files changed, 632 insertions(+) + create mode 100644 drivers/clk/clk-allo-dac.c + create mode 100644 sound/soc/bcm/allo-boss-dac.c + +diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile +index c81646bd1e91fc6f844c2139666d1811eb3313b3..531ae351872dfb0c748e2d067da0503bf21a6d43 100644 +--- a/drivers/clk/Makefile ++++ b/drivers/clk/Makefile +@@ -17,6 +17,7 @@ endif + + # hardware specific clock types + # please keep this section sorted lexicographically by file path name ++obj-$(CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC) += clk-allo-dac.o + obj-$(CONFIG_MACH_ASM9260) += clk-asm9260.o + obj-$(CONFIG_COMMON_CLK_AXI_CLKGEN) += clk-axi-clkgen.o + obj-$(CONFIG_ARCH_AXXIA) += clk-axm5516.o +diff --git a/drivers/clk/clk-allo-dac.c b/drivers/clk/clk-allo-dac.c +new file mode 100644 +index 0000000000000000000000000000000000000000..0baf821d6947ebb757c8ea4594f6c1b04b4e10dd +--- /dev/null ++++ b/drivers/clk/clk-allo-dac.c +@@ -0,0 +1,161 @@ ++/* ++ * Clock Driver for Allo DAC ++ * ++ * Author: Baswaraj K ++ * Copyright 2016 ++ * based on code by Stuart MacLean ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * version 2 as published by the Free Software Foundation. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/* Clock rate of CLK44EN attached to GPIO6 pin */ ++#define CLK_44EN_RATE 45158400UL ++/* Clock rate of CLK48EN attached to GPIO3 pin */ ++#define CLK_48EN_RATE 49152000UL ++ ++/** ++ * struct allo_dac_clk - Common struct to the Allo DAC ++ * @hw: clk_hw for the common clk framework ++ * @mode: 0 => CLK44EN, 1 => CLK48EN ++ */ ++struct clk_allo_hw { ++ struct clk_hw hw; ++ uint8_t mode; ++}; ++ ++#define to_allo_clk(_hw) container_of(_hw, struct clk_allo_hw, hw) ++ ++static const struct of_device_id clk_allo_dac_dt_ids[] = { ++ { .compatible = "allo,dac-clk",}, ++ { } ++}; ++MODULE_DEVICE_TABLE(of, clk_allo_dac_dt_ids); ++ ++static unsigned long clk_allo_dac_recalc_rate(struct clk_hw *hw, ++ unsigned long parent_rate) ++{ ++ return (to_allo_clk(hw)->mode == 0) ? CLK_44EN_RATE : ++ CLK_48EN_RATE; ++} ++ ++static long clk_allo_dac_round_rate(struct clk_hw *hw, ++ unsigned long rate, unsigned long *parent_rate) ++{ ++ long actual_rate; ++ ++ if (rate <= CLK_44EN_RATE) { ++ actual_rate = (long)CLK_44EN_RATE; ++ } else if (rate >= CLK_48EN_RATE) { ++ actual_rate = (long)CLK_48EN_RATE; ++ } else { ++ long diff44Rate = (long)(rate - CLK_44EN_RATE); ++ long diff48Rate = (long)(CLK_48EN_RATE - rate); ++ ++ if (diff44Rate < diff48Rate) ++ actual_rate = (long)CLK_44EN_RATE; ++ else ++ actual_rate = (long)CLK_48EN_RATE; ++ } ++ return actual_rate; ++} ++ ++ ++static int clk_allo_dac_set_rate(struct clk_hw *hw, ++ unsigned long rate, unsigned long parent_rate) ++{ ++ unsigned long actual_rate; ++ struct clk_allo_hw *clk = to_allo_clk(hw); ++ ++ actual_rate = (unsigned long)clk_allo_dac_round_rate(hw, rate, ++ &parent_rate); ++ clk->mode = (actual_rate == CLK_44EN_RATE) ? 0 : 1; ++ return 0; ++} ++ ++ ++const struct clk_ops clk_allo_dac_rate_ops = { ++ .recalc_rate = clk_allo_dac_recalc_rate, ++ .round_rate = clk_allo_dac_round_rate, ++ .set_rate = clk_allo_dac_set_rate, ++}; ++ ++static int clk_allo_dac_probe(struct platform_device *pdev) ++{ ++ int ret; ++ struct clk_allo_hw *proclk; ++ struct clk *clk; ++ struct device *dev; ++ struct clk_init_data init; ++ ++ dev = &pdev->dev; ++ ++ proclk = kzalloc(sizeof(struct clk_allo_hw), GFP_KERNEL); ++ if (!proclk) ++ return -ENOMEM; ++ ++ init.name = "clk-allo-dac"; ++ init.ops = &clk_allo_dac_rate_ops; ++ init.flags = CLK_IS_BASIC; ++ init.parent_names = NULL; ++ init.num_parents = 0; ++ ++ proclk->mode = 0; ++ proclk->hw.init = &init; ++ ++ clk = devm_clk_register(dev, &proclk->hw); ++ if (!IS_ERR(clk)) { ++ ret = of_clk_add_provider(dev->of_node, of_clk_src_simple_get, ++ clk); ++ } else { ++ dev_err(dev, "Fail to register clock driver\n"); ++ kfree(proclk); ++ ret = PTR_ERR(clk); ++ } ++ return ret; ++} ++ ++static int clk_allo_dac_remove(struct platform_device *pdev) ++{ ++ of_clk_del_provider(pdev->dev.of_node); ++ return 0; ++} ++ ++static struct platform_driver clk_allo_dac_driver = { ++ .probe = clk_allo_dac_probe, ++ .remove = clk_allo_dac_remove, ++ .driver = { ++ .name = "clk-allo-dac", ++ .of_match_table = clk_allo_dac_dt_ids, ++ }, ++}; ++ ++static int __init clk_allo_dac_init(void) ++{ ++ return platform_driver_register(&clk_allo_dac_driver); ++} ++core_initcall(clk_allo_dac_init); ++ ++static void __exit clk_allo_dac_exit(void) ++{ ++ platform_driver_unregister(&clk_allo_dac_driver); ++} ++module_exit(clk_allo_dac_exit); ++ ++MODULE_DESCRIPTION("Allo DAC clock driver"); ++MODULE_LICENSE("GPL v2"); ++MODULE_ALIAS("platform:clk-allo-dac"); +diff --git a/sound/soc/bcm/Kconfig b/sound/soc/bcm/Kconfig +index 58c36f2e7bb7226a681ed64843eb9bc0b80a6301..4b8dde3c41f240eff4ec1d687b8229051126cec8 100644 +--- a/sound/soc/bcm/Kconfig ++++ b/sound/soc/bcm/Kconfig +@@ -138,3 +138,10 @@ config SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS + select SND_SOC_PCM512x_I2C + help + Say Y or M if you want to add support for Allo Piano DAC Plus. ++ ++config SND_BCM2708_SOC_ALLO_BOSS_DAC ++ tristate "Support for Allo Boss DAC" ++ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S ++ select SND_SOC_PCM512x_I2C ++ help ++ Say Y or M if you want to add support for Allo Boss DAC. +diff --git a/sound/soc/bcm/Makefile b/sound/soc/bcm/Makefile +index 023b2c17098b4e64bb188a598f0b4923019758ce..58ad41f041ed8ed5c0b4c71efb324d9d163252d7 100644 +--- a/sound/soc/bcm/Makefile ++++ b/sound/soc/bcm/Makefile +@@ -24,6 +24,7 @@ snd-soc-raspidac3-objs := raspidac3.o + snd-soc-audioinjector-pi-soundcard-objs := audioinjector-pi-soundcard.o + snd-soc-digidac1-soundcard-objs := digidac1-soundcard.o + snd-soc-dionaudio-loco-objs := dionaudio_loco.o ++snd-soc-allo-boss-dac-objs := allo-boss-dac.o + snd-soc-allo-piano-dac-objs := allo-piano-dac.o + snd-soc-allo-piano-dac-plus-objs := allo-piano-dac-plus.o + +@@ -42,5 +43,6 @@ obj-$(CONFIG_SND_BCM2708_SOC_RASPIDAC3) += snd-soc-raspidac3.o + obj-$(CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD) += snd-soc-audioinjector-pi-soundcard.o + obj-$(CONFIG_SND_DIGIDAC1_SOUNDCARD) += snd-soc-digidac1-soundcard.o + obj-$(CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO) += snd-soc-dionaudio-loco.o ++obj-$(CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC) += snd-soc-allo-boss-dac.o + obj-$(CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC) += snd-soc-allo-piano-dac.o + obj-$(CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS) += snd-soc-allo-piano-dac-plus.o +diff --git a/sound/soc/bcm/allo-boss-dac.c b/sound/soc/bcm/allo-boss-dac.c +new file mode 100644 +index 0000000000000000000000000000000000000000..203ab76c7045b081578e23bda1099dd103d11154 +--- /dev/null ++++ b/sound/soc/bcm/allo-boss-dac.c +@@ -0,0 +1,461 @@ ++/* ++ * ALSA ASoC Machine Driver for Allo Boss DAC ++ * ++ * Author: Baswaraj K ++ * Copyright 2017 ++ * based on code by Daniel Matuschek, ++ * Stuart MacLean ++ * based on code by Florian Meier ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * version 2 as published by the Free Software Foundation. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include "../codecs/pcm512x.h" ++ ++#define ALLO_BOSS_NOCLOCK 0 ++#define ALLO_BOSS_CLK44EN 1 ++#define ALLO_BOSS_CLK48EN 2 ++ ++struct pcm512x_priv { ++ struct regmap *regmap; ++ struct clk *sclk; ++}; ++ ++static struct gpio_desc *mute_gpio; ++ ++/* Clock rate of CLK44EN attached to GPIO6 pin */ ++#define CLK_44EN_RATE 45158400UL ++/* Clock rate of CLK48EN attached to GPIO3 pin */ ++#define CLK_48EN_RATE 49152000UL ++ ++static bool slave; ++static bool snd_soc_allo_boss_master; ++static bool digital_gain_0db_limit = true; ++ ++static void snd_allo_boss_select_clk(struct snd_soc_codec *codec, ++ int clk_id) ++{ ++ switch (clk_id) { ++ case ALLO_BOSS_NOCLOCK: ++ snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x24, 0x00); ++ break; ++ case ALLO_BOSS_CLK44EN: ++ snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x24, 0x20); ++ break; ++ case ALLO_BOSS_CLK48EN: ++ snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x24, 0x04); ++ break; ++ } ++} ++ ++static void snd_allo_boss_clk_gpio(struct snd_soc_codec *codec) ++{ ++ snd_soc_update_bits(codec, PCM512x_GPIO_EN, 0x24, 0x24); ++ snd_soc_update_bits(codec, PCM512x_GPIO_OUTPUT_3, 0x0f, 0x02); ++ snd_soc_update_bits(codec, PCM512x_GPIO_OUTPUT_6, 0x0f, 0x02); ++} ++ ++static bool snd_allo_boss_is_sclk(struct snd_soc_codec *codec) ++{ ++ int sck; ++ ++ sck = snd_soc_read(codec, PCM512x_RATE_DET_4); ++ return (!(sck & 0x40)); ++} ++ ++static bool snd_allo_boss_is_sclk_sleep( ++ struct snd_soc_codec *codec) ++{ ++ msleep(2); ++ return snd_allo_boss_is_sclk(codec); ++} ++ ++static bool snd_allo_boss_is_master_card(struct snd_soc_codec *codec) ++{ ++ bool isClk44EN, isClk48En, isNoClk; ++ ++ snd_allo_boss_clk_gpio(codec); ++ ++ snd_allo_boss_select_clk(codec, ALLO_BOSS_CLK44EN); ++ isClk44EN = snd_allo_boss_is_sclk_sleep(codec); ++ ++ snd_allo_boss_select_clk(codec, ALLO_BOSS_NOCLOCK); ++ isNoClk = snd_allo_boss_is_sclk_sleep(codec); ++ ++ snd_allo_boss_select_clk(codec, ALLO_BOSS_CLK48EN); ++ isClk48En = snd_allo_boss_is_sclk_sleep(codec); ++ ++ return (isClk44EN && isClk48En && !isNoClk); ++} ++ ++static int snd_allo_boss_clk_for_rate(int sample_rate) ++{ ++ int type; ++ ++ switch (sample_rate) { ++ case 11025: ++ case 22050: ++ case 44100: ++ case 88200: ++ case 176400: ++ case 352800: ++ type = ALLO_BOSS_CLK44EN; ++ break; ++ default: ++ type = ALLO_BOSS_CLK48EN; ++ break; ++ } ++ return type; ++} ++ ++static void snd_allo_boss_set_sclk(struct snd_soc_codec *codec, ++ int sample_rate) ++{ ++ struct pcm512x_priv *pcm512x = snd_soc_codec_get_drvdata(codec); ++ ++ if (!IS_ERR(pcm512x->sclk)) { ++ int ctype; ++ ++ ctype = snd_allo_boss_clk_for_rate(sample_rate); ++ clk_set_rate(pcm512x->sclk, (ctype == ALLO_BOSS_CLK44EN) ++ ? CLK_44EN_RATE : CLK_48EN_RATE); ++ snd_allo_boss_select_clk(codec, ctype); ++ } ++} ++ ++static int snd_allo_boss_init(struct snd_soc_pcm_runtime *rtd) ++{ ++ struct snd_soc_codec *codec = rtd->codec; ++ struct pcm512x_priv *priv = snd_soc_codec_get_drvdata(codec); ++ ++ if (slave) ++ snd_soc_allo_boss_master = false; ++ else ++ snd_soc_allo_boss_master = ++ snd_allo_boss_is_master_card(codec); ++ ++ if (snd_soc_allo_boss_master) { ++ struct snd_soc_dai_link *dai = rtd->dai_link; ++ ++ dai->name = "BossDAC"; ++ dai->stream_name = "Boss DAC HiFi [Master]"; ++ dai->dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF ++ | SND_SOC_DAIFMT_CBM_CFM; ++ ++ snd_soc_update_bits(codec, PCM512x_BCLK_LRCLK_CFG, 0x31, 0x11); ++ snd_soc_update_bits(codec, PCM512x_MASTER_MODE, 0x03, 0x03); ++ snd_soc_update_bits(codec, PCM512x_MASTER_CLKDIV_2, 0x7f, 63); ++ /* ++ * Default sclk to CLK_48EN_RATE, otherwise codec ++ * pcm512x_dai_startup_master method could call ++ * snd_pcm_hw_constraint_ratnums using CLK_44EN/64 ++ * which will mask 384k sample rate. ++ */ ++ if (!IS_ERR(priv->sclk)) ++ clk_set_rate(priv->sclk, CLK_48EN_RATE); ++ } else { ++ priv->sclk = ERR_PTR(-ENOENT); ++ } ++ ++ snd_soc_update_bits(codec, PCM512x_GPIO_EN, 0x08, 0x08); ++ snd_soc_update_bits(codec, PCM512x_GPIO_OUTPUT_4, 0x0f, 0x02); ++ snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08, 0x08); ++ ++ if (digital_gain_0db_limit) { ++ int ret; ++ struct snd_soc_card *card = rtd->card; ++ ++ ret = snd_soc_limit_volume(card, "Digital Playback Volume", ++ 207); ++ if (ret < 0) ++ dev_warn(card->dev, "Failed to set volume limit: %d\n", ++ ret); ++ } ++ ++ return 0; ++} ++ ++static int snd_allo_boss_update_rate_den( ++ struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_codec *codec = rtd->codec; ++ struct pcm512x_priv *pcm512x = snd_soc_codec_get_drvdata(codec); ++ struct snd_ratnum *rats_no_pll; ++ unsigned int num = 0, den = 0; ++ int err; ++ ++ rats_no_pll = devm_kzalloc(rtd->dev, sizeof(*rats_no_pll), GFP_KERNEL); ++ if (!rats_no_pll) ++ return -ENOMEM; ++ ++ rats_no_pll->num = clk_get_rate(pcm512x->sclk) / 64; ++ rats_no_pll->den_min = 1; ++ rats_no_pll->den_max = 128; ++ rats_no_pll->den_step = 1; ++ ++ err = snd_interval_ratnum(hw_param_interval(params, ++ SNDRV_PCM_HW_PARAM_RATE), 1, rats_no_pll, &num, &den); ++ if (err >= 0 && den) { ++ params->rate_num = num; ++ params->rate_den = den; ++ } ++ ++ devm_kfree(rtd->dev, rats_no_pll); ++ return 0; ++} ++ ++static int snd_allo_boss_set_bclk_ratio_pro( ++ struct snd_soc_dai *cpu_dai, struct snd_pcm_hw_params *params) ++{ ++ int bratio = snd_pcm_format_physical_width(params_format(params)) ++ * params_channels(params); ++ return snd_soc_dai_set_bclk_ratio(cpu_dai, bratio); ++} ++ ++static void snd_allo_boss_gpio_mute(struct snd_soc_card *card) ++{ ++ if (mute_gpio) ++ gpiod_set_value_cansleep(mute_gpio, 1); ++} ++ ++static void snd_allo_boss_gpio_unmute(struct snd_soc_card *card) ++{ ++ if (mute_gpio) ++ gpiod_set_value_cansleep(mute_gpio, 0); ++} ++ ++static int snd_allo_boss_set_bias_level(struct snd_soc_card *card, ++ struct snd_soc_dapm_context *dapm, enum snd_soc_bias_level level) ++{ ++ struct snd_soc_pcm_runtime *rtd; ++ struct snd_soc_dai *codec_dai; ++ ++ rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); ++ codec_dai = rtd->codec_dai; ++ ++ if (dapm->dev != codec_dai->dev) ++ return 0; ++ ++ switch (level) { ++ case SND_SOC_BIAS_PREPARE: ++ if (dapm->bias_level != SND_SOC_BIAS_STANDBY) ++ break; ++ /* UNMUTE DAC */ ++ snd_allo_boss_gpio_unmute(card); ++ break; ++ ++ case SND_SOC_BIAS_STANDBY: ++ if (dapm->bias_level != SND_SOC_BIAS_PREPARE) ++ break; ++ /* MUTE DAC */ ++ snd_allo_boss_gpio_mute(card); ++ break; ++ ++ default: ++ break; ++ } ++ ++ return 0; ++} ++ ++static int snd_allo_boss_hw_params( ++ struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) ++{ ++ int ret = 0; ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_dai *cpu_dai = rtd->cpu_dai; ++ unsigned int sample_bits = ++ snd_pcm_format_physical_width(params_format(params)); ++ ++ if (snd_soc_allo_boss_master) { ++ struct snd_soc_codec *codec = rtd->codec; ++ ++ snd_allo_boss_set_sclk(codec, ++ params_rate(params)); ++ ++ ret = snd_allo_boss_set_bclk_ratio_pro(cpu_dai, ++ params); ++ if (!ret) ++ ret = snd_allo_boss_update_rate_den( ++ substream, params); ++ } else { ++ ret = snd_soc_dai_set_bclk_ratio(cpu_dai, sample_bits * 2); ++ } ++ return ret; ++} ++ ++static int snd_allo_boss_startup( ++ struct snd_pcm_substream *substream) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_codec *codec = rtd->codec; ++ struct snd_soc_card *card = rtd->card; ++ ++ snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08, 0x08); ++ snd_allo_boss_gpio_mute(card); ++ ++ if (snd_soc_allo_boss_master) { ++ struct pcm512x_priv *priv = snd_soc_codec_get_drvdata(codec); ++ /* ++ * Default sclk to CLK_48EN_RATE, otherwise codec ++ * pcm512x_dai_startup_master method could call ++ * snd_pcm_hw_constraint_ratnums using CLK_44EN/64 ++ * which will mask 384k sample rate. ++ */ ++ if (!IS_ERR(priv->sclk)) ++ clk_set_rate(priv->sclk, CLK_48EN_RATE); ++ } ++ ++ return 0; ++} ++ ++static void snd_allo_boss_shutdown( ++ struct snd_pcm_substream *substream) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_codec *codec = rtd->codec; ++ ++ snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08, 0x00); ++} ++ ++static int snd_allo_boss_prepare( ++ struct snd_pcm_substream *substream) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_card *card = rtd->card; ++ ++ snd_allo_boss_gpio_unmute(card); ++ return 0; ++} ++/* machine stream operations */ ++static struct snd_soc_ops snd_allo_boss_ops = { ++ .hw_params = snd_allo_boss_hw_params, ++ .startup = snd_allo_boss_startup, ++ .shutdown = snd_allo_boss_shutdown, ++ .prepare = snd_allo_boss_prepare, ++}; ++ ++static struct snd_soc_dai_link snd_allo_boss_dai[] = { ++{ ++ .name = "Boss DAC", ++ .stream_name = "Boss DAC HiFi", ++ .cpu_dai_name = "bcm2708-i2s.0", ++ .codec_dai_name = "pcm512x-hifi", ++ .platform_name = "bcm2708-i2s.0", ++ .codec_name = "pcm512x.1-004d", ++ .dai_fmt = SND_SOC_DAIFMT_I2S | ++ SND_SOC_DAIFMT_NB_NF | ++ SND_SOC_DAIFMT_CBS_CFS, ++ .ops = &snd_allo_boss_ops, ++ .init = snd_allo_boss_init, ++}, ++}; ++ ++/* audio machine driver */ ++static struct snd_soc_card snd_allo_boss = { ++ .name = "BossDAC", ++ .owner = THIS_MODULE, ++ .dai_link = snd_allo_boss_dai, ++ .num_links = ARRAY_SIZE(snd_allo_boss_dai), ++}; ++ ++static int snd_allo_boss_probe(struct platform_device *pdev) ++{ ++ int ret = 0; ++ ++ snd_allo_boss.dev = &pdev->dev; ++ ++ if (pdev->dev.of_node) { ++ struct device_node *i2s_node; ++ struct snd_soc_dai_link *dai; ++ ++ dai = &snd_allo_boss_dai[0]; ++ i2s_node = of_parse_phandle(pdev->dev.of_node, ++ "i2s-controller", 0); ++ ++ if (i2s_node) { ++ dai->cpu_dai_name = NULL; ++ dai->cpu_of_node = i2s_node; ++ dai->platform_name = NULL; ++ dai->platform_of_node = i2s_node; ++ } ++ ++ digital_gain_0db_limit = !of_property_read_bool( ++ pdev->dev.of_node, "allo,24db_digital_gain"); ++ slave = of_property_read_bool(pdev->dev.of_node, ++ "allo,slave"); ++ ++ mute_gpio = devm_gpiod_get_optional(&pdev->dev, "mute", ++ GPIOD_OUT_LOW); ++ if (IS_ERR(mute_gpio)) { ++ ret = PTR_ERR(mute_gpio); ++ dev_err(&pdev->dev, ++ "failed to get mute gpio: %d\n", ret); ++ return ret; ++ } ++ ++ if (mute_gpio) ++ snd_allo_boss.set_bias_level = ++ snd_allo_boss_set_bias_level; ++ ++ ret = snd_soc_register_card(&snd_allo_boss); ++ if (ret) { ++ dev_err(&pdev->dev, ++ "snd_soc_register_card() failed: %d\n", ret); ++ return ret; ++ } ++ ++ if (mute_gpio) ++ snd_allo_boss_gpio_mute(&snd_allo_boss); ++ ++ return 0; ++ } ++ ++ return -EINVAL; ++} ++ ++static int snd_allo_boss_remove(struct platform_device *pdev) ++{ ++ snd_allo_boss_gpio_mute(&snd_allo_boss); ++ return snd_soc_unregister_card(&snd_allo_boss); ++} ++ ++static const struct of_device_id snd_allo_boss_of_match[] = { ++ { .compatible = "allo,boss-dac", }, ++ { /* sentinel */ }, ++}; ++MODULE_DEVICE_TABLE(of, snd_allo_boss_of_match); ++ ++static struct platform_driver snd_allo_boss_driver = { ++ .driver = { ++ .name = "snd-allo-boss-dac", ++ .owner = THIS_MODULE, ++ .of_match_table = snd_allo_boss_of_match, ++ }, ++ .probe = snd_allo_boss_probe, ++ .remove = snd_allo_boss_remove, ++}; ++ ++module_platform_driver(snd_allo_boss_driver); ++ ++MODULE_AUTHOR("Baswaraj K "); ++MODULE_DESCRIPTION("ALSA ASoC Machine Driver for Allo Boss DAC"); ++MODULE_LICENSE("GPL v2"); + +From 8715359a928fd3b967c634e686bba50f9ff16574 Mon Sep 17 00:00:00 2001 From: gtrainavicius Date: Sun, 23 Oct 2016 12:06:53 +0300 -Subject: [PATCH 083/201] Support for Blokas Labs pisound board +Subject: [PATCH 084/134] Support for Blokas Labs pisound board Pisound dynamic overlay (#1760) @@ -102784,7 +104516,7 @@ Signed-off-by: Giedrius Trainavicius create mode 100644 sound/soc/bcm/pisound.c diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt -index ec0bfb9bbebd42c828a3b4978db070924275f609..6b6b0b13c361b9cd0df0a9aea86366bd92c520cf 100644 +index c03d201403661926164f1f9ba45ecd381a77b544..e17541b32ddb3b4a8e8a9d9479ecf5616bea8ce4 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt @@ -44,6 +44,7 @@ avia avia semiconductor @@ -102796,13 +104528,13 @@ index ec0bfb9bbebd42c828a3b4978db070924275f609..6b6b0b13c361b9cd0df0a9aea86366bd bosch Bosch Sensortec GmbH boundary Boundary Devices Inc. diff --git a/sound/soc/bcm/Kconfig b/sound/soc/bcm/Kconfig -index b600cfb98ac9baa21b3c6f09eff05149f14fda0a..ff4284a0000fd8dc58deb9e50be1422fd7ad6e65 100644 +index 4b8dde3c41f240eff4ec1d687b8229051126cec8..30fa76fe4ac3360d3d5454e64ad2ac6f12e171c4 100644 --- a/sound/soc/bcm/Kconfig +++ b/sound/soc/bcm/Kconfig -@@ -131,3 +131,9 @@ config SND_BCM2708_SOC_ALLO_PIANO_DAC +@@ -145,3 +145,9 @@ config SND_BCM2708_SOC_ALLO_BOSS_DAC select SND_SOC_PCM512x_I2C help - Say Y or M if you want to add support for Allo Piano DAC. + Say Y or M if you want to add support for Allo Boss DAC. + +config SND_PISOUND + tristate "Support for Blokas Labs pisound" @@ -102810,21 +104542,21 @@ index b600cfb98ac9baa21b3c6f09eff05149f14fda0a..ff4284a0000fd8dc58deb9e50be1422f + help + Say Y or M if you want to add support for Blokas Labs pisound. diff --git a/sound/soc/bcm/Makefile b/sound/soc/bcm/Makefile -index 64f007f8ba38276a42e0bd8db92544db9412544b..bb1df438540193652ec5464e8bc51f636a1b844e 100644 +index 58ad41f041ed8ed5c0b4c71efb324d9d163252d7..c74544f30f4138e884d4fbbf3226fb79b20d1d16 100644 --- a/sound/soc/bcm/Makefile +++ b/sound/soc/bcm/Makefile -@@ -25,6 +25,7 @@ snd-soc-audioinjector-pi-soundcard-objs := audioinjector-pi-soundcard.o - snd-soc-digidac1-soundcard-objs := digidac1-soundcard.o - snd-soc-dionaudio-loco-objs := dionaudio_loco.o +@@ -27,6 +27,7 @@ snd-soc-dionaudio-loco-objs := dionaudio_loco.o + snd-soc-allo-boss-dac-objs := allo-boss-dac.o snd-soc-allo-piano-dac-objs := allo-piano-dac.o + snd-soc-allo-piano-dac-plus-objs := allo-piano-dac-plus.o +snd-soc-pisound-objs := pisound.o obj-$(CONFIG_SND_BCM2708_SOC_ADAU1977_ADC) += snd-soc-adau1977-adc.o obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_AMP) += snd-soc-hifiberry-amp.o -@@ -42,3 +43,4 @@ obj-$(CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD) += snd-soc-audioinjector-pi-soundca - obj-$(CONFIG_SND_DIGIDAC1_SOUNDCARD) += snd-soc-digidac1-soundcard.o - obj-$(CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO) += snd-soc-dionaudio-loco.o +@@ -46,3 +47,4 @@ obj-$(CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO) += snd-soc-dionaudio-loco.o + obj-$(CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC) += snd-soc-allo-boss-dac.o obj-$(CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC) += snd-soc-allo-piano-dac.o + obj-$(CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS) += snd-soc-allo-piano-dac-plus.o +obj-$(CONFIG_SND_PISOUND) += snd-soc-pisound.o diff --git a/sound/soc/bcm/pisound.c b/sound/soc/bcm/pisound.c new file mode 100644 @@ -103956,10 +105688,10 @@ index 0000000000000000000000000000000000000000..06ff1e53dc9d860946965b6303577762 +MODULE_DESCRIPTION("ASoC Driver for pisound, http://blokas.io/pisound"); +MODULE_LICENSE("GPL v2"); -From 48e2acd35ff6b7cae244cca5d046a4e44f30589e Mon Sep 17 00:00:00 2001 +From 47e32b4fb6e969d6dfb54ae28f744000311fe1cf Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Sun, 22 Jan 2017 12:49:37 +0100 -Subject: [PATCH 084/201] ASoC: Add driver for Cirrus Logic Audio Card +Subject: [PATCH 085/134] 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 @@ -103975,7 +105707,7 @@ Signed-off-by: Matthias Reichl create mode 100644 sound/soc/bcm/rpi-cirrus.c diff --git a/sound/soc/bcm/Kconfig b/sound/soc/bcm/Kconfig -index ff4284a0000fd8dc58deb9e50be1422fd7ad6e65..c0489e591b9b8c8da004ca9e300e97f1a21e5ce1 100644 +index 30fa76fe4ac3360d3d5454e64ad2ac6f12e171c4..509cb0bfe9c8f6d94a9032e9dd5a9dc8e9a716dd 100644 --- a/sound/soc/bcm/Kconfig +++ b/sound/soc/bcm/Kconfig @@ -46,6 +46,15 @@ config SND_BCM2708_SOC_HIFIBERRY_AMP @@ -103995,7 +105727,7 @@ index ff4284a0000fd8dc58deb9e50be1422fd7ad6e65..c0489e591b9b8c8da004ca9e300e97f1 tristate "Support for RPi-DAC" depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S diff --git a/sound/soc/bcm/Makefile b/sound/soc/bcm/Makefile -index bb1df438540193652ec5464e8bc51f636a1b844e..84c2b20ce2e51b525797ee58de95734ee7847e15 100644 +index c74544f30f4138e884d4fbbf3226fb79b20d1d16..bdf53ac939371fb2d087563b084f8a12d10ebd46 100644 --- a/sound/soc/bcm/Makefile +++ b/sound/soc/bcm/Makefile @@ -16,6 +16,7 @@ snd-soc-hifiberry-dacplus-objs := hifiberry_dacplus.o @@ -104006,7 +105738,7 @@ index bb1df438540193652ec5464e8bc51f636a1b844e..84c2b20ce2e51b525797ee58de95734e snd-soc-rpi-dac-objs := rpi-dac.o snd-soc-rpi-proto-objs := rpi-proto.o snd-soc-iqaudio-dac-objs := iqaudio-dac.o -@@ -34,6 +35,7 @@ obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DACPLUS) += snd-soc-hifiberry-dacplus.o +@@ -36,6 +37,7 @@ obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DACPLUS) += snd-soc-hifiberry-dacplus.o obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DIGI) += snd-soc-hifiberry-digi.o obj-$(CONFIG_SND_BCM2708_SOC_JUSTBOOM_DAC) += snd-soc-justboom-dac.o obj-$(CONFIG_SND_BCM2708_SOC_JUSTBOOM_DIGI) += snd-soc-justboom-digi.o @@ -105024,10 +106756,10 @@ index 0000000000000000000000000000000000000000..ac8651ddff7bd3701dffe22c7fb88352 +MODULE_DESCRIPTION("ASoC driver for Cirrus Logic Audio Card"); +MODULE_LICENSE("GPL"); -From daaa344585fab5ac9637e3d5dadb9e9ddce84df5 Mon Sep 17 00:00:00 2001 +From 4e143b19b087a6dd8003b0c1b459d88e19d1cfc6 Mon Sep 17 00:00:00 2001 From: Miquel Date: Fri, 24 Feb 2017 20:51:06 +0100 -Subject: [PATCH 085/201] sound: Support for Dion Audio LOCO-V2 DAC-AMP HAT +Subject: [PATCH 086/134] sound: Support for Dion Audio LOCO-V2 DAC-AMP HAT Signed-off-by: Miquel Blauw --- @@ -105038,7 +106770,7 @@ Signed-off-by: Miquel Blauw create mode 100644 sound/soc/bcm/dionaudio_loco-v2.c diff --git a/sound/soc/bcm/Kconfig b/sound/soc/bcm/Kconfig -index c0489e591b9b8c8da004ca9e300e97f1a21e5ce1..3e1ee13ef8ec31849e29e551026ba427f8e44fe6 100644 +index 509cb0bfe9c8f6d94a9032e9dd5a9dc8e9a716dd..100a5f7ce17d734b7bd3eb0da161304b3440fe93 100644 --- a/sound/soc/bcm/Kconfig +++ b/sound/soc/bcm/Kconfig @@ -134,6 +134,13 @@ config SND_BCM2708_SOC_DIONAUDIO_LOCO @@ -105056,7 +106788,7 @@ index c0489e591b9b8c8da004ca9e300e97f1a21e5ce1..3e1ee13ef8ec31849e29e551026ba427 tristate "Support for Allo Piano DAC" depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S diff --git a/sound/soc/bcm/Makefile b/sound/soc/bcm/Makefile -index 84c2b20ce2e51b525797ee58de95734ee7847e15..4d8adf691021a974310589e92e599924811f22cb 100644 +index bdf53ac939371fb2d087563b084f8a12d10ebd46..f0a84c92b071ea3842504e26884b0d2d4285590d 100644 --- a/sound/soc/bcm/Makefile +++ b/sound/soc/bcm/Makefile @@ -25,6 +25,7 @@ snd-soc-raspidac3-objs := raspidac3.o @@ -105064,16 +106796,17 @@ index 84c2b20ce2e51b525797ee58de95734ee7847e15..4d8adf691021a974310589e92e599924 snd-soc-digidac1-soundcard-objs := digidac1-soundcard.o snd-soc-dionaudio-loco-objs := dionaudio_loco.o +snd-soc-dionaudio-loco-v2-objs := dionaudio_loco-v2.o + snd-soc-allo-boss-dac-objs := allo-boss-dac.o snd-soc-allo-piano-dac-objs := allo-piano-dac.o - snd-soc-pisound-objs := pisound.o - -@@ -44,5 +45,6 @@ obj-$(CONFIG_SND_BCM2708_SOC_RASPIDAC3) += snd-soc-raspidac3.o + snd-soc-allo-piano-dac-plus-objs := allo-piano-dac-plus.o +@@ -46,6 +47,7 @@ obj-$(CONFIG_SND_BCM2708_SOC_RASPIDAC3) += snd-soc-raspidac3.o obj-$(CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD) += snd-soc-audioinjector-pi-soundcard.o obj-$(CONFIG_SND_DIGIDAC1_SOUNDCARD) += snd-soc-digidac1-soundcard.o obj-$(CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO) += snd-soc-dionaudio-loco.o +obj-$(CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO_V2) += snd-soc-dionaudio-loco-v2.o + obj-$(CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC) += snd-soc-allo-boss-dac.o obj-$(CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC) += snd-soc-allo-piano-dac.o - obj-$(CONFIG_SND_PISOUND) += snd-soc-pisound.o + obj-$(CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS) += snd-soc-allo-piano-dac-plus.o diff --git a/sound/soc/bcm/dionaudio_loco-v2.c b/sound/soc/bcm/dionaudio_loco-v2.c new file mode 100644 index 0000000000000000000000000000000000000000..a009c49477972a9832175d86f201b0357a08f7c0 @@ -105221,10 +106954,10 @@ index 0000000000000000000000000000000000000000..a009c49477972a9832175d86f201b035 +MODULE_DESCRIPTION("ASoC Driver for DionAudio LOCO-V2"); +MODULE_LICENSE("GPL v2"); -From 09c282a26774df25c7c56eea4ed641ba6c7f3287 Mon Sep 17 00:00:00 2001 +From e28ea5d3f4cc3a113e3990b50298986010d3df03 Mon Sep 17 00:00:00 2001 From: Fe-Pi Date: Wed, 1 Mar 2017 04:42:43 -0700 -Subject: [PATCH 086/201] Add support for Fe-Pi audio sound card. (#1867) +Subject: [PATCH 087/134] 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. @@ -105239,12 +106972,12 @@ Signed-off-by: Henry Kupis create mode 100644 sound/soc/bcm/fe-pi-audio.c diff --git a/sound/soc/bcm/Kconfig b/sound/soc/bcm/Kconfig -index 3e1ee13ef8ec31849e29e551026ba427f8e44fe6..7473efd6f400a1a1618aac830753fce39d203b89 100644 +index 100a5f7ce17d734b7bd3eb0da161304b3440fe93..05536bde8da42aea008d03d0d9d9581716d0a379 100644 --- a/sound/soc/bcm/Kconfig +++ b/sound/soc/bcm/Kconfig -@@ -148,6 +148,13 @@ config SND_BCM2708_SOC_ALLO_PIANO_DAC +@@ -162,6 +162,13 @@ config SND_BCM2708_SOC_ALLO_BOSS_DAC help - Say Y or M if you want to add support for Allo Piano DAC. + Say Y or M if you want to add support for Allo Boss DAC. +config SND_BCM2708_SOC_FE_PI_AUDIO + tristate "Support for Fe-Pi-Audio" @@ -105257,20 +106990,20 @@ index 3e1ee13ef8ec31849e29e551026ba427f8e44fe6..7473efd6f400a1a1618aac830753fce3 tristate "Support for Blokas Labs pisound" depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S diff --git a/sound/soc/bcm/Makefile b/sound/soc/bcm/Makefile -index 4d8adf691021a974310589e92e599924811f22cb..8d2d2073dc2cede9fbd9eb8b49083650ba0a8172 100644 +index f0a84c92b071ea3842504e26884b0d2d4285590d..c3feaf198d997935fdf6815f9f8555d8704e53af 100644 --- a/sound/soc/bcm/Makefile +++ b/sound/soc/bcm/Makefile -@@ -28,6 +28,7 @@ snd-soc-dionaudio-loco-objs := dionaudio_loco.o - snd-soc-dionaudio-loco-v2-objs := dionaudio_loco-v2.o +@@ -30,6 +30,7 @@ snd-soc-allo-boss-dac-objs := allo-boss-dac.o snd-soc-allo-piano-dac-objs := allo-piano-dac.o + snd-soc-allo-piano-dac-plus-objs := allo-piano-dac-plus.o snd-soc-pisound-objs := pisound.o +snd-soc-fe-pi-audio-objs := fe-pi-audio.o obj-$(CONFIG_SND_BCM2708_SOC_ADAU1977_ADC) += snd-soc-adau1977-adc.o obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_AMP) += snd-soc-hifiberry-amp.o -@@ -48,3 +49,4 @@ obj-$(CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO) += snd-soc-dionaudio-loco.o - obj-$(CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO_V2) += snd-soc-dionaudio-loco-v2.o +@@ -52,3 +53,4 @@ obj-$(CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC) += snd-soc-allo-boss-dac.o obj-$(CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC) += snd-soc-allo-piano-dac.o + obj-$(CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS) += snd-soc-allo-piano-dac-plus.o obj-$(CONFIG_SND_PISOUND) += snd-soc-pisound.o +obj-$(CONFIG_SND_BCM2708_SOC_FE_PI_AUDIO) += snd-soc-fe-pi-audio.o diff --git a/sound/soc/bcm/fe-pi-audio.c b/sound/soc/bcm/fe-pi-audio.c @@ -105438,20 +107171,29 @@ index 0000000000000000000000000000000000000000..015b56fd73cc36be5b5eecd17548fd03 +MODULE_DESCRIPTION("ASoC Driver for Fe-Pi Audio"); +MODULE_LICENSE("GPL v2"); -From 66c226fc23ae688fcea64263faa235d206158062 Mon Sep 17 00:00:00 2001 +From ed01edad88a4b01a9ada97274887e4847cc87c81 Mon Sep 17 00:00:00 2001 From: Matt Flax Date: Wed, 8 Mar 2017 20:04:13 +1100 -Subject: [PATCH 087/201] Add support for the AudioInjector.net Octo sound card +Subject: [PATCH 088/134] Add support for the AudioInjector.net Octo sound card +AudioInjector Octo: sample rates, regulators, reset + +This patch adds new sample rates to the Audioinjector Octo sound card. The +new supported rates are (in kHz) : +96, 48, 32, 24, 16, 8, 88.2, 44.1, 29.4, 22.05, 14.7 + +Reference the bcm270x DT regulators in the overlay. + +This patch adds a reset GPIO for the AudioInjector.net octo sound card. --- sound/soc/bcm/Kconfig | 7 + sound/soc/bcm/Makefile | 2 + - sound/soc/bcm/audioinjector-octo-soundcard.c | 286 +++++++++++++++++++++++++++ - 3 files changed, 295 insertions(+) + sound/soc/bcm/audioinjector-octo-soundcard.c | 339 +++++++++++++++++++++++++++ + 3 files changed, 348 insertions(+) create mode 100644 sound/soc/bcm/audioinjector-octo-soundcard.c diff --git a/sound/soc/bcm/Kconfig b/sound/soc/bcm/Kconfig -index 7473efd6f400a1a1618aac830753fce39d203b89..706c500b5303ac3a0fd8687d23dc9f06c7d08388 100644 +index 05536bde8da42aea008d03d0d9d9581716d0a379..4741b3f3600dac29c4277eb3dbd528d28a837a40 100644 --- a/sound/soc/bcm/Kconfig +++ b/sound/soc/bcm/Kconfig @@ -119,6 +119,13 @@ config SND_AUDIOINJECTOR_PI_SOUNDCARD @@ -105469,7 +107211,7 @@ index 7473efd6f400a1a1618aac830753fce39d203b89..706c500b5303ac3a0fd8687d23dc9f06 tristate "Support for Red Rocks Audio DigiDAC1" depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S diff --git a/sound/soc/bcm/Makefile b/sound/soc/bcm/Makefile -index 8d2d2073dc2cede9fbd9eb8b49083650ba0a8172..d448aa517bf994fc0a41580c91b5d87deec9e1b0 100644 +index c3feaf198d997935fdf6815f9f8555d8704e53af..113b6899dd9fd6c4a6f706f57e32201de0188085 100644 --- a/sound/soc/bcm/Makefile +++ b/sound/soc/bcm/Makefile @@ -23,6 +23,7 @@ snd-soc-iqaudio-dac-objs := iqaudio-dac.o @@ -105480,7 +107222,7 @@ index 8d2d2073dc2cede9fbd9eb8b49083650ba0a8172..d448aa517bf994fc0a41580c91b5d87d snd-soc-digidac1-soundcard-objs := digidac1-soundcard.o snd-soc-dionaudio-loco-objs := dionaudio_loco.o snd-soc-dionaudio-loco-v2-objs := dionaudio_loco-v2.o -@@ -44,6 +45,7 @@ obj-$(CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC) += snd-soc-iqaudio-dac.o +@@ -46,6 +47,7 @@ obj-$(CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC) += snd-soc-iqaudio-dac.o obj-$(CONFIG_SND_BCM2708_SOC_IQAUDIO_DIGI) += snd-soc-iqaudio-digi.o obj-$(CONFIG_SND_BCM2708_SOC_RASPIDAC3) += snd-soc-raspidac3.o obj-$(CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD) += snd-soc-audioinjector-pi-soundcard.o @@ -105490,10 +107232,10 @@ index 8d2d2073dc2cede9fbd9eb8b49083650ba0a8172..d448aa517bf994fc0a41580c91b5d87d obj-$(CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO_V2) += snd-soc-dionaudio-loco-v2.o diff --git a/sound/soc/bcm/audioinjector-octo-soundcard.c b/sound/soc/bcm/audioinjector-octo-soundcard.c new file mode 100644 -index 0000000000000000000000000000000000000000..9effea725798640887755dfa688da45338718afc +index 0000000000000000000000000000000000000000..dcf403ab37639ba79e38278d7e4b1ade452c292a --- /dev/null +++ b/sound/soc/bcm/audioinjector-octo-soundcard.c -@@ -0,0 +1,286 @@ +@@ -0,0 +1,339 @@ +/* + * ASoC Driver for AudioInjector Pi octo channel soundcard (hat) + * @@ -105523,8 +107265,18 @@ index 0000000000000000000000000000000000000000..9effea725798640887755dfa688da453 +#include + +static struct gpio_descs *mult_gpios; ++static struct gpio_desc *codec_rst_gpio; +static unsigned int audioinjector_octo_rate; + ++static const unsigned int audioinjector_octo_rates[] = { ++ 96000, 48000, 32000, 24000, 16000, 8000, 88200, 44100, 29400, 22050, 14700, ++}; ++ ++static struct snd_pcm_hw_constraint_list audioinjector_octo_constraints = { ++ .list = audioinjector_octo_rates, ++ .count = ARRAY_SIZE(audioinjector_octo_rates), ++}; ++ +static int audioinjector_octo_dai_init(struct snd_soc_pcm_runtime *rtd) +{ + return snd_soc_dai_set_bclk_ratio(rtd->cpu_dai, 64); @@ -105538,6 +107290,11 @@ index 0000000000000000000000000000000000000000..9effea725798640887755dfa688da453 + rtd->cpu_dai->driver->capture.channels_min = 8; + rtd->cpu_dai->driver->capture.channels_max = 8; + rtd->codec_dai->driver->capture.channels_max = 8; ++ ++ snd_pcm_hw_constraint_list(substream->runtime, 0, ++ SNDRV_PCM_HW_PARAM_RATE, ++ &audioinjector_octo_constraints); ++ + return 0; +} + @@ -105572,7 +107329,43 @@ index 0000000000000000000000000000000000000000..9effea725798640887755dfa688da453 + + audioinjector_octo_rate = params_rate(params); + -+ return 0; ++ // Set the correct sysclock for the codec ++ switch (audioinjector_octo_rate) { ++ case 96000: ++ case 48000: ++ return snd_soc_dai_set_sysclk(rtd->codec_dai, 0, 49152000, ++ 0); ++ break; ++ case 24000: ++ return snd_soc_dai_set_sysclk(rtd->codec_dai, 0, 49152000/2, ++ 0); ++ break; ++ case 32000: ++ case 16000: ++ return snd_soc_dai_set_sysclk(rtd->codec_dai, 0, 49152000/3, ++ 0); ++ break; ++ case 8000: ++ return snd_soc_dai_set_sysclk(rtd->codec_dai, 0, 49152000/6, ++ 0); ++ break; ++ case 88200: ++ case 44100: ++ return snd_soc_dai_set_sysclk(rtd->codec_dai, 0, 45185400, ++ 0); ++ break; ++ case 22050: ++ return snd_soc_dai_set_sysclk(rtd->codec_dai, 0, 45185400/2, ++ 0); ++ break; ++ case 29400: ++ case 14700: ++ return snd_soc_dai_set_sysclk(rtd->codec_dai, 0, 45185400/3, ++ 0); ++ break; ++ default: ++ return -EINVAL; ++ } +} + +static int audioinjector_octo_trigger(struct snd_pcm_substream *substream, @@ -105588,25 +107381,12 @@ index 0000000000000000000000000000000000000000..9effea725798640887755dfa688da453 + case SNDRV_PCM_TRIGGER_RESUME: + case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: + switch (audioinjector_octo_rate) { -+ case 192000: -+ mult[3] = 1; -+ case 176640: -+ mult[0] = 1; -+ mult[1] = 1; -+ mult[2] = 1; -+ break; + case 96000: + mult[3] = 1; + case 88200: + mult[1] = 1; + mult[2] = 1; + break; -+ case 64000: -+ mult[3] = 1; -+ case 58800: -+ mult[0] = 1; -+ mult[2] = 1; -+ break; + case 48000: + mult[3] = 1; + case 44100: @@ -105727,6 +107507,21 @@ index 0000000000000000000000000000000000000000..9effea725798640887755dfa688da453 + if (IS_ERR(mult_gpios)) + return PTR_ERR(mult_gpios); + ++ codec_rst_gpio = devm_gpiod_get_optional(&pdev->dev, "reset", ++ GPIOD_OUT_LOW); ++ if (IS_ERR(codec_rst_gpio)) ++ return PTR_ERR(codec_rst_gpio); ++ ++ if (codec_rst_gpio) ++ gpiod_set_value(codec_rst_gpio, 1); ++ msleep(500); ++ if (codec_rst_gpio) ++ gpiod_set_value(codec_rst_gpio, 0); ++ msleep(500); ++ if (codec_rst_gpio) ++ gpiod_set_value(codec_rst_gpio, 1); ++ msleep(500); ++ + if (i2s_node && codec_node) { + dai->cpu_dai_name = NULL; + dai->cpu_of_node = i2s_node; @@ -105781,10 +107576,404 @@ index 0000000000000000000000000000000000000000..9effea725798640887755dfa688da453 +MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:audioinjector-octo-soundcard"); -From d5979bd792e90bbbc9e1eb4d9e26360e6e422d05 Mon Sep 17 00:00:00 2001 +From 3512ab8694fcf335c62cf0535fa972691579a8ce Mon Sep 17 00:00:00 2001 +From: Peter Malkin +Date: Mon, 27 Mar 2017 16:38:21 -0700 +Subject: [PATCH 089/134] Driver support for Google voiceHAT soundcard. + +--- + sound/soc/bcm/Kconfig | 7 ++ + sound/soc/bcm/Makefile | 6 + + sound/soc/bcm/googlevoicehat-codec.c | 199 +++++++++++++++++++++++++++++++ + sound/soc/bcm/googlevoicehat-soundcard.c | 124 +++++++++++++++++++ + 4 files changed, 336 insertions(+) + create mode 100644 sound/soc/bcm/googlevoicehat-codec.c + create mode 100644 sound/soc/bcm/googlevoicehat-soundcard.c + +diff --git a/sound/soc/bcm/Kconfig b/sound/soc/bcm/Kconfig +index 4741b3f3600dac29c4277eb3dbd528d28a837a40..355bdeb25f81d15593f78df0e87a48404908ca4b 100644 +--- a/sound/soc/bcm/Kconfig ++++ b/sound/soc/bcm/Kconfig +@@ -18,6 +18,13 @@ config SND_SOC_CYGNUS + + If you don't know what to do here, say N. + ++config SND_BCM2708_SOC_GOOGLEVOICEHAT_SOUNDCARD ++ tristate "Support for Google voiceHAT soundcard" ++ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S ++ select SND_SOC_VOICEHAT ++ help ++ Say Y or M if you want to add support for voiceHAT soundcard. ++ + config SND_BCM2708_SOC_HIFIBERRY_DAC + tristate "Support for HifiBerry DAC" + depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S +diff --git a/sound/soc/bcm/Makefile b/sound/soc/bcm/Makefile +index 113b6899dd9fd6c4a6f706f57e32201de0188085..72e1620fa4038035804cf3b2a09c6b12e7ae0fe1 100644 +--- a/sound/soc/bcm/Makefile ++++ b/sound/soc/bcm/Makefile +@@ -8,8 +8,12 @@ snd-soc-cygnus-objs := cygnus-pcm.o cygnus-ssp.o + + obj-$(CONFIG_SND_SOC_CYGNUS) += snd-soc-cygnus.o + ++# Google voiceHAT custom codec support ++snd-soc-googlevoicehat-codec-objs := googlevoicehat-codec.o ++ + # BCM2708 Machine Support + snd-soc-adau1977-adc-objs := adau1977-adc.o ++snd-soc-googlevoicehat-soundcard-objs := googlevoicehat-soundcard.o + snd-soc-hifiberry-amp-objs := hifiberry_amp.o + snd-soc-hifiberry-dac-objs := hifiberry_dac.o + snd-soc-hifiberry-dacplus-objs := hifiberry_dacplus.o +@@ -34,6 +38,8 @@ snd-soc-pisound-objs := pisound.o + snd-soc-fe-pi-audio-objs := fe-pi-audio.o + + obj-$(CONFIG_SND_BCM2708_SOC_ADAU1977_ADC) += snd-soc-adau1977-adc.o ++obj-$(CONFIG_SND_BCM2708_SOC_GOOGLEVOICEHAT_SOUNDCARD) += snd-soc-googlevoicehat-soundcard.o ++obj-$(CONFIG_SND_BCM2708_SOC_GOOGLEVOICEHAT_SOUNDCARD) += snd-soc-googlevoicehat-codec.o + obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_AMP) += snd-soc-hifiberry-amp.o + obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DAC) += snd-soc-hifiberry-dac.o + obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DACPLUS) += snd-soc-hifiberry-dacplus.o +diff --git a/sound/soc/bcm/googlevoicehat-codec.c b/sound/soc/bcm/googlevoicehat-codec.c +new file mode 100644 +index 0000000000000000000000000000000000000000..7e31c9c54652cd9bd050028efb82dfc09fd9fced +--- /dev/null ++++ b/sound/soc/bcm/googlevoicehat-codec.c +@@ -0,0 +1,199 @@ ++/* ++ * Driver for the Google voiceHAT audio codec for Raspberry Pi. ++ * ++ * Author: Peter Malkin ++ * Copyright 2016 ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * version 2 as published by the Free Software Foundation. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define ICS43432_RATE_MIN_HZ 7190 /* from data sheet */ ++#define ICS43432_RATE_MAX_HZ 52800 /* from data sheet */ ++#define SDMODE_DELAY_MS \ ++ 5 /* Delay in enabling SDMODE after clock settles to remove pop */ ++ ++struct voicehat_priv { ++ struct delayed_work enable_sdmode_work; ++ struct gpio_desc *sdmode_gpio; ++ unsigned int sdmode_delay; ++}; ++ ++static void voicehat_enable_sdmode_work(struct work_struct *work) { ++ struct voicehat_priv *voicehat = ++ container_of(work, struct voicehat_priv, enable_sdmode_work.work); ++ gpiod_set_value(voicehat->sdmode_gpio, 1); ++} ++ ++static int voicehat_codec_probe(struct snd_soc_codec *codec) { ++ struct voicehat_priv *voicehat = snd_soc_codec_get_drvdata(codec); ++ ++ voicehat->sdmode_gpio = devm_gpiod_get(codec->dev, "sdmode", GPIOD_OUT_LOW); ++ if (IS_ERR(voicehat->sdmode_gpio)) { ++ dev_err(codec->dev, "Unable to allocate GPIO pin\n"); ++ return PTR_ERR(voicehat->sdmode_gpio); ++ } ++ ++ INIT_DELAYED_WORK(&voicehat->enable_sdmode_work, voicehat_enable_sdmode_work); ++ return 0; ++} ++ ++static int voicehat_codec_remove(struct snd_soc_codec *codec) { ++ struct voicehat_priv *voicehat = snd_soc_codec_get_drvdata(codec); ++ ++ cancel_delayed_work_sync(&voicehat->enable_sdmode_work); ++ ++ return 0; ++} ++ ++static const struct snd_soc_dapm_widget voicehat_dapm_widgets[] = { ++ SND_SOC_DAPM_OUTPUT("Speaker"), ++}; ++ ++static const struct snd_soc_dapm_route voicehat_dapm_routes[] = { ++ {"Speaker", NULL, "HiFi Playback"}, ++}; ++ ++static struct snd_soc_codec_driver voicehat_codec_driver = { ++ .probe = voicehat_codec_probe, ++ .remove = voicehat_codec_remove, ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0) ++ .component_driver = { ++#endif ++ .dapm_widgets = voicehat_dapm_widgets, ++ .num_dapm_widgets = ARRAY_SIZE(voicehat_dapm_widgets), ++ .dapm_routes = voicehat_dapm_routes, ++ .num_dapm_routes = ARRAY_SIZE(voicehat_dapm_routes), ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0) ++ }, ++#endif ++}; ++ ++static int voicehat_daiops_trigger(struct snd_pcm_substream *substream, int cmd, ++ struct snd_soc_dai *dai) { ++ struct snd_soc_codec *codec = dai->codec; ++ struct voicehat_priv *voicehat = snd_soc_codec_get_drvdata(codec); ++ ++ if (voicehat->sdmode_delay == 0) return 0; ++ ++ dev_dbg(dai->dev, "CMD %d", cmd); ++ dev_dbg(dai->dev, "Playback Active %d", dai->playback_active); ++ dev_dbg(dai->dev, "Capture Active %d", dai->capture_active); ++ ++ switch (cmd) { ++ case SNDRV_PCM_TRIGGER_START: ++ case SNDRV_PCM_TRIGGER_RESUME: ++ case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: ++ if (dai->playback_active) { ++ dev_info(dai->dev, "Enabling audio amp...\n"); ++ queue_delayed_work(system_power_efficient_wq, ++ &voicehat->enable_sdmode_work, ++ msecs_to_jiffies(voicehat->sdmode_delay)); ++ } ++ break; ++ case SNDRV_PCM_TRIGGER_STOP: ++ case SNDRV_PCM_TRIGGER_SUSPEND: ++ case SNDRV_PCM_TRIGGER_PAUSE_PUSH: ++ if (dai->playback_active) { ++ cancel_delayed_work(&voicehat->enable_sdmode_work); ++ dev_info(dai->dev, "Disabling audio amp...\n"); ++ gpiod_set_value(voicehat->sdmode_gpio, 0); ++ } ++ break; ++ } ++ return 0; ++} ++ ++static const struct snd_soc_dai_ops voicehat_dai_ops = { ++ .trigger = voicehat_daiops_trigger, ++}; ++ ++static struct snd_soc_dai_driver voicehat_dai = { ++ .name = "voicehat-hifi", ++ .capture = {.stream_name = "HiFi Capture", ++ .channels_min = 2, ++ .channels_max = 2, ++ .rates = SNDRV_PCM_RATE_48000, ++ .formats = SNDRV_PCM_FMTBIT_S32_LE}, ++ .playback = {.stream_name = "HiFi Playback", ++ .channels_min = 2, ++ .channels_max = 2, ++ .rates = SNDRV_PCM_RATE_48000, ++ .formats = SNDRV_PCM_FMTBIT_S32_LE}, ++ .ops = &voicehat_dai_ops, ++ .symmetric_rates = 1}; ++ ++#ifdef CONFIG_OF ++static const struct of_device_id voicehat_ids[] = { ++ { ++ .compatible = "google,voicehat", ++ }, ++ {}}; ++MODULE_DEVICE_TABLE(of, voicehat_ids); ++#endif ++ ++static int voicehat_platform_probe(struct platform_device *pdev) { ++ struct voicehat_priv *voicehat; ++ int ret; ++ ++ voicehat = devm_kzalloc(&pdev->dev, sizeof(*voicehat), GFP_KERNEL); ++ if (!voicehat) return -ENOMEM; ++ ++ ret = device_property_read_u32(&pdev->dev, "voicehat_sdmode_delay", ++ &voicehat->sdmode_delay); ++ ++ if (ret) { ++ voicehat->sdmode_delay = SDMODE_DELAY_MS; ++ dev_info(&pdev->dev, ++ "property 'voicehat_sdmode_delay' not found default 5 mS"); ++ } else { ++ dev_info(&pdev->dev, "property 'voicehat_sdmode_delay' found delay= %d mS", ++ voicehat->sdmode_delay); ++ } ++ ++ dev_set_drvdata(&pdev->dev, voicehat); ++ ++ return snd_soc_register_codec(&pdev->dev, &voicehat_codec_driver, &voicehat_dai, 1); ++} ++ ++static int voicehat_platform_remove(struct platform_device *pdev) { ++ snd_soc_unregister_codec(&pdev->dev); ++ return 0; ++} ++ ++static struct platform_driver voicehat_driver = { ++ .driver = ++ { ++ .name = "voicehat-codec", .of_match_table = of_match_ptr(voicehat_ids), ++ }, ++ .probe = voicehat_platform_probe, ++ .remove = voicehat_platform_remove, ++}; ++ ++module_platform_driver(voicehat_driver); ++ ++MODULE_DESCRIPTION("Google voiceHAT Codec driver"); ++MODULE_AUTHOR("Peter Malkin "); ++MODULE_LICENSE("GPL v2"); +diff --git a/sound/soc/bcm/googlevoicehat-soundcard.c b/sound/soc/bcm/googlevoicehat-soundcard.c +new file mode 100644 +index 0000000000000000000000000000000000000000..225854b8e5298b3c3018f59a49404354a831a24e +--- /dev/null ++++ b/sound/soc/bcm/googlevoicehat-soundcard.c +@@ -0,0 +1,124 @@ ++/* ++ * ASoC Driver for Google voiceHAT SoundCard ++ * ++ * Author: Peter Malkin ++ * Copyright 2016 ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * version 2 as published by the Free Software Foundation. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ */ ++ ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++ ++static int snd_rpi_googlevoicehat_soundcard_init(struct snd_soc_pcm_runtime *rtd) ++{ ++ return 0; ++} ++ ++static int snd_rpi_googlevoicehat_soundcard_hw_params( ++ struct snd_pcm_substream *substream, ++ struct snd_pcm_hw_params *params) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_dai *cpu_dai = rtd->cpu_dai; ++ ++ unsigned int sample_bits = ++ snd_pcm_format_physical_width(params_format(params)); ++ ++ return snd_soc_dai_set_bclk_ratio(cpu_dai, sample_bits * 2); ++} ++ ++/* machine stream operations */ ++static struct snd_soc_ops snd_rpi_googlevoicehat_soundcard_ops = { ++ .hw_params = snd_rpi_googlevoicehat_soundcard_hw_params, ++}; ++ ++static struct snd_soc_dai_link snd_rpi_googlevoicehat_soundcard_dai[] = { ++{ ++ .name = "Google voiceHAT SoundCard", ++ .stream_name = "Google voiceHAT SoundCard HiFi", ++ .cpu_dai_name = "bcm2708-i2s.0", ++ .codec_dai_name = "voicehat-hifi", ++ .platform_name = "bcm2708-i2s.0", ++ .codec_name = "voicehat-codec", ++ .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | ++ SND_SOC_DAIFMT_CBS_CFS, ++ .ops = &snd_rpi_googlevoicehat_soundcard_ops, ++ .init = snd_rpi_googlevoicehat_soundcard_init, ++}, ++}; ++ ++/* audio machine driver */ ++static struct snd_soc_card snd_rpi_googlevoicehat_soundcard = { ++ .name = "snd_rpi_googlevoicehat_soundcard", ++ .owner = THIS_MODULE, ++ .dai_link = snd_rpi_googlevoicehat_soundcard_dai, ++ .num_links = ARRAY_SIZE(snd_rpi_googlevoicehat_soundcard_dai), ++}; ++ ++static int snd_rpi_googlevoicehat_soundcard_probe(struct platform_device *pdev) ++{ ++ int ret = 0; ++ ++ snd_rpi_googlevoicehat_soundcard.dev = &pdev->dev; ++ ++ if (pdev->dev.of_node) { ++ struct device_node *i2s_node; ++ struct snd_soc_dai_link *dai = &snd_rpi_googlevoicehat_soundcard_dai[0]; ++ i2s_node = of_parse_phandle(pdev->dev.of_node, ++ "i2s-controller", 0); ++ ++ if (i2s_node) { ++ dai->cpu_dai_name = NULL; ++ dai->cpu_of_node = i2s_node; ++ dai->platform_name = NULL; ++ dai->platform_of_node = i2s_node; ++ } ++ } ++ ++ ret = snd_soc_register_card(&snd_rpi_googlevoicehat_soundcard); ++ if (ret) ++ dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", ret); ++ ++ return ret; ++} ++ ++static int snd_rpi_googlevoicehat_soundcard_remove(struct platform_device *pdev) ++{ ++ return snd_soc_unregister_card(&snd_rpi_googlevoicehat_soundcard); ++} ++ ++static const struct of_device_id snd_rpi_googlevoicehat_soundcard_of_match[] = { ++ { .compatible = "googlevoicehat,googlevoicehat-soundcard", }, ++ {}, ++}; ++MODULE_DEVICE_TABLE(of, snd_rpi_googlevoicehat_soundcard_of_match); ++ ++static struct platform_driver snd_rpi_googlevoicehat_soundcard_driver = { ++ .driver = { ++ .name = "snd-googlevoicehat-soundcard", ++ .owner = THIS_MODULE, ++ .of_match_table = snd_rpi_googlevoicehat_soundcard_of_match, ++ }, ++ .probe = snd_rpi_googlevoicehat_soundcard_probe, ++ .remove = snd_rpi_googlevoicehat_soundcard_remove, ++}; ++ ++module_platform_driver(snd_rpi_googlevoicehat_soundcard_driver); ++ ++MODULE_AUTHOR("Peter Malkin "); ++MODULE_DESCRIPTION("ASoC Driver for Google voiceHAT SoundCard"); ++MODULE_LICENSE("GPL v2"); + +From b121eeed23b64d5d9f635e75751b5a3588d63664 Mon Sep 17 00:00:00 2001 From: P33M Date: Wed, 21 Oct 2015 14:55:21 +0100 -Subject: [PATCH 088/201] rpi_display: add backlight driver and overlay +Subject: [PATCH 090/134] 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 @@ -105799,7 +107988,7 @@ Signed-off-by: Gordon Hollingworth create mode 100644 drivers/video/backlight/rpi_backlight.c diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig -index 5ffa4b4e26c0e874d3f63068456b3d72d8b4beb5..c3023ab052b477dde522a262a360ec312e94de22 100644 +index 4e1d2ad50ba142950e0048d986ab7e0df2eafece..e345a32945b7ec0712cebd0ac8e62c9e8955e24f 100644 --- a/drivers/video/backlight/Kconfig +++ b/drivers/video/backlight/Kconfig @@ -265,6 +265,12 @@ config BACKLIGHT_PWM @@ -105816,7 +108005,7 @@ index 5ffa4b4e26c0e874d3f63068456b3d72d8b4beb5..c3023ab052b477dde522a262a360ec31 tristate "Backlight Driver for DA9030/DA9034 using WLED" depends on PMIC_DA903X diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile -index 16ec534cff3044209adbae3495c19d97fee3ef73..00eff87fb3391300e78f055fa05d3b9647fa053d 100644 +index 8905129691e84a2fe42acd625f32b0a01772097c..6d6b2f132a61663bb26f99dd72ef8df014bf99a4 100644 --- a/drivers/video/backlight/Makefile +++ b/drivers/video/backlight/Makefile @@ -50,6 +50,7 @@ obj-$(CONFIG_BACKLIGHT_PANDORA) += pandora_bl.o @@ -105953,10 +108142,10 @@ index 0000000000000000000000000000000000000000..14a0d9b037395497c1fdae2961feccd5 +MODULE_DESCRIPTION("Raspberry Pi mailbox based Backlight Driver"); +MODULE_LICENSE("GPL"); -From 935f55ce1b67aeadf2c9d5a28ece58884b4873ec Mon Sep 17 00:00:00 2001 +From 8c3c104f83d5a21d265abb8692fc0b915ec31e08 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 23 Feb 2016 19:56:04 +0000 -Subject: [PATCH 089/201] bcm2835-virtgpio: Virtual GPIO driver +Subject: [PATCH 091/134] bcm2835-virtgpio: Virtual GPIO driver Add a virtual GPIO driver that uses the firmware mailbox interface to request that the VPU toggles LEDs. @@ -105969,7 +108158,7 @@ request that the VPU toggles LEDs. create mode 100644 drivers/gpio/gpio-bcm-virt.c diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig -index 05043071fc9805e1b9595090450f405ab28c22db..11f6e8466018783f8478a4f4e0e9050aae5d62f0 100644 +index 23ca51ee6b28e416bc7472ca5525a71652bbde92..da39a1767741adebecede7407520e403835bc8d0 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -134,6 +134,12 @@ config GPIO_BCM_KONA @@ -105986,13 +108175,13 @@ index 05043071fc9805e1b9595090450f405ab28c22db..11f6e8466018783f8478a4f4e0e9050a tristate "BRCMSTB GPIO support" default y if (ARCH_BRCMSTB || BMIPS_GENERIC) diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile -index becb96c724fef59bf770c89268771c10acf6e48f..fcdfb8e3c19e1c74e4e4c1a8881955fcbcd6a659 100644 +index 68b96277d9fa463bc641b0211eb4d719d75ac481..a211175566384fed8a6344da825b17d1f5513913 100644 --- a/drivers/gpio/Makefile +++ b/drivers/gpio/Makefile -@@ -33,6 +33,7 @@ obj-$(CONFIG_GPIO_ATH79) += gpio-ath79.o - obj-$(CONFIG_GPIO_ASPEED) += gpio-aspeed.o +@@ -34,6 +34,7 @@ obj-$(CONFIG_GPIO_ASPEED) += gpio-aspeed.o obj-$(CONFIG_GPIO_AXP209) += gpio-axp209.o obj-$(CONFIG_GPIO_BCM_KONA) += gpio-bcm-kona.o + obj-$(CONFIG_GPIO_BD9571MWV) += gpio-bd9571mwv.o +obj-$(CONFIG_GPIO_BCM_VIRT) += gpio-bcm-virt.o obj-$(CONFIG_GPIO_BRCMSTB) += gpio-brcmstb.o obj-$(CONFIG_GPIO_BT8XX) += gpio-bt8xx.o @@ -106230,10 +108419,10 @@ index 4a3d79d3b48eb483a4e4bf498f617515e3ad158f..5f34e1257117fb48013c9926a8a223d6 RPI_FIRMWARE_FRAMEBUFFER_SET_BACKLIGHT = 0x0004800f, -From 880ac55a4ee7133a2b9f43bdab69cf8b7bd35d4f Mon Sep 17 00:00:00 2001 +From 93b3a1f4664e27cd54eb4d8b85553c4e7176bb0b Mon Sep 17 00:00:00 2001 From: Dave Stevenson Date: Mon, 20 Feb 2017 17:01:21 +0000 -Subject: [PATCH 090/201] bcm2835-gpio-exp: Driver for GPIO expander via +Subject: [PATCH 092/134] bcm2835-gpio-exp: Driver for GPIO expander via mailbox service Pi3 and Compute Module 3 have a GPIO expander that the @@ -106247,13 +108436,13 @@ Signed-off-by: Dave Stevenson --- drivers/gpio/Kconfig | 7 + drivers/gpio/Makefile | 1 + - drivers/gpio/gpio-bcm-exp.c | 256 +++++++++++++++++++++++++++++ + drivers/gpio/gpio-bcm-exp.c | 254 +++++++++++++++++++++++++++++ include/soc/bcm2835/raspberrypi-firmware.h | 4 + - 4 files changed, 268 insertions(+) + 4 files changed, 266 insertions(+) create mode 100644 drivers/gpio/gpio-bcm-exp.c diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig -index 11f6e8466018783f8478a4f4e0e9050aae5d62f0..2c0028656eda108b16b0d51820c3cee74121f5f9 100644 +index da39a1767741adebecede7407520e403835bc8d0..54e2ace125e6a3609af65f9c15541adfd3dd0008 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -128,6 +128,13 @@ config GPIO_AXP209 @@ -106271,7 +108460,7 @@ index 11f6e8466018783f8478a4f4e0e9050aae5d62f0..2c0028656eda108b16b0d51820c3cee7 bool "Broadcom Kona GPIO" depends on OF_GPIO && (ARCH_BCM_MOBILE || COMPILE_TEST) diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile -index fcdfb8e3c19e1c74e4e4c1a8881955fcbcd6a659..a376f2b1012a3c1236094c8e9b1f5a3f6ed599fe 100644 +index a211175566384fed8a6344da825b17d1f5513913..f21c8c1d801ba365e4349a852fc711ed3dd6fd0a 100644 --- a/drivers/gpio/Makefile +++ b/drivers/gpio/Makefile @@ -32,6 +32,7 @@ obj-$(CONFIG_GPIO_ARIZONA) += gpio-arizona.o @@ -106280,14 +108469,14 @@ index fcdfb8e3c19e1c74e4e4c1a8881955fcbcd6a659..a376f2b1012a3c1236094c8e9b1f5a3f obj-$(CONFIG_GPIO_AXP209) += gpio-axp209.o +obj-$(CONFIG_GPIO_BCM_EXP) += gpio-bcm-exp.o obj-$(CONFIG_GPIO_BCM_KONA) += gpio-bcm-kona.o + obj-$(CONFIG_GPIO_BD9571MWV) += gpio-bd9571mwv.o obj-$(CONFIG_GPIO_BCM_VIRT) += gpio-bcm-virt.o - obj-$(CONFIG_GPIO_BRCMSTB) += gpio-brcmstb.o diff --git a/drivers/gpio/gpio-bcm-exp.c b/drivers/gpio/gpio-bcm-exp.c new file mode 100644 -index 0000000000000000000000000000000000000000..681a91492d4c33bdfd42416e069218e8611cc4d9 +index 0000000000000000000000000000000000000000..d68adafaee4ad406f45f4ff0d6b7c1ad5d10e330 --- /dev/null +++ b/drivers/gpio/gpio-bcm-exp.c -@@ -0,0 +1,256 @@ +@@ -0,0 +1,254 @@ +/* + * Broadcom expander GPIO driver + * @@ -106455,8 +108644,6 @@ index 0000000000000000000000000000000000000000..681a91492d4c33bdfd42416e069218e8 + + gpio = container_of(gc, struct brcmexp_gpio, gc); + -+ off += gpio->gc.base; -+ + set.gpio = off + gpio->gc.base; /* GPIO to update */ + set.state = val; /* Output state */ + @@ -106561,10 +108748,10 @@ index 5f34e1257117fb48013c9926a8a223d64a598ab7..c819c21b0158a59c1308882e5a40e3f3 /* Dispmanx TAGS */ RPI_FIRMWARE_FRAMEBUFFER_ALLOCATE = 0x00040001, -From af53949e0817a96aff3010fe28546f78a3aec699 Mon Sep 17 00:00:00 2001 +From 043439d91b12f2fbf6cc06b8894a7ff6a6f7f6b8 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 23 Feb 2016 17:26:48 +0000 -Subject: [PATCH 091/201] amba_pl011: Don't use DT aliases for numbering +Subject: [PATCH 093/134] 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 @@ -106576,10 +108763,10 @@ use the same logic. 1 file changed, 5 insertions(+) diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c -index f2503d862f3aee25396ef002ba69968896316779..a85e81245004e928fc52ec59044e151b7f183496 100644 +index 8a857bb34fbb26c6d60784d3fe7576730a9aa5b3..0afd6f3ee7e8d021d6e324915af4dc7c7db56083 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c -@@ -2582,7 +2582,12 @@ static int pl011_setup_port(struct device *dev, struct uart_amba_port *uap, +@@ -2587,7 +2587,12 @@ static int pl011_setup_port(struct device *dev, struct uart_amba_port *uap, if (IS_ERR(base)) return PTR_ERR(base); @@ -106593,10 +108780,10 @@ index f2503d862f3aee25396ef002ba69968896316779..a85e81245004e928fc52ec59044e151b uap->old_cr = 0; uap->port.dev = dev; -From 8c56d934f312da6ee8d1069217e34ce6fceabd3a Mon Sep 17 00:00:00 2001 +From 833a807e2dbdea1e15e445419918348096f8bddc Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 1 Mar 2017 16:07:39 +0000 -Subject: [PATCH 092/201] amba_pl011: Round input clock up +Subject: [PATCH 094/134] 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 @@ -106620,10 +108807,10 @@ Signed-off-by: Phil Elwell 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c -index a85e81245004e928fc52ec59044e151b7f183496..380d2c2e19ae3720924e906261b487adcf39835c 100644 +index 0afd6f3ee7e8d021d6e324915af4dc7c7db56083..be4aa91bac66982b1fd9a13e9f971b3bc5020d64 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c -@@ -1674,6 +1674,23 @@ static void pl011_put_poll_char(struct uart_port *port, +@@ -1679,6 +1679,23 @@ static void pl011_put_poll_char(struct uart_port *port, #endif /* CONFIG_CONSOLE_POLL */ @@ -106647,7 +108834,7 @@ index a85e81245004e928fc52ec59044e151b7f183496..380d2c2e19ae3720924e906261b487ad static int pl011_hwinit(struct uart_port *port) { struct uart_amba_port *uap = -@@ -1690,7 +1707,7 @@ static int pl011_hwinit(struct uart_port *port) +@@ -1695,7 +1712,7 @@ static int pl011_hwinit(struct uart_port *port) if (retval) return retval; @@ -106656,7 +108843,7 @@ index a85e81245004e928fc52ec59044e151b7f183496..380d2c2e19ae3720924e906261b487ad /* Clear pending error and receive interrupts */ pl011_write(UART011_OEIS | UART011_BEIS | UART011_PEIS | -@@ -2330,7 +2347,7 @@ static int __init pl011_console_setup(struct console *co, char *options) +@@ -2335,7 +2352,7 @@ static int __init pl011_console_setup(struct console *co, char *options) plat->init(); } @@ -106665,7 +108852,7 @@ index a85e81245004e928fc52ec59044e151b7f183496..380d2c2e19ae3720924e906261b487ad if (uap->vendor->fixed_options) { baud = uap->fixed_baud; -@@ -2513,6 +2530,7 @@ static struct uart_driver amba_reg = { +@@ -2518,6 +2535,7 @@ static struct uart_driver amba_reg = { .cons = AMBA_CONSOLE, }; @@ -106673,7 +108860,7 @@ index a85e81245004e928fc52ec59044e151b7f183496..380d2c2e19ae3720924e906261b487ad static int pl011_probe_dt_alias(int index, struct device *dev) { struct device_node *np; -@@ -2544,6 +2562,7 @@ static int pl011_probe_dt_alias(int index, struct device *dev) +@@ -2549,6 +2567,7 @@ static int pl011_probe_dt_alias(int index, struct device *dev) return ret; } @@ -106682,10 +108869,10 @@ index a85e81245004e928fc52ec59044e151b7f183496..380d2c2e19ae3720924e906261b487ad /* unregisters the driver also if no more ports are left */ static void pl011_unregister_port(struct uart_amba_port *uap) -From 58ec155838676bc164e566a8842ee82b9d86d743 Mon Sep 17 00:00:00 2001 +From e7087fa8090e50eeb09dfd041d45be57d4ace7a9 Mon Sep 17 00:00:00 2001 From: Pantelis Antoniou Date: Wed, 3 Dec 2014 13:23:28 +0200 -Subject: [PATCH 093/201] OF: DT-Overlay configfs interface +Subject: [PATCH 095/134] 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. @@ -107117,10 +109304,10 @@ index 0000000000000000000000000000000000000000..0037e6868a6cda8706c88194c6a4454b +} +late_initcall(of_cfs_init); -From ceb9d04922f6298372e30047a95ed3e3ebfad92f Mon Sep 17 00:00:00 2001 +From 4aaa5b2985ad761fb8f7be374033c61df1083731 Mon Sep 17 00:00:00 2001 From: Cheong2K Date: Fri, 26 Feb 2016 18:20:10 +0800 -Subject: [PATCH 094/201] brcm: adds support for BCM43341 wifi +Subject: [PATCH 096/134] brcm: adds support for BCM43341 wifi brcmfmac: Disable power management @@ -107166,10 +109353,10 @@ Signed-off-by: Phil Elwell 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -index 017e20b343047a85e9447fdf5c28414a102e084e..7bed37e32aea708ab191781adfdf989c2d6519fe 100644 +index cd1d6730eab73d514db5a1b88d442607c7834e3d..844bd80458a53e3134c8a54d3958e559c39c5551 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -@@ -2747,6 +2747,8 @@ brcmf_cfg80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *ndev, +@@ -2745,6 +2745,8 @@ brcmf_cfg80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *ndev, * preference in cfg struct to apply this to * FW later while initializing the dongle */ @@ -107178,7 +109365,7 @@ index 017e20b343047a85e9447fdf5c28414a102e084e..7bed37e32aea708ab191781adfdf989c cfg->pwr_save = enabled; if (!check_vif_up(ifp->vif)) { -@@ -4655,12 +4657,15 @@ static int brcmf_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev) +@@ -4671,12 +4673,15 @@ static int brcmf_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev) err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_DOWN, 1); if (err < 0) brcmf_err("BRCMF_C_DOWN error %d\n", err); @@ -107197,7 +109384,7 @@ index 017e20b343047a85e9447fdf5c28414a102e084e..7bed37e32aea708ab191781adfdf989c if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS)) brcmf_fil_iovar_int_set(ifp, "mbss", 0); brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_REGULATORY, -@@ -6686,12 +6691,18 @@ static s32 brcmf_translate_country_code(struct brcmf_pub *drvr, char alpha2[2], +@@ -6711,12 +6716,18 @@ static s32 brcmf_translate_country_code(struct brcmf_pub *drvr, char alpha2[2], struct brcmfmac_pd_cc *country_codes; struct brcmfmac_pd_cc_entry *cc; s32 found_index; @@ -107218,7 +109405,7 @@ index 017e20b343047a85e9447fdf5c28414a102e084e..7bed37e32aea708ab191781adfdf989c } if ((alpha2[0] == ccreq->country_abbrev[0]) && -@@ -6715,10 +6726,14 @@ static s32 brcmf_translate_country_code(struct brcmf_pub *drvr, char alpha2[2], +@@ -6740,10 +6751,14 @@ static s32 brcmf_translate_country_code(struct brcmf_pub *drvr, char alpha2[2], brcmf_dbg(TRACE, "No country code match found\n"); return -EINVAL; } @@ -107237,7 +109424,7 @@ index 017e20b343047a85e9447fdf5c28414a102e084e..7bed37e32aea708ab191781adfdf989c ccreq->country_abbrev[1] = alpha2[1]; ccreq->country_abbrev[2] = 0; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c -index 33b133f7e63aad3b5a6bb14018fd461ec4fb90c6..6221b046bca44211e2dfac24119097f7ac09e829 100644 +index 7a2b49587b4d32dde1af56a2979d4e1818500f84..df138305217384de2359313bc7d005285388e78e 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c @@ -69,7 +69,7 @@ static int brcmf_fcmode; @@ -107250,10 +109437,10 @@ index 33b133f7e63aad3b5a6bb14018fd461ec4fb90c6..6221b046bca44211e2dfac24119097f7 MODULE_PARM_DESC(roamoff, "Do not use internal roaming engine"); diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c -index 67bff5b8cd6067de4eaa9458b16f8da6ec6eb885..7a8d881a3c5aa7c633e3e557c8860874dd3ec544 100644 +index fc64b8913aa6a11c0111fec3b9d900174dc250c3..fe6bfd3ba350a2459d89957d768651a6b8643ab8 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c -@@ -604,6 +604,7 @@ BRCMF_FW_NVRAM_DEF(4329, "brcmfmac4329-sdio.bin", "brcmfmac4329-sdio.txt"); +@@ -609,6 +609,7 @@ BRCMF_FW_NVRAM_DEF(4329, "brcmfmac4329-sdio.bin", "brcmfmac4329-sdio.txt"); BRCMF_FW_NVRAM_DEF(4330, "brcmfmac4330-sdio.bin", "brcmfmac4330-sdio.txt"); BRCMF_FW_NVRAM_DEF(4334, "brcmfmac4334-sdio.bin", "brcmfmac4334-sdio.txt"); BRCMF_FW_NVRAM_DEF(43340, "brcmfmac43340-sdio.bin", "brcmfmac43340-sdio.txt"); @@ -107261,7 +109448,7 @@ index 67bff5b8cd6067de4eaa9458b16f8da6ec6eb885..7a8d881a3c5aa7c633e3e557c8860874 BRCMF_FW_NVRAM_DEF(4335, "brcmfmac4335-sdio.bin", "brcmfmac4335-sdio.txt"); BRCMF_FW_NVRAM_DEF(43362, "brcmfmac43362-sdio.bin", "brcmfmac43362-sdio.txt"); BRCMF_FW_NVRAM_DEF(4339, "brcmfmac4339-sdio.bin", "brcmfmac4339-sdio.txt"); -@@ -621,7 +622,7 @@ static struct brcmf_firmware_mapping brcmf_sdio_fwnames[] = { +@@ -626,7 +627,7 @@ static struct brcmf_firmware_mapping brcmf_sdio_fwnames[] = { BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4330_CHIP_ID, 0xFFFFFFFF, 4330), BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4334_CHIP_ID, 0xFFFFFFFF, 4334), BRCMF_FW_NVRAM_ENTRY(BRCM_CC_43340_CHIP_ID, 0xFFFFFFFF, 43340), @@ -107271,26 +109458,24 @@ index 67bff5b8cd6067de4eaa9458b16f8da6ec6eb885..7a8d881a3c5aa7c633e3e557c8860874 BRCMF_FW_NVRAM_ENTRY(BRCM_CC_43362_CHIP_ID, 0xFFFFFFFE, 43362), BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4339_CHIP_ID, 0xFFFFFFFF, 4339), -From c1b383e8e16ade1873f7dc3185bf425869cc7028 Mon Sep 17 00:00:00 2001 +From 36a17a79b120dabcc742510b12d2d2e0ff434f48 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Fri, 17 Feb 2017 15:26:13 +0000 -Subject: [PATCH 095/201] brcmfmac: Mute expected startup 'errors' +Subject: [PATCH 097/134] brcmfmac: Mute expected startup 'errors' -The brcmfmac WiFi driver always complains about the '00' country code -and the firmware version is reported as an error. Modify the driver to -ignore '00' silently and display firmware version at INFO level. +The brcmfmac WiFi driver always complains about the '00' country code. +Modify the driver to ignore '00' silently. Signed-off-by: Phil Elwell --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 2 ++ - drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c | 2 +- - 2 files changed, 3 insertions(+), 1 deletion(-) + 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -index 7bed37e32aea708ab191781adfdf989c2d6519fe..11412dabb9e6b436267cfa06dbbc6f93bdf721e1 100644 +index 844bd80458a53e3134c8a54d3958e559c39c5551..0e3c71dc0da4c21954ab1a1b329549a1321518ca 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -@@ -6753,6 +6753,8 @@ static void brcmf_cfg80211_reg_notifier(struct wiphy *wiphy, +@@ -6782,6 +6782,8 @@ static void brcmf_cfg80211_reg_notifier(struct wiphy *wiphy, /* ignore non-ISO3166 country codes */ for (i = 0; i < sizeof(req->alpha2); i++) if (req->alpha2[i] < 'A' || req->alpha2[i] > 'Z') { @@ -107299,24 +109484,11 @@ index 7bed37e32aea708ab191781adfdf989c2d6519fe..11412dabb9e6b436267cfa06dbbc6f93 brcmf_err("not a ISO3166 code (0x%02x 0x%02x)\n", req->alpha2[0], req->alpha2[1]); return; -diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c -index 6221b046bca44211e2dfac24119097f7ac09e829..634602e0c44f91da06db7aa803dbee6921ae921e 100644 ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c -@@ -161,7 +161,7 @@ int brcmf_c_preinit_dcmds(struct brcmf_if *ifp) - strsep(&ptr, "\n"); - - /* Print fw version info */ -- brcmf_err("Firmware version = %s\n", buf); -+ pr_info("Firmware version = %s\n", buf); - - /* locate firmware version number for ethtool */ - ptr = strrchr(buf, ' ') + 1; -From 9c8c1cff290d3ad26c08a44173261dc7902e227d Mon Sep 17 00:00:00 2001 +From be720865d0cefb780779087cd6d7d7c3adb0c2bb Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 17 Dec 2015 13:37:07 +0000 -Subject: [PATCH 096/201] hci_h5: Don't send conf_req when ACTIVE +Subject: [PATCH 098/134] 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. @@ -107339,24 +109511,24 @@ index 90d0456b67446bcc624fab4b1542c4eaf21531b1..f9adeac3bbba6418dcca298c55706356 if (H5_HDR_LEN(hdr) > 2) h5->tx_win = (data[2] & 0x07); -From 5e7c0a1252fa0ccd730a409d11a4e54f340a0d17 Mon Sep 17 00:00:00 2001 +From 75d4851a65758685f0b45943e6ca3c0d2c535ccb Mon Sep 17 00:00:00 2001 From: popcornmix Date: Mon, 13 Apr 2015 17:16:29 +0100 -Subject: [PATCH 097/201] config: Add default configs +Subject: [PATCH 099/134] config: Add default configs --- - arch/arm/configs/bcm2709_defconfig | 1309 +++++++++++++++++++++++++++++++++++ - arch/arm/configs/bcmrpi_defconfig | 1317 ++++++++++++++++++++++++++++++++++++ - 2 files changed, 2626 insertions(+) + arch/arm/configs/bcm2709_defconfig | 1314 +++++++++++++++++++++++++++++++++++ + arch/arm/configs/bcmrpi_defconfig | 1322 ++++++++++++++++++++++++++++++++++++ + 2 files changed, 2636 insertions(+) create mode 100644 arch/arm/configs/bcm2709_defconfig create mode 100644 arch/arm/configs/bcmrpi_defconfig diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig new file mode 100644 -index 0000000000000000000000000000000000000000..667755d0d8bcf6dd39fc80e19696a120ea61fe01 +index 0000000000000000000000000000000000000000..90713b5b0d1ccd80abf420e8ba1bd24a7ad5c5a6 --- /dev/null +++ b/arch/arm/configs/bcm2709_defconfig -@@ -0,0 +1,1309 @@ +@@ -0,0 +1,1314 @@ +CONFIG_LOCALVERSION="-v7" +# CONFIG_LOCALVERSION_AUTO is not set +CONFIG_SYSVIPC=y @@ -107793,7 +109965,6 @@ index 0000000000000000000000000000000000000000..667755d0d8bcf6dd39fc80e19696a120 +CONFIG_ISCSI_BOOT_SYSFS=m +CONFIG_MD=y +CONFIG_MD_LINEAR=m -+CONFIG_MD_RAID0=m +CONFIG_BLK_DEV_DM=m +CONFIG_DM_CRYPT=m +CONFIG_DM_SNAPSHOT=m @@ -107907,7 +110078,6 @@ index 0000000000000000000000000000000000000000..667755d0d8bcf6dd39fc80e19696a120 +CONFIG_IEEE802154_AT86RF230=m +CONFIG_IEEE802154_MRF24J40=m +CONFIG_IEEE802154_CC2520=m -+CONFIG_INPUT_POLLDEV=m +CONFIG_INPUT_MOUSEDEV=y +CONFIG_INPUT_JOYDEV=m +CONFIG_INPUT_EVDEV=m @@ -107920,10 +110090,13 @@ index 0000000000000000000000000000000000000000..667755d0d8bcf6dd39fc80e19696a120 +CONFIG_JOYSTICK_XPAD=m +CONFIG_JOYSTICK_XPAD_FF=y +CONFIG_JOYSTICK_XPAD_LEDS=y ++CONFIG_JOYSTICK_PSXPAD_SPI=m ++CONFIG_JOYSTICK_PSXPAD_SPI_FF=y +CONFIG_JOYSTICK_RPISENSE=m +CONFIG_INPUT_TOUCHSCREEN=y +CONFIG_TOUCHSCREEN_ADS7846=m +CONFIG_TOUCHSCREEN_EGALAX=m ++CONFIG_TOUCHSCREEN_EDT_FT5X06=m +CONFIG_TOUCHSCREEN_RPI_FT5406=m +CONFIG_TOUCHSCREEN_USB_COMPOSITE=m +CONFIG_TOUCHSCREEN_STMPE=m @@ -107974,7 +110147,7 @@ index 0000000000000000000000000000000000000000..667755d0d8bcf6dd39fc80e19696a120 +CONFIG_SPI=y +CONFIG_SPI_BCM2835=m +CONFIG_SPI_BCM2835AUX=m -+CONFIG_SPI_SPIDEV=y ++CONFIG_SPI_SPIDEV=m +CONFIG_PPS=m +CONFIG_PPS_CLIENT_LDISC=m +CONFIG_PPS_CLIENT_GPIO=m @@ -108012,7 +110185,7 @@ index 0000000000000000000000000000000000000000..667755d0d8bcf6dd39fc80e19696a120 +CONFIG_SENSORS_ADS1015=m +CONFIG_SENSORS_INA2XX=m +CONFIG_THERMAL=y -+CONFIG_THERMAL_BCM2835=y ++CONFIG_BCM2835_THERMAL=y +CONFIG_WATCHDOG=y +CONFIG_BCM2835_WDT=y +CONFIG_MFD_STMPE=y @@ -108022,7 +110195,6 @@ index 0000000000000000000000000000000000000000..667755d0d8bcf6dd39fc80e19696a120 +CONFIG_MFD_WM5102=y +CONFIG_REGULATOR=y +CONFIG_REGULATOR_FIXED_VOLTAGE=m -+CONFIG_REGULATOR_ARIZONA=m +CONFIG_MEDIA_SUPPORT=m +CONFIG_MEDIA_CAMERA_SUPPORT=y +CONFIG_MEDIA_ANALOG_TV_SUPPORT=y @@ -108222,6 +110394,7 @@ index 0000000000000000000000000000000000000000..667755d0d8bcf6dd39fc80e19696a120 +CONFIG_SND_USB_6FIRE=m +CONFIG_SND_SOC=m +CONFIG_SND_BCM2835_SOC_I2S=m ++CONFIG_SND_BCM2708_SOC_GOOGLEVOICEHAT_SOUNDCARD=m +CONFIG_SND_BCM2708_SOC_HIFIBERRY_DAC=m +CONFIG_SND_BCM2708_SOC_HIFIBERRY_DACPLUS=m +CONFIG_SND_BCM2708_SOC_HIFIBERRY_DIGI=m @@ -108241,6 +110414,8 @@ index 0000000000000000000000000000000000000000..667755d0d8bcf6dd39fc80e19696a120 +CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO=m +CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO_V2=m +CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC=m ++CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS=m ++CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC=m +CONFIG_SND_BCM2708_SOC_FE_PI_AUDIO=m +CONFIG_SND_PISOUND=m +CONFIG_SND_SOC_ADAU1701=m @@ -108248,7 +110423,6 @@ index 0000000000000000000000000000000000000000..667755d0d8bcf6dd39fc80e19696a120 +CONFIG_SND_SOC_AK4554=m +CONFIG_SND_SOC_WM8804_I2C=m +CONFIG_SND_SIMPLE_CARD=m -+CONFIG_SOUND_PRIME=m +CONFIG_HIDRAW=y +CONFIG_UHID=m +CONFIG_HID_A4TECH=m @@ -108405,7 +110579,7 @@ index 0000000000000000000000000000000000000000..667755d0d8bcf6dd39fc80e19696a120 +CONFIG_USB_GADGET=m +CONFIG_MMC=y +CONFIG_MMC_BLOCK_MINORS=32 -+CONFIG_MMC_BCM2835=y ++CONFIG_MMC_BCM2835_MMC=y +CONFIG_MMC_BCM2835_DMA=y +CONFIG_MMC_BCM2835_SDHOST=y +CONFIG_MMC_SDHCI=y @@ -108471,10 +110645,8 @@ index 0000000000000000000000000000000000000000..667755d0d8bcf6dd39fc80e19696a120 +CONFIG_SPEAKUP=m +CONFIG_SPEAKUP_SYNTH_SOFT=m +CONFIG_STAGING_MEDIA=y -+CONFIG_VIDEO_BCM2835=m +CONFIG_LIRC_STAGING=y +CONFIG_LIRC_RPI=m -+CONFIG_LIRC_SASEM=m +CONFIG_FB_TFT=m +CONFIG_FB_TFT_AGM1264K_FL=m +CONFIG_FB_TFT_BD663474=m @@ -108505,7 +110677,10 @@ index 0000000000000000000000000000000000000000..667755d0d8bcf6dd39fc80e19696a120 +CONFIG_FB_TFT_WATTEROTT=m +CONFIG_FB_FLEX=m +CONFIG_FB_TFT_FBTFT_DEVICE=m ++CONFIG_BCM2835_VCHIQ=y ++CONFIG_BCM2835_VCHIQ_SUPPORT_MEMDUMP=y +CONFIG_SND_BCM2835=m ++CONFIG_VIDEO_BCM2835=m +CONFIG_MAILBOX=y +CONFIG_BCM2835_MBOX=y +# CONFIG_IOMMU_SUPPORT is not set @@ -108645,6 +110820,7 @@ index 0000000000000000000000000000000000000000..667755d0d8bcf6dd39fc80e19696a120 +CONFIG_SCHED_TRACER=y +CONFIG_STACK_TRACER=y +CONFIG_BLK_DEV_IO_TRACE=y ++# CONFIG_UPROBE_EVENTS is not set +CONFIG_FUNCTION_PROFILER=y +CONFIG_KGDB=y +CONFIG_KGDB_KDB=y @@ -108663,15 +110839,16 @@ index 0000000000000000000000000000000000000000..667755d0d8bcf6dd39fc80e19696a120 +# CONFIG_CRYPTO_HW is not set +CONFIG_ARM_CRYPTO=y +CONFIG_CRYPTO_SHA1_ARM_NEON=m ++CONFIG_CRYPTO_AES_ARM=m +CONFIG_CRYPTO_AES_ARM_BS=m +CONFIG_CRC_ITU_T=y +CONFIG_LIBCRC32C=y diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig new file mode 100644 -index 0000000000000000000000000000000000000000..046f3e8757ef0f794c802171690528d31fee9deb +index 0000000000000000000000000000000000000000..ace19d6f5bc04091130bd28b65ce25e863117a43 --- /dev/null +++ b/arch/arm/configs/bcmrpi_defconfig -@@ -0,0 +1,1317 @@ +@@ -0,0 +1,1322 @@ +# CONFIG_LOCALVERSION_AUTO is not set +CONFIG_SYSVIPC=y +CONFIG_POSIX_MQUEUE=y @@ -109104,7 +111281,6 @@ index 0000000000000000000000000000000000000000..046f3e8757ef0f794c802171690528d3 +CONFIG_ISCSI_BOOT_SYSFS=m +CONFIG_MD=y +CONFIG_MD_LINEAR=m -+CONFIG_MD_RAID0=m +CONFIG_BLK_DEV_DM=m +CONFIG_DM_CRYPT=m +CONFIG_DM_SNAPSHOT=m @@ -109218,7 +111394,6 @@ index 0000000000000000000000000000000000000000..046f3e8757ef0f794c802171690528d3 +CONFIG_IEEE802154_AT86RF230=m +CONFIG_IEEE802154_MRF24J40=m +CONFIG_IEEE802154_CC2520=m -+CONFIG_INPUT_POLLDEV=m +CONFIG_INPUT_MOUSEDEV=y +CONFIG_INPUT_JOYDEV=m +CONFIG_INPUT_EVDEV=m @@ -109231,10 +111406,14 @@ index 0000000000000000000000000000000000000000..046f3e8757ef0f794c802171690528d3 +CONFIG_JOYSTICK_XPAD=m +CONFIG_JOYSTICK_XPAD_FF=y +CONFIG_JOYSTICK_XPAD_LEDS=y ++CONFIG_JOYSTICK_PSXPAD_SPI=m ++CONFIG_JOYSTICK_PSXPAD_SPI_FF=y +CONFIG_JOYSTICK_RPISENSE=m +CONFIG_INPUT_TOUCHSCREEN=y +CONFIG_TOUCHSCREEN_ADS7846=m +CONFIG_TOUCHSCREEN_EGALAX=m ++CONFIG_TOUCHSCREEN_EDT_FT5X06=m ++CONFIG_TOUCHSCREEN_GOODIX=m +CONFIG_TOUCHSCREEN_RPI_FT5406=m +CONFIG_TOUCHSCREEN_USB_COMPOSITE=m +CONFIG_TOUCHSCREEN_STMPE=m @@ -109285,7 +111464,7 @@ index 0000000000000000000000000000000000000000..046f3e8757ef0f794c802171690528d3 +CONFIG_SPI=y +CONFIG_SPI_BCM2835=m +CONFIG_SPI_BCM2835AUX=m -+CONFIG_SPI_SPIDEV=y ++CONFIG_SPI_SPIDEV=m +CONFIG_PPS=m +CONFIG_PPS_CLIENT_LDISC=m +CONFIG_PPS_CLIENT_GPIO=m @@ -109321,7 +111500,7 @@ index 0000000000000000000000000000000000000000..046f3e8757ef0f794c802171690528d3 +CONFIG_SENSORS_ADS1015=m +CONFIG_SENSORS_INA2XX=m +CONFIG_THERMAL=y -+CONFIG_THERMAL_BCM2835=y ++CONFIG_BCM2835_THERMAL=y +CONFIG_WATCHDOG=y +CONFIG_BCM2835_WDT=y +CONFIG_MFD_STMPE=y @@ -109331,7 +111510,6 @@ index 0000000000000000000000000000000000000000..046f3e8757ef0f794c802171690528d3 +CONFIG_MFD_WM5102=y +CONFIG_REGULATOR=y +CONFIG_REGULATOR_FIXED_VOLTAGE=m -+CONFIG_REGULATOR_ARIZONA=m +CONFIG_MEDIA_SUPPORT=m +CONFIG_MEDIA_CAMERA_SUPPORT=y +CONFIG_MEDIA_ANALOG_TV_SUPPORT=y @@ -109531,6 +111709,7 @@ index 0000000000000000000000000000000000000000..046f3e8757ef0f794c802171690528d3 +CONFIG_SND_USB_6FIRE=m +CONFIG_SND_SOC=m +CONFIG_SND_BCM2835_SOC_I2S=m ++CONFIG_SND_BCM2708_SOC_GOOGLEVOICEHAT_SOUNDCARD=m +CONFIG_SND_BCM2708_SOC_HIFIBERRY_DAC=m +CONFIG_SND_BCM2708_SOC_HIFIBERRY_DACPLUS=m +CONFIG_SND_BCM2708_SOC_HIFIBERRY_DIGI=m @@ -109550,6 +111729,8 @@ index 0000000000000000000000000000000000000000..046f3e8757ef0f794c802171690528d3 +CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO=m +CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO_V2=m +CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC=m ++CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS=m ++CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC=m +CONFIG_SND_BCM2708_SOC_FE_PI_AUDIO=m +CONFIG_SND_PISOUND=m +CONFIG_SND_SOC_ADAU1701=m @@ -109557,7 +111738,6 @@ index 0000000000000000000000000000000000000000..046f3e8757ef0f794c802171690528d3 +CONFIG_SND_SOC_AK4554=m +CONFIG_SND_SOC_WM8804_I2C=m +CONFIG_SND_SIMPLE_CARD=m -+CONFIG_SOUND_PRIME=m +CONFIG_HIDRAW=y +CONFIG_UHID=m +CONFIG_HID_A4TECH=m @@ -109727,7 +111907,7 @@ index 0000000000000000000000000000000000000000..046f3e8757ef0f794c802171690528d3 +CONFIG_USB_G_WEBCAM=m +CONFIG_MMC=y +CONFIG_MMC_BLOCK_MINORS=32 -+CONFIG_MMC_BCM2835=y ++CONFIG_MMC_BCM2835_MMC=y +CONFIG_MMC_BCM2835_DMA=y +CONFIG_MMC_BCM2835_SDHOST=y +CONFIG_MMC_SDHCI=y @@ -109793,10 +111973,8 @@ index 0000000000000000000000000000000000000000..046f3e8757ef0f794c802171690528d3 +CONFIG_SPEAKUP=m +CONFIG_SPEAKUP_SYNTH_SOFT=m +CONFIG_STAGING_MEDIA=y -+CONFIG_VIDEO_BCM2835=m +CONFIG_LIRC_STAGING=y +CONFIG_LIRC_RPI=m -+CONFIG_LIRC_SASEM=m +CONFIG_FB_TFT=m +CONFIG_FB_TFT_AGM1264K_FL=m +CONFIG_FB_TFT_BD663474=m @@ -109827,7 +112005,10 @@ index 0000000000000000000000000000000000000000..046f3e8757ef0f794c802171690528d3 +CONFIG_FB_TFT_WATTEROTT=m +CONFIG_FB_FLEX=m +CONFIG_FB_TFT_FBTFT_DEVICE=m ++CONFIG_BCM2835_VCHIQ=y ++CONFIG_BCM2835_VCHIQ_SUPPORT_MEMDUMP=y +CONFIG_SND_BCM2835=m ++CONFIG_VIDEO_BCM2835=m +CONFIG_MAILBOX=y +CONFIG_BCM2835_MBOX=y +# CONFIG_IOMMU_SUPPORT is not set @@ -109966,6 +112147,7 @@ index 0000000000000000000000000000000000000000..046f3e8757ef0f794c802171690528d3 +CONFIG_SCHED_TRACER=y +CONFIG_STACK_TRACER=y +CONFIG_BLK_DEV_IO_TRACE=y ++# CONFIG_UPROBE_EVENTS is not set +CONFIG_FUNCTION_PROFILER=y +CONFIG_KGDB=y +CONFIG_KGDB_KDB=y @@ -109990,10 +112172,10 @@ index 0000000000000000000000000000000000000000..046f3e8757ef0f794c802171690528d3 +CONFIG_CRC_ITU_T=y +CONFIG_LIBCRC32C=y -From 9d01779c167a41cd8d33e07d2c3c95cd13ca68df Mon Sep 17 00:00:00 2001 +From 156e426810bad66c92b9036785d7bd409a78e3ab Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Wed, 24 Aug 2016 03:35:56 -0700 -Subject: [PATCH 098/201] Add arm64 configuration and device tree differences. +Subject: [PATCH 100/134] Add arm64 configuration and device tree differences. Disable MMC_BCM2835_SDHOST and MMC_BCM2835 since these drivers are crashing at the moment. @@ -110015,7 +112197,7 @@ Tested with raspbian-jessie 2016-09-23. create mode 100644 arch/arm64/configs/bcmrpi3_defconfig diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms -index 129cc5ae4091489c08eb751f3e1b85b6eaa2eb9c..f04bc208f878322d35b94afafe74a7caf7d93820 100644 +index 73272f43ca012faac98c0aceed350dcd49814b28..ea7731a98256d00bdeda1ddb40d1d6c7d360b4c7 100644 --- a/arch/arm64/Kconfig.platforms +++ b/arch/arm64/Kconfig.platforms @@ -1,5 +1,27 @@ @@ -110045,15 +112227,14 @@ index 129cc5ae4091489c08eb751f3e1b85b6eaa2eb9c..f04bc208f878322d35b94afafe74a7ca + config ARCH_SUNXI bool "Allwinner sunxi 64-bit SoC Family" - select GENERIC_IRQ_CHIP + select ARCH_HAS_RESET_CONTROLLER diff --git a/arch/arm64/boot/dts/broadcom/Makefile b/arch/arm64/boot/dts/broadcom/Makefile -index f1caece9d3a7ae7af8f95f9b9675e935a59ace6b..db4e66ee2a455eb1ec7d49c1fcb1c6c0a7a3ad13 100644 +index bfa8f8e4c5af0643a9cff94917ccf932a5ee98cb..d6e9463b85062f80ba7c3c0bf328508929f7d519 100644 --- a/arch/arm64/boot/dts/broadcom/Makefile +++ b/arch/arm64/boot/dts/broadcom/Makefile -@@ -1,6 +1,7 @@ +@@ -1,5 +1,6 @@ dtb-$(CONFIG_ARCH_BCM2835) += bcm2837-rpi-3-b.dtb dtb-$(CONFIG_ARCH_BCM_IPROC) += ns2-svk.dtb ns2-xmc.dtb - dtb-$(CONFIG_ARCH_VULCAN) += vulcan-eval.dtb +dtb-$(CONFIG_ARCH_BCM2709) += bcm2710-rpi-3-b.dtb always := $(dtb-y) @@ -111408,82 +113589,10 @@ index 0000000000000000000000000000000000000000..e6b09fafa27eed2b762e3d53b55041f7 +CONFIG_LIBCRC32C=y +CONFIG_BCM2835_VCHIQ=n -From 483cedec528d971323a082b1453a410abdd3e294 Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Wed, 14 Sep 2016 09:18:09 +0100 -Subject: [PATCH 099/201] raspberrypi-firmware: Define the MBOX channel in the - header. - -Signed-off-by: Eric Anholt ---- - include/soc/bcm2835/raspberrypi-firmware.h | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/include/soc/bcm2835/raspberrypi-firmware.h b/include/soc/bcm2835/raspberrypi-firmware.h -index c819c21b0158a59c1308882e5a40e3f3fe73cbdf..de2a3dcd562beb752266eaf0070e55861d553f5f 100644 ---- a/include/soc/bcm2835/raspberrypi-firmware.h -+++ b/include/soc/bcm2835/raspberrypi-firmware.h -@@ -12,6 +12,8 @@ - #include - #include - -+#define RPI_FIRMWARE_CHAN_FB 1 -+ - struct rpi_firmware; - - enum rpi_firmware_property_status { - -From 090275b6b3a53cac128fbf1a9b1f4ceda96b3b20 Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Wed, 14 Sep 2016 09:16:19 +0100 -Subject: [PATCH 100/201] raspberrypi-firmware: Export the general transaction - function. - -The vc4-firmware-kms module is going to be doing the MBOX FB call. - -Signed-off-by: Eric Anholt ---- - drivers/firmware/raspberrypi.c | 3 ++- - include/soc/bcm2835/raspberrypi-firmware.h | 1 + - 2 files changed, 3 insertions(+), 1 deletion(-) - -diff --git a/drivers/firmware/raspberrypi.c b/drivers/firmware/raspberrypi.c -index 3f070bd38a91511c986e3fb114b15bd4ac32634c..f261b64d1657c02290904d841e1f087c34e27ded 100644 ---- a/drivers/firmware/raspberrypi.c -+++ b/drivers/firmware/raspberrypi.c -@@ -42,7 +42,7 @@ static void response_callback(struct mbox_client *cl, void *msg) - * Sends a request to the firmware through the BCM2835 mailbox driver, - * and synchronously waits for the reply. - */ --static int -+int - rpi_firmware_transaction(struct rpi_firmware *fw, u32 chan, u32 data) - { - u32 message = MBOX_MSG(chan, data); -@@ -63,6 +63,7 @@ rpi_firmware_transaction(struct rpi_firmware *fw, u32 chan, u32 data) - - return ret; - } -+EXPORT_SYMBOL_GPL(rpi_firmware_transaction); - - /** - * rpi_firmware_property_list - Submit firmware property list -diff --git a/include/soc/bcm2835/raspberrypi-firmware.h b/include/soc/bcm2835/raspberrypi-firmware.h -index de2a3dcd562beb752266eaf0070e55861d553f5f..dc7fd58afd5dddebf9b17065bb069a1db663362c 100644 ---- a/include/soc/bcm2835/raspberrypi-firmware.h -+++ b/include/soc/bcm2835/raspberrypi-firmware.h -@@ -156,5 +156,6 @@ static inline struct rpi_firmware *rpi_firmware_get(struct device_node *firmware - return NULL; - } - #endif -+int rpi_firmware_transaction(struct rpi_firmware *fw, u32 chan, u32 data); - - #endif /* __SOC_RASPBERRY_FIRMWARE_H__ */ - -From 3c2bd9a9a03b81f8f2e7066d4c54cb11209fa6ca Mon Sep 17 00:00:00 2001 +From 34288242eca9ccdc18ea111c09b0fde8381632c0 Mon Sep 17 00:00:00 2001 From: Electron752 Date: Thu, 12 Jan 2017 07:07:08 -0800 -Subject: [PATCH 101/201] ARM64: Make it work again on 4.9 (#1790) +Subject: [PATCH 101/134] 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. @@ -111492,14 +113601,14 @@ Subject: [PATCH 101/201] ARM64: Make it work again on 4.9 (#1790) Signed-off-by: Michael Zoran --- arch/arm64/Kconfig.platforms | 22 ------ - arch/arm64/boot/dts/broadcom/Makefile | 10 ++- + arch/arm64/boot/dts/broadcom/Makefile | 9 +++ arch/arm64/boot/dts/overlays | 1 + arch/arm64/configs/bcmrpi3_defconfig | 125 +++++++++++----------------------- - 4 files changed, 48 insertions(+), 110 deletions(-) + 4 files changed, 48 insertions(+), 109 deletions(-) create mode 120000 arch/arm64/boot/dts/overlays diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms -index f04bc208f878322d35b94afafe74a7caf7d93820..129cc5ae4091489c08eb751f3e1b85b6eaa2eb9c 100644 +index ea7731a98256d00bdeda1ddb40d1d6c7d360b4c7..73272f43ca012faac98c0aceed350dcd49814b28 100644 --- a/arch/arm64/Kconfig.platforms +++ b/arch/arm64/Kconfig.platforms @@ -1,27 +1,5 @@ @@ -111529,12 +113638,12 @@ index f04bc208f878322d35b94afafe74a7caf7d93820..129cc5ae4091489c08eb751f3e1b85b6 - config ARCH_SUNXI bool "Allwinner sunxi 64-bit SoC Family" - select GENERIC_IRQ_CHIP + select ARCH_HAS_RESET_CONTROLLER diff --git a/arch/arm64/boot/dts/broadcom/Makefile b/arch/arm64/boot/dts/broadcom/Makefile -index db4e66ee2a455eb1ec7d49c1fcb1c6c0a7a3ad13..6b1bd6e89c472f8f048c5a87e194567addc7ccd6 100644 +index d6e9463b85062f80ba7c3c0bf328508929f7d519..2974f282e6e4ba37bfa9bae31e355cb162e68131 100644 --- a/arch/arm64/boot/dts/broadcom/Makefile +++ b/arch/arm64/boot/dts/broadcom/Makefile -@@ -1,7 +1,15 @@ +@@ -1,6 +1,15 @@ +# Enable fixups to support overlays on BCM2835 platforms + +ifeq ($(CONFIG_ARCH_BCM2835),y) @@ -111543,8 +113652,7 @@ index db4e66ee2a455eb1ec7d49c1fcb1c6c0a7a3ad13..6b1bd6e89c472f8f048c5a87e194567a + dtb-$(CONFIG_ARCH_BCM2835) += bcm2837-rpi-3-b.dtb dtb-$(CONFIG_ARCH_BCM_IPROC) += ns2-svk.dtb ns2-xmc.dtb - dtb-$(CONFIG_ARCH_VULCAN) += vulcan-eval.dtb --dtb-$(CONFIG_ARCH_BCM2709) += bcm2710-rpi-3-b.dtb + dtb-$(CONFIG_ARCH_BCM2709) += bcm2710-rpi-3-b.dtb +dtb-$(CONFIG_ARCH_BCM2835) += bcm2710-rpi-3-b.dtb + +dts-dirs += ../overlays @@ -111887,10 +113995,10 @@ index e6b09fafa27eed2b762e3d53b55041f793683d27..c7e891d72969a388d9b135a36dbfc9c9 CONFIG_LIBCRC32C=y -CONFIG_BCM2835_VCHIQ=n -From 305d47a0b0cde98117e6c3b9299dc70c966318d8 Mon Sep 17 00:00:00 2001 +From 64107fc00b05535cbf16a0413102d63051e92752 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Thu, 12 Jan 2017 19:10:07 -0800 -Subject: [PATCH 102/201] ARM64: Enable HDMI audio and vc04_services in +Subject: [PATCH 102/134] ARM64: Enable HDMI audio and vc04_services in bcmrpi3_defconfig Signed-off-by: Michael Zoran @@ -111919,10 +114027,10 @@ index c7e891d72969a388d9b135a36dbfc9c9cb609bf8..4b90f9b64abe9f089ba56b13d5a00de3 CONFIG_BCM2835_MBOX=y # CONFIG_IOMMU_SUPPORT is not set -From f484cc7c96c2f9a630b9065f383d8cebf8c4de93 Mon Sep 17 00:00:00 2001 +From e3b54390f9c4d857d8a756efb262c93a2d1affc4 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Thu, 12 Jan 2017 19:14:03 -0800 -Subject: [PATCH 103/201] ARM64: Run bcmrpi3_defconfig through savedefconfig. +Subject: [PATCH 103/134] ARM64: Run bcmrpi3_defconfig through savedefconfig. Signed-off-by: Michael Zoran --- @@ -111967,10 +114075,10 @@ index 4b90f9b64abe9f089ba56b13d5a00de33343bfb9..dac962ca1634662ce7d966f1ffb53b5b CONFIG_FB_TFT_AGM1264K_FL=m CONFIG_FB_TFT_BD663474=m -From f5ef4658b33905bd44eb8fd3bd6242b547816914 Mon Sep 17 00:00:00 2001 +From 6062f5de07513f58cc95ce2e10a1deab1e6e387b Mon Sep 17 00:00:00 2001 From: Electron752 Date: Sat, 14 Jan 2017 02:54:26 -0800 -Subject: [PATCH 104/201] ARM64: Enable Kernel Address Space Randomization +Subject: [PATCH 104/134] ARM64: Enable Kernel Address Space Randomization (#1792) Randomization allows the mapping between virtual addresses and physical @@ -112002,10 +114110,10 @@ index dac962ca1634662ce7d966f1ffb53b5bfa27c506..aae33b4b3c3e736ea7cd3ca242158ad6 CONFIG_BINFMT_MISC=y CONFIG_COMPAT=y -From 5d0b8a0055dc533b226c835810d64486f318a534 Mon Sep 17 00:00:00 2001 +From 57f25b247a910ba2b8cf8df6b392877c01ea1880 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Sun, 15 Jan 2017 07:31:59 -0800 -Subject: [PATCH 105/201] ARM64: Enable RTL8187/RTL8192CU wifi in build config +Subject: [PATCH 105/134] 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 @@ -112030,10 +114138,10 @@ index aae33b4b3c3e736ea7cd3ca242158ad6ba558aff..b7d762df19b85e369a32cd823dfd0621 CONFIG_ZD1211RW=m CONFIG_MAC80211_HWSIM=m -From 4ce50623e042d59517d0d78eb347a47a9dc1df5a Mon Sep 17 00:00:00 2001 +From eb2ff297aba6ead0a2ef326a5f0d2717bc5b63ea Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Sat, 14 Jan 2017 21:33:51 -0800 -Subject: [PATCH 106/201] ARM64/DWC_OTG: Port dwc_otg driver to ARM64 +Subject: [PATCH 106/134] 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 @@ -112090,7 +114198,7 @@ index e7bdd12015fee1727a7956ae3e3b2786e88892c1..4872b8113b68bc9087cf5e128657c580 dwc_otg-objs += dwc_otg_cfi.o endif diff --git a/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c b/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c -index 13047c08fb71cc6e44c66096720d4654d3f9e4e1..9304279592cb5b388086ef91cb52f1e9f94868ce 100644 +index 2035e0762dc6d60673c8fbc47a90b72254f50b69..208252645c09d1d17bf07673989f91b7f4b3ef7a 100644 --- a/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c +++ b/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c @@ -74,6 +74,21 @@ void notrace _fiq_print(enum fiq_debug_level dbg_lvl, volatile struct fiq_state @@ -112174,10 +114282,10 @@ index f9fddfbcffb37f32c808fd78f222b676378398b1..0a1ddf3f89f45ca75b8880722fbc22cb extern void fiq_fsm_spin_unlock(fiq_lock_t *lock); diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c -index 027414bb2bf9fc3f3652407724187f3c6dc5ff68..0eb335f4bc8ec30fa68f830fc3e382330302686e 100644 +index 5e4d4ffe7966486d40a5b5e2423ac4df0de772a8..a2dc6337836b2719f4c954edeeb2a71301931b04 100644 --- a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c +++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c -@@ -1021,6 +1021,10 @@ int dwc_otg_hcd_init(dwc_otg_hcd_t * hcd, dwc_otg_core_if_t * core_if) +@@ -1002,6 +1002,10 @@ int dwc_otg_hcd_init(dwc_otg_hcd_t * hcd, dwc_otg_core_if_t * core_if) } DWC_MEMSET(hcd->fiq_state, 0, (sizeof(struct fiq_state) + (sizeof(struct fiq_channel_state) * num_channels))); @@ -112205,7 +114313,7 @@ index fb57db09378f4ab95d57cb58aa570a915ccb61c3..a384db5e7ac219936ace65e5616e68c8 /** * Returns private data set by 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 e6b38ac330b72152204c2a6879c20f0ce02ac2e5..b2618c15d1f1f0b062d4146672de5ae50e9e2d33 100644 +index fc52495e4749f45dcf270c1c22960f163b6dc86d..a4355afc77b68718fdaba6c5d4be257dadc75036 100644 --- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c +++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c @@ -36,8 +36,9 @@ @@ -112376,10 +114484,10 @@ index 6b2c7d0c93f36a63863ff4b0ecc1f3eab77e058b..d7b700ff17821ad1944e36721fe6b2db /** The OS page size */ #define DWC_OS_PAGE_SIZE PAGE_SIZE -From fc73621112d8aa0aadda7dd3d38aa5ed75dac043 Mon Sep 17 00:00:00 2001 +From 506fd947e46e8665d6e51ce217265a665a11602c Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Sat, 14 Jan 2017 21:43:57 -0800 -Subject: [PATCH 107/201] ARM64: Round-Robin dispatch IRQs between CPUs. +Subject: [PATCH 107/134] 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 @@ -112453,10 +114561,10 @@ index c4e151451cf8c8ebde5225515eac2786d6f61d46..9a7ee04ee0d9b7aa734cf3159ed59c19 .name = "bcm2836-gpu", .irq_mask = bcm2836_arm_irqchip_mask_gpu_irq, -From 8b2e2ab5d378fd67758e1a77a3ed2543c8ad4dc9 Mon Sep 17 00:00:00 2001 +From 9f8a6d0f2fc7283eae2fbb3e23ea9cf6ab09d074 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Sat, 14 Jan 2017 21:45:03 -0800 -Subject: [PATCH 108/201] ARM64: Enable DWC_OTG Driver In ARM64 Build +Subject: [PATCH 108/134] ARM64: Enable DWC_OTG Driver In ARM64 Build Config(bcmrpi3_defconfig) Signed-off-by: Michael Zoran @@ -112477,10 +114585,10 @@ index b7d762df19b85e369a32cd823dfd062145bdefa7..4d85c231c5ea0244e1b05fb4a5e3c8fd CONFIG_USB_STORAGE=y CONFIG_USB_STORAGE_REALTEK=m -From bce19827326233c2a919b127eda3f6e1d203fb5f Mon Sep 17 00:00:00 2001 +From c91f45839c13fd0c214509cb0e5b4689e5950671 Mon Sep 17 00:00:00 2001 From: Michael Zoran Date: Sat, 11 Feb 2017 01:18:31 -0800 -Subject: [PATCH 109/201] ARM64: Force hardware emulation of deprecated +Subject: [PATCH 109/134] ARM64: Force hardware emulation of deprecated instructions. --- @@ -112508,10 +114616,10 @@ index f0e6d717885b1fcf3b22f64c10c38f19c25f809d..0cb830d30fb6d2bd26ab572efe893649 case INSN_OBSOLETE: insn->current_mode = INSN_UNDEF; -From e914ea1915e82599cd9c0fb73c46047dd6a56646 Mon Sep 17 00:00:00 2001 +From 37d7ce51746684ccd5ec9dc08d20d2e21d94866b Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Fri, 10 Feb 2017 17:57:08 -0800 -Subject: [PATCH 110/201] build/arm64: Add rules for .dtbo files for dts +Subject: [PATCH 110/134] build/arm64: Add rules for .dtbo files for dts overlays We now create overlays as .dtbo files. @@ -112522,10 +114630,10 @@ Signed-off-by: Khem Raj 1 file changed, 3 insertions(+) diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile -index b9a4a934ca057623e0ea436fd9b2c7c0f675fced..54e3c38d6fd877827541cdc798de035cf439b17f 100644 +index f839ecd919f934c54a73d8e9f8179aff3d3cba26..a4010b3cc8ef11d449bcff801852266786862ca5 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile -@@ -119,6 +119,9 @@ zinstall install: +@@ -121,6 +121,9 @@ zinstall install: %.dtb: scripts $(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@ @@ -112536,10 +114644,10 @@ index b9a4a934ca057623e0ea436fd9b2c7c0f675fced..54e3c38d6fd877827541cdc798de035c dtbs: prepare scripts -From f0dfdf49088157bc72bc5e87cdb61d958a5256e5 Mon Sep 17 00:00:00 2001 +From 137be81a46763dd4c8bd071d7191dd4d26e5cf30 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 9 May 2016 17:28:18 -0700 -Subject: [PATCH 111/201] clk: bcm2835: Mark GPIO clocks enabled at boot as +Subject: [PATCH 111/134] clk: bcm2835: Mark GPIO clocks enabled at boot as critical. These divide off of PLLD_PER and are used for the ethernet and wifi @@ -112577,10 +114685,10 @@ index 39f72da6ba1f6ec6ec41d5dc1bf46344aab008da..fe3298b54cdfb96bd90fb4f39e13921d * rate changes on at least of the parents. */ -From e60e091099efc5c9d57680456e691746b8c95828 Mon Sep 17 00:00:00 2001 +From 87731386a16961ecc8d599608ed473b86b5fa0f4 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Tue, 24 Feb 2015 13:40:50 +0000 -Subject: [PATCH 112/201] pinctrl-bcm2835: Fix interrupt handling for GPIOs +Subject: [PATCH 112/134] pinctrl-bcm2835: Fix interrupt handling for GPIOs 28-31 and 46-53 Contrary to the documentation, the BCM2835 GPIO controller actually has @@ -112613,149 +114721,10 @@ index 6351fe7f8e314ac5ebb102dd20847b383fd5b857..28745af5aadf3cb91fa7ff39118385c3 }, }; -From 42c81d4671d9b7b4a8721e4c0464c946bb3db864 Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Tue, 7 Mar 2017 12:18:20 +0000 -Subject: [PATCH 113/201] BCM270X_DT: Invert Pi3 power LED to match fw change - -Firmware expgpio driver reworked due to complaint over -hotplug detect. -Requires power LED to change sense as firmware is no longer -inverting the read value. - -Signed-off-by: Dave Stevenson ---- - arch/arm/boot/dts/bcm2710-rpi-3-b.dts | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/arch/arm/boot/dts/bcm2710-rpi-3-b.dts b/arch/arm/boot/dts/bcm2710-rpi-3-b.dts -index 616cfd5c7094596b497101e8feca25e25e77c3e8..9f001bccb8261563dcddd8dec94b056b55308c6d 100644 ---- a/arch/arm/boot/dts/bcm2710-rpi-3-b.dts -+++ b/arch/arm/boot/dts/bcm2710-rpi-3-b.dts -@@ -175,7 +175,7 @@ - pwr_led: pwr { - label = "led1"; - linux,default-trigger = "input"; -- gpios = <&expgpio 7 GPIO_ACTIVE_LOW>; -+ gpios = <&expgpio 7 0>; - }; - }; - - -From d7fd208b7f2957ea3e41be34e521c67713a51476 Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Tue, 14 Mar 2017 14:23:06 +0000 -Subject: [PATCH 114/201] bcm2835-gpio-exp: Copy/paste error adding base twice - -brcmexp_gpio_set was adding gpio->gc.base to the offset -twice, so passing an invalid number to the mailbox service. -The firmware treated it modulo-8 anyway, but was logging an -assert every time. - -Signed-off-by: Dave Stevenson ---- - drivers/gpio/gpio-bcm-exp.c | 2 -- - 1 file changed, 2 deletions(-) - -diff --git a/drivers/gpio/gpio-bcm-exp.c b/drivers/gpio/gpio-bcm-exp.c -index 681a91492d4c33bdfd42416e069218e8611cc4d9..d68adafaee4ad406f45f4ff0d6b7c1ad5d10e330 100644 ---- a/drivers/gpio/gpio-bcm-exp.c -+++ b/drivers/gpio/gpio-bcm-exp.c -@@ -165,8 +165,6 @@ static void brcmexp_gpio_set(struct gpio_chip *gc, unsigned int off, int val) - - gpio = container_of(gc, struct brcmexp_gpio, gc); - -- off += gpio->gc.base; -- - set.gpio = off + gpio->gc.base; /* GPIO to update */ - set.state = val; /* Output state */ - - -From 430bbe57900cb7729f5012984ae60caaef27d2fa Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Fri, 17 Mar 2017 13:40:41 +0000 -Subject: [PATCH 115/201] config: disable MMC driver temporarily for now. - -Currently causes a breakage to sdhost driver. However when MMC is disabled Pi3 wifi will not work ---- - arch/arm/configs/bcm2709_defconfig | 2 -- - arch/arm/configs/bcmrpi_defconfig | 2 -- - 2 files changed, 4 deletions(-) - -diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig -index 667755d0d8bcf6dd39fc80e19696a120ea61fe01..b6ef78d6af1b21758d82e8e906ec33b71426ab98 100644 ---- a/arch/arm/configs/bcm2709_defconfig -+++ b/arch/arm/configs/bcm2709_defconfig -@@ -1046,8 +1046,6 @@ CONFIG_USB_XUSBATM=m - CONFIG_USB_GADGET=m - CONFIG_MMC=y - CONFIG_MMC_BLOCK_MINORS=32 --CONFIG_MMC_BCM2835=y --CONFIG_MMC_BCM2835_DMA=y - CONFIG_MMC_BCM2835_SDHOST=y - CONFIG_MMC_SDHCI=y - CONFIG_MMC_SDHCI_PLTFM=y -diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index 046f3e8757ef0f794c802171690528d31fee9deb..f2e0a58a96c8550f110c5940bf65f4d022cc4548 100644 ---- a/arch/arm/configs/bcmrpi_defconfig -+++ b/arch/arm/configs/bcmrpi_defconfig -@@ -1053,8 +1053,6 @@ CONFIG_USB_G_HID=m - CONFIG_USB_G_WEBCAM=m - CONFIG_MMC=y - CONFIG_MMC_BLOCK_MINORS=32 --CONFIG_MMC_BCM2835=y --CONFIG_MMC_BCM2835_DMA=y - CONFIG_MMC_BCM2835_SDHOST=y - CONFIG_MMC_SDHCI=y - CONFIG_MMC_SDHCI_PLTFM=y - -From d46a9a09b86d2ad1779a690249b7446a37dc0ac4 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Fri, 17 Mar 2017 12:24:41 +0000 -Subject: [PATCH 116/201] config: Make spidev a loadable module - -spidev isn't required early in the boot process, and not all users -need it (spi_bcm2835 is a module), so make it a loadable module. - -See: https://github.com/raspberrypi/linux/issues/1897 - -Signed-off-by: Phil Elwell ---- - arch/arm/configs/bcm2709_defconfig | 2 +- - arch/arm/configs/bcmrpi_defconfig | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig -index b6ef78d6af1b21758d82e8e906ec33b71426ab98..8198d4f73e231e49204b344ac296f818a8ae765b 100644 ---- a/arch/arm/configs/bcm2709_defconfig -+++ b/arch/arm/configs/bcm2709_defconfig -@@ -615,7 +615,7 @@ CONFIG_I2C_GPIO=m - CONFIG_SPI=y - CONFIG_SPI_BCM2835=m - CONFIG_SPI_BCM2835AUX=m --CONFIG_SPI_SPIDEV=y -+CONFIG_SPI_SPIDEV=m - CONFIG_PPS=m - CONFIG_PPS_CLIENT_LDISC=m - CONFIG_PPS_CLIENT_GPIO=m -diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index f2e0a58a96c8550f110c5940bf65f4d022cc4548..9eb7084f440c8aac0c6257ee678007c23990a8ae 100644 ---- a/arch/arm/configs/bcmrpi_defconfig -+++ b/arch/arm/configs/bcmrpi_defconfig -@@ -611,7 +611,7 @@ CONFIG_I2C_GPIO=m - CONFIG_SPI=y - CONFIG_SPI_BCM2835=m - CONFIG_SPI_BCM2835AUX=m --CONFIG_SPI_SPIDEV=y -+CONFIG_SPI_SPIDEV=m - CONFIG_PPS=m - CONFIG_PPS_CLIENT_LDISC=m - CONFIG_PPS_CLIENT_GPIO=m - -From be3d281a9b16919784a98bd20b06f81e8479d9f7 Mon Sep 17 00:00:00 2001 +From 50c1a2e2cb0dc9c572c69f42657a83b4e33ca3f7 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 23 Mar 2017 10:06:56 +0000 -Subject: [PATCH 117/201] ASoC: Add prompt for ICS43432 codec +Subject: [PATCH 113/134] 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 @@ -112767,10 +114736,10 @@ Signed-off-by: Phil Elwell 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig -index 55812b0b884cf4fc4e86680b11fedd11c863db7a..428dc05edbb99f50560b7f89e45501c5e8a0e583 100644 +index adf3b7b75e303430d6a03a2b457d389596f39c1a..ba4a36dd0196e8eece5e22ad6717c18921846985 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig -@@ -550,7 +550,7 @@ config SND_SOC_HDAC_HDMI +@@ -568,7 +568,7 @@ config SND_SOC_HDAC_HDMI select HDMI config SND_SOC_ICS43432 @@ -112780,10 +114749,10 @@ index 55812b0b884cf4fc4e86680b11fedd11c863db7a..428dc05edbb99f50560b7f89e45501c5 config SND_SOC_INNO_RK3036 tristate "Inno codec driver for RK3036 SoC" -From e3ec690e42800840b7450f8563e038ef55e044e5 Mon Sep 17 00:00:00 2001 +From e31bf57f91f41b06d092fc0093b464ca1f6b01b3 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Thu, 23 Mar 2017 16:34:46 +0000 -Subject: [PATCH 118/201] bcm2835-aux: Add aux interrupt controller +Subject: [PATCH 114/134] 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 @@ -112947,100 +114916,10 @@ index bd750cf2238d61489811e7d7bd3b5f9950ed53c8..41e0702fae4692221980b0d02aed1ba6 BCM2835_AUX_CLOCK_COUNT, GFP_KERNEL); if (!onecell) -From 65ced2543bcb8f74b699a01130aa22a80ed2847a Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Thu, 23 Mar 2017 17:08:44 +0000 -Subject: [PATCH 119/201] BCM270X_DT: Enable AUX interrupt controller in DT - -See: https://github.com/raspberrypi/linux/issues/1484 - https://github.com/raspberrypi/linux/issues/1573 - -Signed-off-by: Phil Elwell ---- - arch/arm/boot/dts/bcm283x.dtsi | 12 +++++++++--- - 1 file changed, 9 insertions(+), 3 deletions(-) - -diff --git a/arch/arm/boot/dts/bcm283x.dtsi b/arch/arm/boot/dts/bcm283x.dtsi -index 72cb9dc60ca9ad9aa2813972a299c50dcea7cd89..ca47b23ffbcd06063e0fb7072dc8a843b20256e3 100644 ---- a/arch/arm/boot/dts/bcm283x.dtsi -+++ b/arch/arm/boot/dts/bcm283x.dtsi -@@ -403,12 +403,16 @@ - #clock-cells = <1>; - reg = <0x7e215000 0x8>; - clocks = <&clocks BCM2835_CLOCK_VPU>; -+ interrupts = <1 29>; -+ interrupt-controller; -+ #interrupt-cells = <1>; - }; - - uart1: serial@7e215040 { - compatible = "brcm,bcm2835-aux-uart"; - reg = <0x7e215040 0x40>; -- interrupts = <1 29>; -+ interrupt-parent = <&aux>; -+ interrupts = <0>; - clocks = <&aux BCM2835_AUX_CLOCK_UART>; - status = "disabled"; - }; -@@ -416,7 +420,8 @@ - spi1: spi@7e215080 { - compatible = "brcm,bcm2835-aux-spi"; - reg = <0x7e215080 0x40>; -- interrupts = <1 29>; -+ interrupt-parent = <&aux>; -+ interrupts = <1>; - clocks = <&aux BCM2835_AUX_CLOCK_SPI1>; - #address-cells = <1>; - #size-cells = <0>; -@@ -426,7 +431,8 @@ - spi2: spi@7e2150c0 { - compatible = "brcm,bcm2835-aux-spi"; - reg = <0x7e2150c0 0x40>; -- interrupts = <1 29>; -+ interrupt-parent = <&aux>; -+ interrupts = <2>; - clocks = <&aux BCM2835_AUX_CLOCK_SPI2>; - #address-cells = <1>; - #size-cells = <0>; - -From abbd6dc151db83102f9b2658c9d8a1f6df9d3ae4 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Mon, 27 Mar 2017 17:40:45 +0100 -Subject: [PATCH 120/201] mkknlimg: Find some more downstream-only strings - -See: https://github.com/raspberrypi/linux/issues/1920 - -Signed-off-by: Phil Elwell ---- - scripts/mkknlimg | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/scripts/mkknlimg b/scripts/mkknlimg -index 60206de7fa9a49bd027c635306674a29a568652f..84be2593ec1de8f97b0167ff06b3e05d231c4ba0 100755 ---- a/scripts/mkknlimg -+++ b/scripts/mkknlimg -@@ -68,7 +68,7 @@ if (! -r $kernel_file) - - my $wanted_strings = - { -- 'bcm2708_fb' => FLAG_PI, -+ 'bcm2708_fb' => FLAG_PI | FLAG_270X, - 'brcm,bcm2835-mmc' => FLAG_PI, - 'brcm,bcm2835-sdhost' => FLAG_PI, - 'brcm,bcm2708-pinctrl' => FLAG_PI | FLAG_DTOK, -@@ -79,6 +79,7 @@ my $wanted_strings = - 'brcm,bcm2836' => FLAG_PI | FLAG_DTOK | FLAG_283X, - 'of_cfs_init' => FLAG_DTOK | FLAG_DDTK, - 'vc_cma_init' => FLAG_PI | FLAG_270X, -+ 'vc-mem' => FLAG_PI | FLAG_270X, - }; - - my $res = try_extract($kernel_file, $tmpfile1); - -From 0576ff6316d0970cf5671f94683d8d17550ea85b Mon Sep 17 00:00:00 2001 +From 0c93163f0b638831d331b8284eb43396c38305b6 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Fri, 29 Apr 2016 10:32:17 -0700 -Subject: [PATCH 121/201] mmc: read mmc alias from device tree +Subject: [PATCH 115/134] mmc: read mmc alias from device tree To get the SD/MMC host device ID, read the alias from the device tree. @@ -113097,84 +114976,10 @@ index 3f8c85d5aa094b43666904c7dbbe5e62c9763c19..4dbd0e8e27a496bfbe67d188cf795ecc kfree(host); return NULL; -From 4c629002cae81fc2db929518cc730f4b61f0831e Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Wed, 29 Mar 2017 14:30:42 +0100 -Subject: [PATCH 122/201] BCM270X_DT: Add numbered aliases for SD/MMC devices - -In order to force a specific ID assignment to SD/MMC devices, add -numbered aliases to the DT: sdhost -> mmc0, mmc -> mmc1 - -Signed-off-by: Phil Elwell ---- - arch/arm/boot/dts/bcm2708-rpi.dtsi | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/arch/arm/boot/dts/bcm2708-rpi.dtsi b/arch/arm/boot/dts/bcm2708-rpi.dtsi -index ef14e9ac6cd2092efb1681682dd2d3c52b8abfd5..693d4c04a36d2a7883cc3d8916bf0efbd6b782b5 100644 ---- a/arch/arm/boot/dts/bcm2708-rpi.dtsi -+++ b/arch/arm/boot/dts/bcm2708-rpi.dtsi -@@ -21,6 +21,7 @@ - gpio = &gpio; - uart0 = &uart0; - sdhost = &sdhost; -+ mmc0 = &sdhost; - i2s = &i2s; - spi0 = &spi0; - i2c0 = &i2c0; -@@ -28,6 +29,7 @@ - spi1 = &spi1; - spi2 = &spi2; - mmc = &mmc; -+ mmc1 = &mmc; - i2c1 = &i2c1; - i2c2 = &i2c2; - usb = &usb; - -From baacb7bf2f6bc0ea1c4ef151671f89c0b40c2fd0 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Wed, 29 Mar 2017 14:28:53 +0100 -Subject: [PATCH 123/201] config: Re-enable the bcm2835-mmc driver - -With the patch to assign mmc device IDs based on DT aliases and -appropriate aliases in the rpi DTBs, it is now safe to re-enable -the bcm2835-mmc driver. - -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 8198d4f73e231e49204b344ac296f818a8ae765b..8163d3cf93032b78fd90af7335b2d1d046a626ff 100644 ---- a/arch/arm/configs/bcm2709_defconfig -+++ b/arch/arm/configs/bcm2709_defconfig -@@ -1046,6 +1046,7 @@ CONFIG_USB_XUSBATM=m - CONFIG_USB_GADGET=m - CONFIG_MMC=y - CONFIG_MMC_BLOCK_MINORS=32 -+CONFIG_MMC_BCM2835=y - CONFIG_MMC_BCM2835_SDHOST=y - CONFIG_MMC_SDHCI=y - CONFIG_MMC_SDHCI_PLTFM=y -diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index 9eb7084f440c8aac0c6257ee678007c23990a8ae..021c38a909e71baa135cbcd4f3fb80fad2151647 100644 ---- a/arch/arm/configs/bcmrpi_defconfig -+++ b/arch/arm/configs/bcmrpi_defconfig -@@ -1053,6 +1053,7 @@ CONFIG_USB_G_HID=m - CONFIG_USB_G_WEBCAM=m - CONFIG_MMC=y - CONFIG_MMC_BLOCK_MINORS=32 -+CONFIG_MMC_BCM2835=y - CONFIG_MMC_BCM2835_SDHOST=y - CONFIG_MMC_SDHCI=y - CONFIG_MMC_SDHCI_PLTFM=y - -From 3c6a38697311d4caf3b09b2006dad24665b189d6 Mon Sep 17 00:00:00 2001 +From 2d57e1d93c7596058a6f08f21ce74b45f54a4f5d Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Wed, 11 May 2016 12:50:33 +0100 -Subject: [PATCH 124/201] mmc: Add MMC_QUIRK_ERASE_BROKEN for some cards +Subject: [PATCH 116/134] mmc: Add MMC_QUIRK_ERASE_BROKEN for some cards Some SD cards have been found that corrupt data when small blocks are erased. Add a quirk to indicate that ERASE should not be used, @@ -113200,11 +115005,11 @@ Signed-off-by: Phil Elwell drivers/mmc/core/block.c | 28 +++++++++++++++++++++++++--- drivers/mmc/core/core.c | 3 ++- drivers/mmc/core/quirks.h | 11 +++++++++++ - include/linux/mmc/card.h | 4 ++++ - 4 files changed, 42 insertions(+), 4 deletions(-) + include/linux/mmc/card.h | 2 ++ + 4 files changed, 40 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c -index ff3da960c4736147b2c1348681412953508ac49b..005afc96473037242c8e7f96ade877b4772515ef 100644 +index 8273b078686d0a939d1c5dc1b6ce58e8c72ef94a..2c58fe3bb34f25dc9bbb4bc161baa6e63a362bb2 100644 --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c @@ -125,6 +125,13 @@ static DEFINE_MUTEX(open_lock); @@ -113221,15 +115026,15 @@ index ff3da960c4736147b2c1348681412953508ac49b..005afc96473037242c8e7f96ade877b4 static inline int mmc_blk_part_switch(struct mmc_card *card, struct mmc_blk_data *md); static int get_card_status(struct mmc_card *card, u32 *status, int retries); -@@ -2105,6 +2112,7 @@ static int mmc_blk_probe(struct mmc_card *card) - { +@@ -2167,6 +2174,7 @@ static int mmc_blk_probe(struct mmc_card *card) struct mmc_blk_data *md, *part_md; char cap_str[10]; + int ret; + char quirk_str[24]; /* * Check that the card supports the command class(es) we need. -@@ -2112,7 +2120,16 @@ static int mmc_blk_probe(struct mmc_card *card) +@@ -2174,7 +2182,16 @@ static int mmc_blk_probe(struct mmc_card *card) if (!(card->csd.cmdclass & CCC_BLOCK_READ)) return -ENODEV; @@ -113245,9 +115050,9 @@ index ff3da960c4736147b2c1348681412953508ac49b..005afc96473037242c8e7f96ade877b4 + else + mmc_fixup_device(card, mmc_blk_fixups); - md = mmc_blk_alloc(card); - if (IS_ERR(md)) -@@ -2120,9 +2137,14 @@ static int mmc_blk_probe(struct mmc_card *card) + ret = mmc_queue_alloc_shared_queue(card); + if (ret) +@@ -2188,9 +2205,14 @@ static int mmc_blk_probe(struct mmc_card *card) string_get_size((u64)get_capacity(md->disk), 512, STRING_UNITS_2, cap_str, sizeof(cap_str)); @@ -113265,10 +115070,10 @@ index ff3da960c4736147b2c1348681412953508ac49b..005afc96473037242c8e7f96ade877b4 if (mmc_blk_alloc_parts(card, md)) goto out; diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c -index 926e0fde07d75a441f11ade4c10457bd7dde4ad2..e033394657585325a887e0f0fdfa9e2a299bc747 100644 +index 82c45ddfa2023cd2e6d69218fb3c232a9c14d680..d28020552a9dd77c33277de5ab1eaf68b37b576b 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c -@@ -2392,7 +2392,8 @@ EXPORT_SYMBOL(mmc_erase); +@@ -2397,7 +2397,8 @@ EXPORT_SYMBOL(mmc_erase); int mmc_can_erase(struct mmc_card *card) { if ((card->host->caps & MMC_CAP_ERASE) && @@ -113301,3715 +115106,23 @@ index fb725934fa21cee1b98fd7bc08227bf6d0317549..05c8d7381fff5ae88531129d9a5ddd55 }; diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h -index 77e61e0a216a2728dd5cfecf55299402ac03c384..d12e8ddd22cb96e38b30f1ac3f9a6bd027cf9cc4 100644 +index aad015e0152b7f1d32f92c500825b723498d1be9..d44a9c84a90a02388c05a427814fb8fca3d9e283 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h -@@ -267,6 +267,10 @@ struct mmc_card { +@@ -269,6 +269,8 @@ struct mmc_card { #define MMC_QUIRK_TRIM_BROKEN (1<<12) /* Skip trim */ #define MMC_QUIRK_BROKEN_HPI (1<<13) /* Disable broken HPI support */ -+ +#define MMC_QUIRK_ERASE_BROKEN (1<<31) /* Skip erase */ + -+ + bool reenable_cmdq; /* Re-enable Command Queue */ + unsigned int erase_size; /* erase size in sectors */ - unsigned int erase_shift; /* if erase unit is power 2 */ - unsigned int pref_erase; /* in sectors */ -From 2d5e9dbf7e358680f3f579ed6f28753197bc9c55 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Wed, 29 Mar 2017 16:08:29 +0100 -Subject: [PATCH 125/201] bcm2835-sdhost: mmc_card_blockaddr fix - -Get the definition of mmc_card_blockaddr from drivers/mmc/core/card.h. - -Signed-off-by: Phil Elwell ---- - drivers/mmc/host/bcm2835-sdhost.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/drivers/mmc/host/bcm2835-sdhost.c b/drivers/mmc/host/bcm2835-sdhost.c -index a9bc79bfdbb71807819dfe2d8f1651445997f92a..9c6f199a7830959f31012d86bc1f8b1a9922185f 100644 ---- a/drivers/mmc/host/bcm2835-sdhost.c -+++ b/drivers/mmc/host/bcm2835-sdhost.c -@@ -51,8 +51,12 @@ - #include - #include - #include -+#include - #include - -+/* For mmc_card_blockaddr */ -+#include "../core/card.h" -+ - #define DRIVER_NAME "sdhost-bcm2835" - - #define SDCMD 0x00 /* Command to SD card - 16 R/W */ - -From 21102cc21b540986adf8f79be1c12f0ec4927a55 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Mon, 13 Mar 2017 12:30:37 +0000 -Subject: [PATCH 126/201] thermal: Compatible strings for bcm2836, bcm2837 - -The upstream dt-bindings documentation for bcm2835-thermal (which -exists even though the driver isn't upstreamed) says to use -dedicated compatible strings on bcm2836 and bcm2837, even though -the downstream driver doesn't support them. The Pi2 DTB uses -"brcm,bcm2836-thermal", so the driver doesn't load. The Pi3 DTB -doesn't override the base value, but the arm64 Pi3 support uses "brcm,bcm2837-thermal". - -Solve the documentation problem by adding "brcm,bcm2836-thermal" and -"brcm,bcm2837-thermal" as alternative compatible strings for the -bcm2835-thermal driver. - -Signed-off-by: Phil Elwell ---- - drivers/thermal/bcm2835-thermal.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/drivers/thermal/bcm2835-thermal.c b/drivers/thermal/bcm2835-thermal.c -index c63fb9f9d143e19612a18fe530c7b2b3518a22a4..25b78c3eac1503fbc9e679b963a6284b673b2ed3 100644 ---- a/drivers/thermal/bcm2835-thermal.c -+++ b/drivers/thermal/bcm2835-thermal.c -@@ -89,6 +89,8 @@ static int bcm2835_thermal_remove(struct platform_device *pdev) - - static const struct of_device_id bcm2835_thermal_of_match_table[] = { - { .compatible = "brcm,bcm2835-thermal", }, -+ { .compatible = "brcm,bcm2836-thermal", }, -+ { .compatible = "brcm,bcm2837-thermal", }, - {}, - }; - MODULE_DEVICE_TABLE(of, bcm2835_thermal_of_match_table); - -From 5f0047f6787b37d947c1f5ec26abce85d666f61e Mon Sep 17 00:00:00 2001 -From: John Greb -Date: Wed, 8 Mar 2017 15:12:29 +0000 -Subject: [PATCH 127/201] Match dwc2 device-tree fifo sizes to the hardware - values. - -Since commit aa381a7259c3f53727bcaa8c5f9359e940a0e3fd was reverted with 3fa9538539ac737096c81f3315a14670b1609092 the g-tx-fifo-size array in the device-tree needs to match the preset values in the bcm2835. - -Resolves https://github.com/raspberrypi/linux/issues/1876 ---- - arch/arm/boot/dts/overlays/dwc2-overlay.dts | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/arch/arm/boot/dts/overlays/dwc2-overlay.dts b/arch/arm/boot/dts/overlays/dwc2-overlay.dts -index 527abc9f0ddf71f4dc7d58336d87684c931cc2f3..265a16bab008453edba198cf2366c423509d60d6 100644 ---- a/arch/arm/boot/dts/overlays/dwc2-overlay.dts -+++ b/arch/arm/boot/dts/overlays/dwc2-overlay.dts -@@ -15,7 +15,7 @@ - dr_mode = "otg"; - g-np-tx-fifo-size = <32>; - g-rx-fifo-size = <256>; -- g-tx-fifo-size = <256 128 128 64 64 64 32>; -+ g-tx-fifo-size = <512 512 512 512 512 768>; - status = "okay"; - }; - }; -@@ -24,6 +24,5 @@ - dr_mode = <&dwc2_usb>, "dr_mode"; - g-np-tx-fifo-size = <&dwc2_usb>,"g-np-tx-fifo-size:0"; - g-rx-fifo-size = <&dwc2_usb>,"g-rx-fifo-size:0"; -- g-tx-fifo-size = <&dwc2_usb>,"g-tx-fifo-size:0"; - }; - }; - -From dfc2e748155ab51c321822ae25c8b029b4e8da86 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Tue, 14 Mar 2017 09:10:05 +0000 -Subject: [PATCH 128/201] BCM270X_DT: Add lm75 to i2c-sensor overlay - -See: https://www.raspberrypi.org/forums/viewtopic.php?f=107&t=177236 - -Signed-off-by: Phil Elwell ---- - arch/arm/boot/dts/overlays/README | 8 +++++--- - arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts | 8 ++++++++ - 2 files changed, 13 insertions(+), 3 deletions(-) - -diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README -index c1883bba938290f03826026651c764cfd4ac278b..a8853b7820cd7a333cdaa2421f770a834dc724d5 100644 ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -388,9 +388,6 @@ Params: dr_mode Dual role mode: "host", "peripheral" or "otg" - g-np-tx-fifo-size Size of non-periodic tx fifo size in gadget - mode - -- g-tx-fifo-size Size of periodic tx fifo per endpoint -- (except ep0) in gadget mode -- - - [ The ds1307-rtc overlay has been deleted. See i2c-rtc. ] - -@@ -608,6 +605,11 @@ Params: bmp085 Select the Bosch sensortronic BMP085 - - bmp280 Select the Bosch sensortronic BMP280 - -+ lm75 Select the Maxim LM75 temperature sensor -+ -+ lm75addr Choose the address for the LM75 (0x48-0x4f - -+ default 0x4f) -+ - si7020 Select the Silicon Labs Si7013/20/21 humidity/ - temperature sensor - -diff --git a/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts b/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts -index 31bda8da4cb6a56bfe493a81b918900995fb0589..606b2d5012abf2e85712be631c42ea40a0b512c5 100644 ---- a/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts -+++ b/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts -@@ -25,6 +25,12 @@ - status = "disable"; - }; - -+ lm75: lm75@4f { -+ compatible = "lm75"; -+ reg = <0x4f>; -+ status = "disable"; -+ }; -+ - si7020: si7020@40 { - compatible = "si7020"; - reg = <0x40>; -@@ -36,6 +42,8 @@ - __overrides__ { - bmp085 = <&bmp085>,"status"; - bmp280 = <&bmp280>,"status"; -+ lm75 = <&lm75>,"status"; -+ lm75addr = <&lm75>,"reg:0"; - si7020 = <&si7020>,"status"; - }; - }; - -From ca1e3e29abfcde95a217355f034984324bb4e0d8 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Tue, 28 Mar 2017 14:22:20 +0100 -Subject: [PATCH 129/201] BCM270X_DT: Allow multiple instances of w1-gpio - overlays - -Upcoming firmware will modify the address portion of node names when -their "reg" property is written by a dtparam. Modify the w1-gpio -overlays to write the gpiopin parameter value to "reg" properties, so -that multiple instances can be loaded simultaneously. - -Note: The value of the "address" is unimportant - the w1 subsystem -assigns instance numbers to buses sequentially from 1, and it is -not necessary to know which bus a device is on in order to find it. ---- - arch/arm/boot/dts/overlays/w1-gpio-overlay.dts | 6 ++++-- - arch/arm/boot/dts/overlays/w1-gpio-pullup-overlay.dts | 6 ++++-- - 2 files changed, 8 insertions(+), 4 deletions(-) - -diff --git a/arch/arm/boot/dts/overlays/w1-gpio-overlay.dts b/arch/arm/boot/dts/overlays/w1-gpio-overlay.dts -index 29a3b48d19ab36b814c09e4cc4eef6d9e2022da1..f7f8747512653465d01dd1c41a0fcbd2e3e5fbdb 100644 ---- a/arch/arm/boot/dts/overlays/w1-gpio-overlay.dts -+++ b/arch/arm/boot/dts/overlays/w1-gpio-overlay.dts -@@ -23,7 +23,7 @@ - fragment@1 { - target = <&gpio>; - __overlay__ { -- w1_pins: w1_pins { -+ w1_pins: w1_pins@0 { - brcm,pins = <4>; - brcm,function = <0>; // in (initially) - brcm,pull = <0>; // off -@@ -33,7 +33,9 @@ - - __overrides__ { - gpiopin = <&w1>,"gpios:4", -- <&w1_pins>,"brcm,pins:0"; -+ <&w1>,"reg:0", -+ <&w1_pins>,"brcm,pins:0", -+ <&w1_pins>,"reg:0"; - pullup = <&w1>,"rpi,parasitic-power:0"; - }; - }; -diff --git a/arch/arm/boot/dts/overlays/w1-gpio-pullup-overlay.dts b/arch/arm/boot/dts/overlays/w1-gpio-pullup-overlay.dts -index 66a98f6c9601f51483f27803995bec772bb3350e..ef8bfbcabdb31231075d5c281df3b38b1b857c7c 100644 ---- a/arch/arm/boot/dts/overlays/w1-gpio-pullup-overlay.dts -+++ b/arch/arm/boot/dts/overlays/w1-gpio-pullup-overlay.dts -@@ -23,7 +23,7 @@ - fragment@1 { - target = <&gpio>; - __overlay__ { -- w1_pins: w1_pins { -+ w1_pins: w1_pins@0 { - brcm,pins = <4 5>; - brcm,function = <0 1>; // in out - brcm,pull = <0 0>; // off off -@@ -33,7 +33,9 @@ - - __overrides__ { - gpiopin = <&w1>,"gpios:4", -- <&w1_pins>,"brcm,pins:0"; -+ <&w1>,"reg:0", -+ <&w1_pins>,"brcm,pins:0", -+ <&w1_pins>,"reg:0"; - extpullup = <&w1>,"gpios:16", - <&w1_pins>,"brcm,pins:4"; - pullup = <&w1>,"rpi,parasitic-power:0"; - -From 74faddaea26af584c0ee05f8af5545982035a16a Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Tue, 28 Mar 2017 17:41:30 +0100 -Subject: [PATCH 130/201] leds-gpio: Remove stray assignment to brightness_set - -The brightness_set method is intended for use cases that must not -block, and can only be used if the GPIO provider can never sleep. -Remove an accidental initialisation (a copy-and-paste error) that -sets it regardless, which has been seen to cause crashes with the -gpio expander driver. - -Signed-off-by: Phil Elwell ---- - drivers/leds/leds-gpio.c | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c -index 934cdb1d7bc7f12a4fb06a5c458ad76727c7b7c7..a4df27f6af35ba7f7b34c2a4b7b22ee7552264f0 100644 ---- a/drivers/leds/leds-gpio.c -+++ b/drivers/leds/leds-gpio.c -@@ -136,7 +136,6 @@ static int create_gpio_led(const struct gpio_led *template, - led_dat->platform_gpio_blink_set = blink_set; - led_dat->cdev.blink_set = gpio_blink_set; - } -- led_dat->cdev.brightness_set = gpio_led_set; - led_dat->cdev.brightness_get = gpio_led_get; - if (template->default_state == LEDS_GPIO_DEFSTATE_KEEP) { - state = gpiod_get_value_cansleep(led_dat->gpiod); - -From 4c6f935bb8c2744741de8c664123e3f84ac1f07a Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Wed, 29 Mar 2017 17:41:04 +0100 -Subject: [PATCH 131/201] config: Add back MMC_BCM2835_DMA - ---- - 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 8163d3cf93032b78fd90af7335b2d1d046a626ff..e565c344016c0bf87640853dc81cda074e3ab2ee 100644 ---- a/arch/arm/configs/bcm2709_defconfig -+++ b/arch/arm/configs/bcm2709_defconfig -@@ -1047,6 +1047,7 @@ CONFIG_USB_GADGET=m - CONFIG_MMC=y - CONFIG_MMC_BLOCK_MINORS=32 - CONFIG_MMC_BCM2835=y -+CONFIG_MMC_BCM2835_DMA=y - CONFIG_MMC_BCM2835_SDHOST=y - CONFIG_MMC_SDHCI=y - CONFIG_MMC_SDHCI_PLTFM=y -diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index 021c38a909e71baa135cbcd4f3fb80fad2151647..a8fc96ef674be476d10e59aef2367def40518f03 100644 ---- a/arch/arm/configs/bcmrpi_defconfig -+++ b/arch/arm/configs/bcmrpi_defconfig -@@ -1054,6 +1054,7 @@ CONFIG_USB_G_WEBCAM=m - CONFIG_MMC=y - CONFIG_MMC_BLOCK_MINORS=32 - CONFIG_MMC_BCM2835=y -+CONFIG_MMC_BCM2835_DMA=y - CONFIG_MMC_BCM2835_SDHOST=y - CONFIG_MMC_SDHCI=y - CONFIG_MMC_SDHCI_PLTFM=y - -From 44e5fa590b1e66387a1b3958a37e516651c95a9a Mon Sep 17 00:00:00 2001 -From: Matt Flax -Date: Mon, 27 Mar 2017 22:26:49 +1100 -Subject: [PATCH 132/201] AudioInjector Octo: sample rates, regulators, reset - -This patch adds new sample rates to the Audioinjector Octo sound card. The -new supported rates are (in kHz) : -96, 48, 32, 24, 16, 8, 88.2, 44.1, 29.4, 22.05, 14.7 - -Reference the bcm270x DT regulators in the overlay. - -This patch adds a reset GPIO for the AudioInjector.net octo sound card. ---- - .../dts/overlays/audioinjector-addons-overlay.dts | 5 ++ - sound/soc/bcm/audioinjector-octo-soundcard.c | 81 ++++++++++++++++++---- - 2 files changed, 72 insertions(+), 14 deletions(-) - -diff --git a/arch/arm/boot/dts/overlays/audioinjector-addons-overlay.dts b/arch/arm/boot/dts/overlays/audioinjector-addons-overlay.dts -index dbf2f3cacc2e6bf5b7116fbadd97f2781580a79c..a40bb1193a4cebc5672709e8db861e1167d3a699 100644 ---- a/arch/arm/boot/dts/overlays/audioinjector-addons-overlay.dts -+++ b/arch/arm/boot/dts/overlays/audioinjector-addons-overlay.dts -@@ -25,6 +25,10 @@ - reg = <0x48>; - clocks = <&cs42448_mclk>; - clock-names = "mclk"; -+ VA-supply = <&vdd_5v0_reg>; -+ VD-supply = <&vdd_3v3_reg>; -+ VLS-supply = <&vdd_3v3_reg>; -+ VLC-supply = <&vdd_3v3_reg>; - status = "okay"; - }; - -@@ -42,6 +46,7 @@ - compatible = "ai,audioinjector-octo-soundcard"; - mult-gpios = <&gpio 27 0>, <&gpio 22 0>, <&gpio 23 0>, - <&gpio 24 0>; -+ reset-gpios = <&gpio 5 0>; - i2s-controller = <&i2s>; - codec = <&cs42448>; - status = "okay"; -diff --git a/sound/soc/bcm/audioinjector-octo-soundcard.c b/sound/soc/bcm/audioinjector-octo-soundcard.c -index 9effea725798640887755dfa688da45338718afc..dcf403ab37639ba79e38278d7e4b1ade452c292a 100644 ---- a/sound/soc/bcm/audioinjector-octo-soundcard.c -+++ b/sound/soc/bcm/audioinjector-octo-soundcard.c -@@ -27,8 +27,18 @@ - #include - - static struct gpio_descs *mult_gpios; -+static struct gpio_desc *codec_rst_gpio; - static unsigned int audioinjector_octo_rate; - -+static const unsigned int audioinjector_octo_rates[] = { -+ 96000, 48000, 32000, 24000, 16000, 8000, 88200, 44100, 29400, 22050, 14700, -+}; -+ -+static struct snd_pcm_hw_constraint_list audioinjector_octo_constraints = { -+ .list = audioinjector_octo_rates, -+ .count = ARRAY_SIZE(audioinjector_octo_rates), -+}; -+ - static int audioinjector_octo_dai_init(struct snd_soc_pcm_runtime *rtd) - { - return snd_soc_dai_set_bclk_ratio(rtd->cpu_dai, 64); -@@ -42,6 +52,11 @@ static int audioinjector_octo_startup(struct snd_pcm_substream *substream) - rtd->cpu_dai->driver->capture.channels_min = 8; - rtd->cpu_dai->driver->capture.channels_max = 8; - rtd->codec_dai->driver->capture.channels_max = 8; -+ -+ snd_pcm_hw_constraint_list(substream->runtime, 0, -+ SNDRV_PCM_HW_PARAM_RATE, -+ &audioinjector_octo_constraints); -+ - return 0; - } - -@@ -76,7 +91,43 @@ static int audioinjector_octo_hw_params(struct snd_pcm_substream *substream, - - audioinjector_octo_rate = params_rate(params); - -- return 0; -+ // Set the correct sysclock for the codec -+ switch (audioinjector_octo_rate) { -+ case 96000: -+ case 48000: -+ return snd_soc_dai_set_sysclk(rtd->codec_dai, 0, 49152000, -+ 0); -+ break; -+ case 24000: -+ return snd_soc_dai_set_sysclk(rtd->codec_dai, 0, 49152000/2, -+ 0); -+ break; -+ case 32000: -+ case 16000: -+ return snd_soc_dai_set_sysclk(rtd->codec_dai, 0, 49152000/3, -+ 0); -+ break; -+ case 8000: -+ return snd_soc_dai_set_sysclk(rtd->codec_dai, 0, 49152000/6, -+ 0); -+ break; -+ case 88200: -+ case 44100: -+ return snd_soc_dai_set_sysclk(rtd->codec_dai, 0, 45185400, -+ 0); -+ break; -+ case 22050: -+ return snd_soc_dai_set_sysclk(rtd->codec_dai, 0, 45185400/2, -+ 0); -+ break; -+ case 29400: -+ case 14700: -+ return snd_soc_dai_set_sysclk(rtd->codec_dai, 0, 45185400/3, -+ 0); -+ break; -+ default: -+ return -EINVAL; -+ } - } - - static int audioinjector_octo_trigger(struct snd_pcm_substream *substream, -@@ -92,25 +143,12 @@ static int audioinjector_octo_trigger(struct snd_pcm_substream *substream, - case SNDRV_PCM_TRIGGER_RESUME: - case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: - switch (audioinjector_octo_rate) { -- case 192000: -- mult[3] = 1; -- case 176640: -- mult[0] = 1; -- mult[1] = 1; -- mult[2] = 1; -- break; - case 96000: - mult[3] = 1; - case 88200: - mult[1] = 1; - mult[2] = 1; - break; -- case 64000: -- mult[3] = 1; -- case 58800: -- mult[0] = 1; -- mult[2] = 1; -- break; - case 48000: - mult[3] = 1; - case 44100: -@@ -231,6 +269,21 @@ static int audioinjector_octo_probe(struct platform_device *pdev) - if (IS_ERR(mult_gpios)) - return PTR_ERR(mult_gpios); - -+ codec_rst_gpio = devm_gpiod_get_optional(&pdev->dev, "reset", -+ GPIOD_OUT_LOW); -+ if (IS_ERR(codec_rst_gpio)) -+ return PTR_ERR(codec_rst_gpio); -+ -+ if (codec_rst_gpio) -+ gpiod_set_value(codec_rst_gpio, 1); -+ msleep(500); -+ if (codec_rst_gpio) -+ gpiod_set_value(codec_rst_gpio, 0); -+ msleep(500); -+ if (codec_rst_gpio) -+ gpiod_set_value(codec_rst_gpio, 1); -+ msleep(500); -+ - if (i2s_node && codec_node) { - dai->cpu_dai_name = NULL; - dai->cpu_of_node = i2s_node; - -From a7bce87623229240e01d3d158a96500b933478f1 Mon Sep 17 00:00:00 2001 -From: Peter Malkin -Date: Mon, 27 Mar 2017 16:38:21 -0700 -Subject: [PATCH 133/201] Driver support for Google voiceHAT soundcard. - ---- - arch/arm/boot/dts/overlays/Makefile | 1 + - arch/arm/boot/dts/overlays/README | 6 + - .../overlays/googlevoicehat-soundcard-overlay.dts | 49 +++++ - arch/arm/configs/bcm2709_defconfig | 1 + - arch/arm/configs/bcmrpi_defconfig | 1 + - sound/soc/bcm/Kconfig | 7 + - sound/soc/bcm/Makefile | 6 + - sound/soc/bcm/googlevoicehat-codec.c | 199 +++++++++++++++++++++ - sound/soc/bcm/googlevoicehat-soundcard.c | 124 +++++++++++++ - 9 files changed, 394 insertions(+) - create mode 100644 arch/arm/boot/dts/overlays/googlevoicehat-soundcard-overlay.dts - create mode 100644 sound/soc/bcm/googlevoicehat-codec.c - create mode 100644 sound/soc/bcm/googlevoicehat-soundcard.c - -diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile -index 0f7340799fb465ba1fb5aaa1e970cbf6295d75c4..2f1cd17697606687fe47cb4e6a25a572611bf241 100644 ---- a/arch/arm/boot/dts/overlays/Makefile -+++ b/arch/arm/boot/dts/overlays/Makefile -@@ -23,6 +23,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ - enc28j60.dtbo \ - enc28j60-spi2.dtbo \ - fe-pi-audio.dtbo \ -+ googlevoicehat-soundcard.dtbo \ - gpio-ir.dtbo \ - gpio-poweroff.dtbo \ - hifiberry-amp.dtbo \ -diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README -index a8853b7820cd7a333cdaa2421f770a834dc724d5..6870e83a2e6acf842259a769d483b0b98c172279 100644 ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -414,6 +414,12 @@ Load: dtoverlay=fe-pi-audio - Params: - - -+Name: googlevoicehat-soundcard -+Info: Configures the Google voiceHAT soundcard -+Load: dtoverlay=googlevoicehat-soundcard -+Params: -+ -+ - Name: gpio-ir - Info: Use GPIO pin as rc-core style infrared receiver input. The rc-core- - based gpio_ir_recv driver maps received keys directly to a -diff --git a/arch/arm/boot/dts/overlays/googlevoicehat-soundcard-overlay.dts b/arch/arm/boot/dts/overlays/googlevoicehat-soundcard-overlay.dts -new file mode 100644 -index 0000000000000000000000000000000000000000..9a9e9a0ca28cf774a868b2882ae57b00de1cf7b7 ---- /dev/null -+++ b/arch/arm/boot/dts/overlays/googlevoicehat-soundcard-overlay.dts -@@ -0,0 +1,49 @@ -+// Definitions for Google voiceHAT v1 soundcard overlay -+/dts-v1/; -+/plugin/; -+ -+/ { -+ compatible = "brcm,bcm2708"; -+ -+ fragment@0 { -+ target = <&i2s>; -+ __overlay__ { -+ status = "okay"; -+ }; -+ }; -+ -+ fragment@1 { -+ target = <&gpio>; -+ __overlay__ { -+ googlevoicehat_pins: googlevoicehat_pins { -+ brcm,pins = <16>; -+ brcm,function = <1>; /* out */ -+ brcm,pull = <0>; /* up */ -+ }; -+ }; -+ }; -+ -+ -+ fragment@2 { -+ target-path = "/"; -+ __overlay__ { -+ voicehat-codec { -+ #sound-dai-cells = <0>; -+ compatible = "google,voicehat"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&googlevoicehat_pins>; -+ sdmode-gpios= <&gpio 16 0>; -+ status = "okay"; -+ }; -+ }; -+ }; -+ -+ fragment@3 { -+ target = <&sound>; -+ __overlay__ { -+ compatible = "googlevoicehat,googlevoicehat-soundcard"; -+ i2s-controller = <&i2s>; -+ status = "okay"; -+ }; -+ }; -+}; -diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig -index e565c344016c0bf87640853dc81cda074e3ab2ee..f68fc97d2a9c28154880b5d55ce90b0b0974acc6 100644 ---- a/arch/arm/configs/bcm2709_defconfig -+++ b/arch/arm/configs/bcm2709_defconfig -@@ -876,6 +876,7 @@ CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m - CONFIG_SND_BCM2708_SOC_IQAUDIO_DIGI=m - CONFIG_SND_BCM2708_SOC_RASPIDAC3=m - CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m -+CONFIG_SND_BCM2708_SOC_GOOGLEVOICEHAT_SOUNDCARD=m - CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m - CONFIG_SND_AUDIOINJECTOR_OCTO_SOUNDCARD=m - CONFIG_SND_DIGIDAC1_SOUNDCARD=m -diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index a8fc96ef674be476d10e59aef2367def40518f03..1a9b95f1b731c48130a0b468d95d533f458cb2d6 100644 ---- a/arch/arm/configs/bcmrpi_defconfig -+++ b/arch/arm/configs/bcmrpi_defconfig -@@ -870,6 +870,7 @@ CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m - CONFIG_SND_BCM2708_SOC_IQAUDIO_DIGI=m - CONFIG_SND_BCM2708_SOC_RASPIDAC3=m - CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m -+CONFIG_SND_BCM2708_SOC_GOOGLEVOICEHAT_SOUNDCARD=m - CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m - CONFIG_SND_AUDIOINJECTOR_OCTO_SOUNDCARD=m - CONFIG_SND_DIGIDAC1_SOUNDCARD=m -diff --git a/sound/soc/bcm/Kconfig b/sound/soc/bcm/Kconfig -index 706c500b5303ac3a0fd8687d23dc9f06c7d08388..cb9edcc96247e47855907da06b14a13695d408df 100644 ---- a/sound/soc/bcm/Kconfig -+++ b/sound/soc/bcm/Kconfig -@@ -18,6 +18,13 @@ config SND_SOC_CYGNUS - - If you don't know what to do here, say N. - -+config SND_BCM2708_SOC_GOOGLEVOICEHAT_SOUNDCARD -+ tristate "Support for Google voiceHAT soundcard" -+ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S -+ select SND_SOC_VOICEHAT -+ help -+ Say Y or M if you want to add support for voiceHAT soundcard. -+ - config SND_BCM2708_SOC_HIFIBERRY_DAC - tristate "Support for HifiBerry DAC" - depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S -diff --git a/sound/soc/bcm/Makefile b/sound/soc/bcm/Makefile -index d448aa517bf994fc0a41580c91b5d87deec9e1b0..e37457f01b263ba47ad884c7e945d33b001d9c66 100644 ---- a/sound/soc/bcm/Makefile -+++ b/sound/soc/bcm/Makefile -@@ -8,8 +8,12 @@ snd-soc-cygnus-objs := cygnus-pcm.o cygnus-ssp.o - - obj-$(CONFIG_SND_SOC_CYGNUS) += snd-soc-cygnus.o - -+# Google voiceHAT custom codec support -+snd-soc-googlevoicehat-codec-objs := googlevoicehat-codec.o -+ - # BCM2708 Machine Support - snd-soc-adau1977-adc-objs := adau1977-adc.o -+snd-soc-googlevoicehat-soundcard-objs := googlevoicehat-soundcard.o - snd-soc-hifiberry-amp-objs := hifiberry_amp.o - snd-soc-hifiberry-dac-objs := hifiberry_dac.o - snd-soc-hifiberry-dacplus-objs := hifiberry_dacplus.o -@@ -32,6 +36,8 @@ snd-soc-pisound-objs := pisound.o - snd-soc-fe-pi-audio-objs := fe-pi-audio.o - - obj-$(CONFIG_SND_BCM2708_SOC_ADAU1977_ADC) += snd-soc-adau1977-adc.o -+obj-$(CONFIG_SND_BCM2708_SOC_GOOGLEVOICEHAT_SOUNDCARD) += snd-soc-googlevoicehat-soundcard.o -+obj-$(CONFIG_SND_BCM2708_SOC_GOOGLEVOICEHAT_SOUNDCARD) += snd-soc-googlevoicehat-codec.o - obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_AMP) += snd-soc-hifiberry-amp.o - obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DAC) += snd-soc-hifiberry-dac.o - obj-$(CONFIG_SND_BCM2708_SOC_HIFIBERRY_DACPLUS) += snd-soc-hifiberry-dacplus.o -diff --git a/sound/soc/bcm/googlevoicehat-codec.c b/sound/soc/bcm/googlevoicehat-codec.c -new file mode 100644 -index 0000000000000000000000000000000000000000..7e31c9c54652cd9bd050028efb82dfc09fd9fced ---- /dev/null -+++ b/sound/soc/bcm/googlevoicehat-codec.c -@@ -0,0 +1,199 @@ -+/* -+ * Driver for the Google voiceHAT audio codec for Raspberry Pi. -+ * -+ * Author: Peter Malkin -+ * Copyright 2016 -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License -+ * version 2 as published by the Free Software Foundation. -+ * -+ * This program is distributed in the hope that it will be useful, but -+ * WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * General Public License for more details. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#define ICS43432_RATE_MIN_HZ 7190 /* from data sheet */ -+#define ICS43432_RATE_MAX_HZ 52800 /* from data sheet */ -+#define SDMODE_DELAY_MS \ -+ 5 /* Delay in enabling SDMODE after clock settles to remove pop */ -+ -+struct voicehat_priv { -+ struct delayed_work enable_sdmode_work; -+ struct gpio_desc *sdmode_gpio; -+ unsigned int sdmode_delay; -+}; -+ -+static void voicehat_enable_sdmode_work(struct work_struct *work) { -+ struct voicehat_priv *voicehat = -+ container_of(work, struct voicehat_priv, enable_sdmode_work.work); -+ gpiod_set_value(voicehat->sdmode_gpio, 1); -+} -+ -+static int voicehat_codec_probe(struct snd_soc_codec *codec) { -+ struct voicehat_priv *voicehat = snd_soc_codec_get_drvdata(codec); -+ -+ voicehat->sdmode_gpio = devm_gpiod_get(codec->dev, "sdmode", GPIOD_OUT_LOW); -+ if (IS_ERR(voicehat->sdmode_gpio)) { -+ dev_err(codec->dev, "Unable to allocate GPIO pin\n"); -+ return PTR_ERR(voicehat->sdmode_gpio); -+ } -+ -+ INIT_DELAYED_WORK(&voicehat->enable_sdmode_work, voicehat_enable_sdmode_work); -+ return 0; -+} -+ -+static int voicehat_codec_remove(struct snd_soc_codec *codec) { -+ struct voicehat_priv *voicehat = snd_soc_codec_get_drvdata(codec); -+ -+ cancel_delayed_work_sync(&voicehat->enable_sdmode_work); -+ -+ return 0; -+} -+ -+static const struct snd_soc_dapm_widget voicehat_dapm_widgets[] = { -+ SND_SOC_DAPM_OUTPUT("Speaker"), -+}; -+ -+static const struct snd_soc_dapm_route voicehat_dapm_routes[] = { -+ {"Speaker", NULL, "HiFi Playback"}, -+}; -+ -+static struct snd_soc_codec_driver voicehat_codec_driver = { -+ .probe = voicehat_codec_probe, -+ .remove = voicehat_codec_remove, -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0) -+ .component_driver = { -+#endif -+ .dapm_widgets = voicehat_dapm_widgets, -+ .num_dapm_widgets = ARRAY_SIZE(voicehat_dapm_widgets), -+ .dapm_routes = voicehat_dapm_routes, -+ .num_dapm_routes = ARRAY_SIZE(voicehat_dapm_routes), -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0) -+ }, -+#endif -+}; -+ -+static int voicehat_daiops_trigger(struct snd_pcm_substream *substream, int cmd, -+ struct snd_soc_dai *dai) { -+ struct snd_soc_codec *codec = dai->codec; -+ struct voicehat_priv *voicehat = snd_soc_codec_get_drvdata(codec); -+ -+ if (voicehat->sdmode_delay == 0) return 0; -+ -+ dev_dbg(dai->dev, "CMD %d", cmd); -+ dev_dbg(dai->dev, "Playback Active %d", dai->playback_active); -+ dev_dbg(dai->dev, "Capture Active %d", dai->capture_active); -+ -+ switch (cmd) { -+ case SNDRV_PCM_TRIGGER_START: -+ case SNDRV_PCM_TRIGGER_RESUME: -+ case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: -+ if (dai->playback_active) { -+ dev_info(dai->dev, "Enabling audio amp...\n"); -+ queue_delayed_work(system_power_efficient_wq, -+ &voicehat->enable_sdmode_work, -+ msecs_to_jiffies(voicehat->sdmode_delay)); -+ } -+ break; -+ case SNDRV_PCM_TRIGGER_STOP: -+ case SNDRV_PCM_TRIGGER_SUSPEND: -+ case SNDRV_PCM_TRIGGER_PAUSE_PUSH: -+ if (dai->playback_active) { -+ cancel_delayed_work(&voicehat->enable_sdmode_work); -+ dev_info(dai->dev, "Disabling audio amp...\n"); -+ gpiod_set_value(voicehat->sdmode_gpio, 0); -+ } -+ break; -+ } -+ return 0; -+} -+ -+static const struct snd_soc_dai_ops voicehat_dai_ops = { -+ .trigger = voicehat_daiops_trigger, -+}; -+ -+static struct snd_soc_dai_driver voicehat_dai = { -+ .name = "voicehat-hifi", -+ .capture = {.stream_name = "HiFi Capture", -+ .channels_min = 2, -+ .channels_max = 2, -+ .rates = SNDRV_PCM_RATE_48000, -+ .formats = SNDRV_PCM_FMTBIT_S32_LE}, -+ .playback = {.stream_name = "HiFi Playback", -+ .channels_min = 2, -+ .channels_max = 2, -+ .rates = SNDRV_PCM_RATE_48000, -+ .formats = SNDRV_PCM_FMTBIT_S32_LE}, -+ .ops = &voicehat_dai_ops, -+ .symmetric_rates = 1}; -+ -+#ifdef CONFIG_OF -+static const struct of_device_id voicehat_ids[] = { -+ { -+ .compatible = "google,voicehat", -+ }, -+ {}}; -+MODULE_DEVICE_TABLE(of, voicehat_ids); -+#endif -+ -+static int voicehat_platform_probe(struct platform_device *pdev) { -+ struct voicehat_priv *voicehat; -+ int ret; -+ -+ voicehat = devm_kzalloc(&pdev->dev, sizeof(*voicehat), GFP_KERNEL); -+ if (!voicehat) return -ENOMEM; -+ -+ ret = device_property_read_u32(&pdev->dev, "voicehat_sdmode_delay", -+ &voicehat->sdmode_delay); -+ -+ if (ret) { -+ voicehat->sdmode_delay = SDMODE_DELAY_MS; -+ dev_info(&pdev->dev, -+ "property 'voicehat_sdmode_delay' not found default 5 mS"); -+ } else { -+ dev_info(&pdev->dev, "property 'voicehat_sdmode_delay' found delay= %d mS", -+ voicehat->sdmode_delay); -+ } -+ -+ dev_set_drvdata(&pdev->dev, voicehat); -+ -+ return snd_soc_register_codec(&pdev->dev, &voicehat_codec_driver, &voicehat_dai, 1); -+} -+ -+static int voicehat_platform_remove(struct platform_device *pdev) { -+ snd_soc_unregister_codec(&pdev->dev); -+ return 0; -+} -+ -+static struct platform_driver voicehat_driver = { -+ .driver = -+ { -+ .name = "voicehat-codec", .of_match_table = of_match_ptr(voicehat_ids), -+ }, -+ .probe = voicehat_platform_probe, -+ .remove = voicehat_platform_remove, -+}; -+ -+module_platform_driver(voicehat_driver); -+ -+MODULE_DESCRIPTION("Google voiceHAT Codec driver"); -+MODULE_AUTHOR("Peter Malkin "); -+MODULE_LICENSE("GPL v2"); -diff --git a/sound/soc/bcm/googlevoicehat-soundcard.c b/sound/soc/bcm/googlevoicehat-soundcard.c -new file mode 100644 -index 0000000000000000000000000000000000000000..225854b8e5298b3c3018f59a49404354a831a24e ---- /dev/null -+++ b/sound/soc/bcm/googlevoicehat-soundcard.c -@@ -0,0 +1,124 @@ -+/* -+ * ASoC Driver for Google voiceHAT SoundCard -+ * -+ * Author: Peter Malkin -+ * Copyright 2016 -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License -+ * version 2 as published by the Free Software Foundation. -+ * -+ * This program is distributed in the hope that it will be useful, but -+ * WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * General Public License for more details. -+ */ -+ -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+ -+static int snd_rpi_googlevoicehat_soundcard_init(struct snd_soc_pcm_runtime *rtd) -+{ -+ return 0; -+} -+ -+static int snd_rpi_googlevoicehat_soundcard_hw_params( -+ struct snd_pcm_substream *substream, -+ struct snd_pcm_hw_params *params) -+{ -+ struct snd_soc_pcm_runtime *rtd = substream->private_data; -+ struct snd_soc_dai *cpu_dai = rtd->cpu_dai; -+ -+ unsigned int sample_bits = -+ snd_pcm_format_physical_width(params_format(params)); -+ -+ return snd_soc_dai_set_bclk_ratio(cpu_dai, sample_bits * 2); -+} -+ -+/* machine stream operations */ -+static struct snd_soc_ops snd_rpi_googlevoicehat_soundcard_ops = { -+ .hw_params = snd_rpi_googlevoicehat_soundcard_hw_params, -+}; -+ -+static struct snd_soc_dai_link snd_rpi_googlevoicehat_soundcard_dai[] = { -+{ -+ .name = "Google voiceHAT SoundCard", -+ .stream_name = "Google voiceHAT SoundCard HiFi", -+ .cpu_dai_name = "bcm2708-i2s.0", -+ .codec_dai_name = "voicehat-hifi", -+ .platform_name = "bcm2708-i2s.0", -+ .codec_name = "voicehat-codec", -+ .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | -+ SND_SOC_DAIFMT_CBS_CFS, -+ .ops = &snd_rpi_googlevoicehat_soundcard_ops, -+ .init = snd_rpi_googlevoicehat_soundcard_init, -+}, -+}; -+ -+/* audio machine driver */ -+static struct snd_soc_card snd_rpi_googlevoicehat_soundcard = { -+ .name = "snd_rpi_googlevoicehat_soundcard", -+ .owner = THIS_MODULE, -+ .dai_link = snd_rpi_googlevoicehat_soundcard_dai, -+ .num_links = ARRAY_SIZE(snd_rpi_googlevoicehat_soundcard_dai), -+}; -+ -+static int snd_rpi_googlevoicehat_soundcard_probe(struct platform_device *pdev) -+{ -+ int ret = 0; -+ -+ snd_rpi_googlevoicehat_soundcard.dev = &pdev->dev; -+ -+ if (pdev->dev.of_node) { -+ struct device_node *i2s_node; -+ struct snd_soc_dai_link *dai = &snd_rpi_googlevoicehat_soundcard_dai[0]; -+ i2s_node = of_parse_phandle(pdev->dev.of_node, -+ "i2s-controller", 0); -+ -+ if (i2s_node) { -+ dai->cpu_dai_name = NULL; -+ dai->cpu_of_node = i2s_node; -+ dai->platform_name = NULL; -+ dai->platform_of_node = i2s_node; -+ } -+ } -+ -+ ret = snd_soc_register_card(&snd_rpi_googlevoicehat_soundcard); -+ if (ret) -+ dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", ret); -+ -+ return ret; -+} -+ -+static int snd_rpi_googlevoicehat_soundcard_remove(struct platform_device *pdev) -+{ -+ return snd_soc_unregister_card(&snd_rpi_googlevoicehat_soundcard); -+} -+ -+static const struct of_device_id snd_rpi_googlevoicehat_soundcard_of_match[] = { -+ { .compatible = "googlevoicehat,googlevoicehat-soundcard", }, -+ {}, -+}; -+MODULE_DEVICE_TABLE(of, snd_rpi_googlevoicehat_soundcard_of_match); -+ -+static struct platform_driver snd_rpi_googlevoicehat_soundcard_driver = { -+ .driver = { -+ .name = "snd-googlevoicehat-soundcard", -+ .owner = THIS_MODULE, -+ .of_match_table = snd_rpi_googlevoicehat_soundcard_of_match, -+ }, -+ .probe = snd_rpi_googlevoicehat_soundcard_probe, -+ .remove = snd_rpi_googlevoicehat_soundcard_remove, -+}; -+ -+module_platform_driver(snd_rpi_googlevoicehat_soundcard_driver); -+ -+MODULE_AUTHOR("Peter Malkin "); -+MODULE_DESCRIPTION("ASoC Driver for Google voiceHAT SoundCard"); -+MODULE_LICENSE("GPL v2"); - -From e643843e4d9ae491c956d8720e7be50c2f6ab7d2 Mon Sep 17 00:00:00 2001 -From: Raashid Muhammed -Date: Mon, 27 Mar 2017 12:35:00 +0530 -Subject: [PATCH 134/201] Add support for Allo Piano DAC 2.1 plus add-on board - for Raspberry Pi. - -The Piano DAC 2.1 has support for 4 channels with subwoofer. - -Signed-off-by: Baswaraj K -Reviewed-by: Vijay Kumar B. -Reviewed-by: Raashid Muhammed ---- - arch/arm/boot/dts/overlays/Makefile | 1 + - arch/arm/boot/dts/overlays/README | 18 + - .../allo-piano-dac-plus-pcm512x-audio-overlay.dts | 51 +++ - sound/soc/bcm/Kconfig | 7 + - sound/soc/bcm/Makefile | 2 + - sound/soc/bcm/allo-piano-dac-plus.c | 467 +++++++++++++++++++++ - 6 files changed, 546 insertions(+) - create mode 100644 arch/arm/boot/dts/overlays/allo-piano-dac-plus-pcm512x-audio-overlay.dts - create mode 100644 sound/soc/bcm/allo-piano-dac-plus.c - -diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile -index 2f1cd17697606687fe47cb4e6a25a572611bf241..73826c74d2cfb58cac1a72e523ce00b021411d16 100644 ---- a/arch/arm/boot/dts/overlays/Makefile -+++ b/arch/arm/boot/dts/overlays/Makefile -@@ -8,6 +8,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ - ads7846.dtbo \ - akkordion-iqdacplus.dtbo \ - allo-piano-dac-pcm512x-audio.dtbo \ -+ allo-piano-dac-plus-pcm512x-audio.dtbo \ - at86rf233.dtbo \ - audioinjector-addons.dtbo \ - audioinjector-wm8731-audio.dtbo \ -diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README -index 6870e83a2e6acf842259a769d483b0b98c172279..1e3420e80d620f3c376ffb7c905e7aba7f63d709 100644 ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -283,6 +283,24 @@ Params: 24db_digital_gain Allow gain to be applied via the PCM512x codec - that does not result in clipping/distortion!) - - -+Name: allo-piano-dac-plus-pcm512x-audio -+Info: Configures the Allo Piano DAC (2.1) audio cards. -+Load: dtoverlay=allo-piano-dac-plus-pcm512x-audio, -+Params: 24db_digital_gain Allow gain to be applied via the PCM512x codec -+ Digital volume control. -+ (The default behaviour is that the Digital -+ volume control is limited to a maximum of -+ 0dB. ie. it can attenuate but not provide -+ gain. For most users, this will be desired -+ as it will prevent clipping. By appending -+ the 24db_digital_gain parameter, the Digital -+ volume control will allow up to 24dB of -+ gain. If this parameter is enabled, it is the -+ responsibility of the user to ensure that -+ the Digital volume control is set to a value -+ that does not result in clipping/distortion!) -+ -+ - Name: at86rf233 - Info: Configures the Atmel AT86RF233 802.15.4 low-power WPAN transceiver, - connected to spi0.0 -diff --git a/arch/arm/boot/dts/overlays/allo-piano-dac-plus-pcm512x-audio-overlay.dts b/arch/arm/boot/dts/overlays/allo-piano-dac-plus-pcm512x-audio-overlay.dts -new file mode 100644 -index 0000000000000000000000000000000000000000..6943b55ca5f96097668e2d10c05f56a26be62b0a ---- /dev/null -+++ b/arch/arm/boot/dts/overlays/allo-piano-dac-plus-pcm512x-audio-overlay.dts -@@ -0,0 +1,51 @@ -+// Definitions for Piano DAC -+/dts-v1/; -+/plugin/; -+ -+/ { -+ compatible = "brcm,bcm2708"; -+ -+ fragment@0 { -+ target = <&i2s>; -+ __overlay__ { -+ status = "okay"; -+ }; -+ }; -+ -+ fragment@1 { -+ target = <&i2c1>; -+ __overlay__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ -+ pcm5122_4c: pcm5122@4c { -+ #sound-dai-cells = <0>; -+ compatible = "ti,pcm5122"; -+ reg = <0x4c>; -+ status = "okay"; -+ }; -+ pcm5122_4d: pcm5122@4d { -+ #sound-dai-cells = <0>; -+ compatible = "ti,pcm5122"; -+ reg = <0x4d>; -+ status = "okay"; -+ }; -+ }; -+ }; -+ -+ fragment@2 { -+ target = <&sound>; -+ piano_dac: __overlay__ { -+ compatible = "allo,piano-dac-plus"; -+ audio-codec = <&pcm5122_4c &pcm5122_4d>; -+ i2s-controller = <&i2s>; -+ status = "okay"; -+ }; -+ }; -+ -+ __overrides__ { -+ 24db_digital_gain = -+ <&piano_dac>,"piano,24db_digital_gain?"; -+ }; -+}; -diff --git a/sound/soc/bcm/Kconfig b/sound/soc/bcm/Kconfig -index cb9edcc96247e47855907da06b14a13695d408df..ee59713344b3d0385c4d659d6dab3da8c2a60633 100644 ---- a/sound/soc/bcm/Kconfig -+++ b/sound/soc/bcm/Kconfig -@@ -162,6 +162,13 @@ config SND_BCM2708_SOC_ALLO_PIANO_DAC - help - Say Y or M if you want to add support for Allo Piano DAC. - -+config SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS -+ tristate "Support for Allo Piano DAC Plus" -+ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S -+ select SND_SOC_PCM512x_I2C -+ help -+ Say Y or M if you want to add support for Allo Piano DAC Plus. -+ - config SND_BCM2708_SOC_FE_PI_AUDIO - tristate "Support for Fe-Pi-Audio" - depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S -diff --git a/sound/soc/bcm/Makefile b/sound/soc/bcm/Makefile -index e37457f01b263ba47ad884c7e945d33b001d9c66..54b4111ad820b3f8086867ca2ce86d5339fca93e 100644 ---- a/sound/soc/bcm/Makefile -+++ b/sound/soc/bcm/Makefile -@@ -32,6 +32,7 @@ snd-soc-digidac1-soundcard-objs := digidac1-soundcard.o - snd-soc-dionaudio-loco-objs := dionaudio_loco.o - snd-soc-dionaudio-loco-v2-objs := dionaudio_loco-v2.o - snd-soc-allo-piano-dac-objs := allo-piano-dac.o -+snd-soc-allo-piano-dac-plus-objs := allo-piano-dac-plus.o - snd-soc-pisound-objs := pisound.o - snd-soc-fe-pi-audio-objs := fe-pi-audio.o - -@@ -56,5 +57,6 @@ obj-$(CONFIG_SND_DIGIDAC1_SOUNDCARD) += snd-soc-digidac1-soundcard.o - obj-$(CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO) += snd-soc-dionaudio-loco.o - obj-$(CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO_V2) += snd-soc-dionaudio-loco-v2.o - obj-$(CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC) += snd-soc-allo-piano-dac.o -+obj-$(CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS) += snd-soc-allo-piano-dac-plus.o - obj-$(CONFIG_SND_PISOUND) += snd-soc-pisound.o - obj-$(CONFIG_SND_BCM2708_SOC_FE_PI_AUDIO) += snd-soc-fe-pi-audio.o -diff --git a/sound/soc/bcm/allo-piano-dac-plus.c b/sound/soc/bcm/allo-piano-dac-plus.c -new file mode 100644 -index 0000000000000000000000000000000000000000..f66f42abadbd5f9d3fe000676e8297ed91630e47 ---- /dev/null -+++ b/sound/soc/bcm/allo-piano-dac-plus.c -@@ -0,0 +1,467 @@ -+/* -+ * ALSA ASoC Machine Driver for Allo Piano DAC Plus Subwoofer -+ * -+ * Author: Baswaraj K -+ * Copyright 2016 -+ * based on code by Daniel Matuschek -+ * based on code by Florian Meier -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License -+ * version 2 as published by the Free Software Foundation. -+ * -+ * This program is distributed in the hope that it will be useful, but -+ * WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * General Public License for more details. -+ */ -+ -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include "../codecs/pcm512x.h" -+ -+struct dsp_code { -+ char i2c_addr; -+ char offset; -+ char val; -+}; -+ -+static struct snd_soc_pcm_runtime *rtd_glb; -+static bool digital_gain_0db_limit = true; -+unsigned int set_lowpass, set_mode, set_rate, dsp_page_number; -+ -+static const char * const allo_piano_mode_texts[] = { -+ "2.0", -+ "2.1", -+ "2.2", -+}; -+ -+static const SOC_ENUM_SINGLE_DECL(allo_piano_mode_enum, -+ 0, 0, allo_piano_mode_texts); -+ -+static const char * const allo_piano_dsp_low_pass_texts[] = { -+ "60", -+ "70", -+ "80", -+ "90", -+ "100", -+ "110", -+ "120", -+ "130", -+ "140", -+ "150", -+ "160", -+ "170", -+ "180", -+ "190", -+ "200", -+}; -+ -+static const SOC_ENUM_SINGLE_DECL(allo_piano_enum, -+ 0, 0, allo_piano_dsp_low_pass_texts); -+ -+static int snd_allo_piano_dsp_program(struct snd_soc_pcm_runtime *rtd, -+ unsigned int mode, unsigned int rate, unsigned int lowpass) -+{ -+ const struct firmware *fw; -+ char firmware_name[40]; -+ int ret = 0, dac = 0; -+ -+ if (rate <= 46000) -+ rate = 44100; -+ else if (rate <= 68000) -+ rate = 48000; -+ else if (rate <= 92000) -+ rate = 88200; -+ else if (rate <= 136000) -+ rate = 96000; -+ else if (rate <= 184000) -+ rate = 176400; -+ else -+ rate = 192000; -+ -+ /* same configuration loaded */ -+ if ((rate == set_rate) && (lowpass == set_lowpass) -+ && (mode == set_mode)) -+ return 1; -+ -+ set_rate = rate; -+ set_mode = mode; -+ -+ if (mode == 0) { /* 2.0 */ -+ snd_soc_write(rtd->codec_dais[1]->codec, -+ PCM512x_MUTE, 0x11); -+ return 1; -+ } else { -+ snd_soc_write(rtd->codec_dais[1]->codec, -+ PCM512x_MUTE, 0x00); -+ } -+ -+ set_lowpass = lowpass; -+ -+ for (dac = 0; dac < rtd->num_codecs; dac++) { -+ struct dsp_code *dsp_code_read; -+ int i = 1; -+ struct snd_soc_codec *codec = rtd->codec_dais[dac]->codec; -+ -+ if (dac == 0) { /* high */ -+ sprintf(firmware_name, -+ "alloPiano/2.2/allo-piano-dsp-%d-%d-%d.bin", -+ rate, ((set_lowpass * 10) + 60), dac); -+ } else { /* low */ -+ sprintf(firmware_name, -+ "alloPiano/2.%d/allo-piano-dsp-%d-%d-%d.bin", -+ set_mode, rate, ((set_lowpass * 10) + 60), dac); -+ } -+ -+ dev_info(codec->dev, "Dsp Firmware File Name: %s\n", -+ firmware_name); -+ -+ ret = request_firmware(&fw, firmware_name, codec->dev); -+ if (ret < 0) { -+ dev_err(codec->dev, "Error: AlloPiano Firmware %s missing. %d\n", -+ firmware_name, ret); -+ goto err; -+ } -+ -+ while (i < (fw->size - 1)) { -+ dsp_code_read = (struct dsp_code *)&fw->data[i]; -+ -+ if (dsp_code_read->offset == 0) { -+ dsp_page_number = dsp_code_read->val; -+ ret = snd_soc_write(rtd->codec_dais[dac]->codec, -+ PCM512x_PAGE_BASE(0), -+ dsp_code_read->val); -+ -+ } else if (dsp_code_read->offset != 0) { -+ ret = snd_soc_write(rtd->codec_dais[dac]->codec, -+ (PCM512x_PAGE_BASE(dsp_page_number) + -+ dsp_code_read->offset), -+ dsp_code_read->val); -+ -+ } -+ if (ret < 0) { -+ dev_err(codec->dev, -+ "Failed to write Register: %d\n", ret); -+ goto err; -+ } -+ i = i + 3; -+ } -+ release_firmware(fw); -+ } -+ return 1; -+ -+err: -+ release_firmware(fw); -+ return ret; -+} -+ -+static int snd_allo_piano_mode_get(struct snd_kcontrol *kcontrol, -+ struct snd_ctl_elem_value *ucontrol) -+{ -+ ucontrol->value.integer.value[0] = set_mode; -+ return 0; -+} -+ -+static int snd_allo_piano_mode_put(struct snd_kcontrol *kcontrol, -+ struct snd_ctl_elem_value *ucontrol) -+{ -+ return(snd_allo_piano_dsp_program(rtd_glb, -+ ucontrol->value.integer.value[0], -+ set_rate, set_lowpass)); -+} -+ -+static int snd_allo_piano_lowpass_get(struct snd_kcontrol *kcontrol, -+ struct snd_ctl_elem_value *ucontrol) -+{ -+ ucontrol->value.integer.value[0] = set_lowpass; -+ return 0; -+} -+ -+static int snd_allo_piano_lowpass_put(struct snd_kcontrol *kcontrol, -+ struct snd_ctl_elem_value *ucontrol) -+{ -+ return(snd_allo_piano_dsp_program(rtd_glb, -+ set_mode, set_rate, -+ ucontrol->value.integer.value[0])); -+} -+ -+static int pcm512x_get_reg_sub(struct snd_kcontrol *kcontrol, -+ struct snd_ctl_elem_value *ucontrol) -+{ -+ struct soc_mixer_control *mc = -+ (struct soc_mixer_control *)kcontrol->private_value; -+ unsigned int left_val = 0; -+ unsigned int right_val = 0; -+ -+ left_val = snd_soc_read(rtd_glb->codec_dais[1]->codec, -+ PCM512x_DIGITAL_VOLUME_2); -+ if (left_val < 0) -+ return left_val; -+ -+ right_val = snd_soc_read(rtd_glb->codec_dais[1]->codec, -+ PCM512x_DIGITAL_VOLUME_3); -+ if (right_val < 0) -+ return right_val; -+ -+ ucontrol->value.integer.value[0] = -+ (~(left_val >> mc->shift)) & mc->max; -+ ucontrol->value.integer.value[1] = -+ (~(right_val >> mc->shift)) & mc->max; -+ -+ return 0; -+} -+ -+static int pcm512x_set_reg_sub(struct snd_kcontrol *kcontrol, -+ struct snd_ctl_elem_value *ucontrol) -+{ -+ struct soc_mixer_control *mc = -+ (struct soc_mixer_control *)kcontrol->private_value; -+ unsigned int left_val = (ucontrol->value.integer.value[0] & mc->max); -+ unsigned int right_val = (ucontrol->value.integer.value[1] & mc->max); -+ int ret = 0; -+ -+ ret = snd_soc_write(rtd_glb->codec_dais[1]->codec, -+ PCM512x_DIGITAL_VOLUME_2, (~left_val)); -+ if (ret < 0) -+ return ret; -+ -+ ret = snd_soc_write(rtd_glb->codec_dais[1]->codec, -+ PCM512x_DIGITAL_VOLUME_3, (~right_val)); -+ if (ret < 0) -+ return ret; -+ -+ return 1; -+} -+ -+static int pcm512x_get_reg_sub_switch(struct snd_kcontrol *kcontrol, -+ struct snd_ctl_elem_value *ucontrol) -+{ -+ int val = 0; -+ -+ val = snd_soc_read(rtd_glb->codec_dais[1]->codec, PCM512x_MUTE); -+ if (val < 0) -+ return val; -+ -+ ucontrol->value.integer.value[0] = (val & 0x10) ? 0 : 1; -+ ucontrol->value.integer.value[1] = (val & 0x01) ? 0 : 1; -+ -+ return val; -+} -+ -+static int pcm512x_set_reg_sub_switch(struct snd_kcontrol *kcontrol, -+ struct snd_ctl_elem_value *ucontrol) -+{ -+ unsigned int left_val = (ucontrol->value.integer.value[0]); -+ unsigned int right_val = (ucontrol->value.integer.value[1]); -+ int ret = 0; -+ -+ ret = snd_soc_write(rtd_glb->codec_dais[1]->codec, PCM512x_MUTE, -+ ~((left_val & 0x01)<<4 | (right_val & 0x01))); -+ if (ret < 0) -+ return ret; -+ -+ return 1; -+ -+} -+ -+static const DECLARE_TLV_DB_SCALE(digital_tlv_sub, -10350, 50, 1); -+ -+static const struct snd_kcontrol_new allo_piano_controls[] = { -+ SOC_ENUM_EXT("Subwoofer mode", -+ allo_piano_mode_enum, -+ snd_allo_piano_mode_get, -+ snd_allo_piano_mode_put), -+ -+ SOC_ENUM_EXT("Lowpass", allo_piano_enum, -+ snd_allo_piano_lowpass_get, -+ snd_allo_piano_lowpass_put), -+ -+ SOC_DOUBLE_R_EXT_TLV("Subwoofer Digital Playback Volume", -+ PCM512x_DIGITAL_VOLUME_2, -+ PCM512x_DIGITAL_VOLUME_3, 0, 255, 1, -+ pcm512x_get_reg_sub, -+ pcm512x_set_reg_sub, -+ digital_tlv_sub), -+ -+ SOC_DOUBLE_EXT("Subwoofer Digital Playback Switch", -+ PCM512x_MUTE, -+ PCM512x_RQML_SHIFT, -+ PCM512x_RQMR_SHIFT, 1, 1, -+ pcm512x_get_reg_sub_switch, -+ pcm512x_set_reg_sub_switch), -+}; -+ -+static int snd_allo_piano_dac_init(struct snd_soc_pcm_runtime *rtd) -+{ -+ rtd_glb = rtd; -+ -+ if (digital_gain_0db_limit) { -+ int ret; -+ struct snd_soc_card *card = rtd->card; -+ -+ ret = snd_soc_limit_volume(card, "Digital Playback Volume", -+ 207); -+ if (ret < 0) -+ dev_warn(card->dev, "Failed to set volume limit: %d\n", -+ ret); -+ } -+ -+ return 0; -+} -+ -+static int snd_allo_piano_dac_hw_params(struct snd_pcm_substream *substream, -+ struct snd_pcm_hw_params *params) -+{ -+ struct snd_soc_pcm_runtime *rtd = substream->private_data; -+ struct snd_soc_dai *cpu_dai = rtd->cpu_dai; -+ unsigned int sample_bits = -+ snd_pcm_format_physical_width(params_format(params)); -+ unsigned int rate = params_rate(params); -+ struct snd_soc_card *card = rtd->card; -+ int ret = 0; -+ -+ rtd_glb = rtd; /* TODO */ -+ if (digital_gain_0db_limit) { -+ ret = snd_soc_limit_volume(card, -+ "Subwoofer Digital Playback Volume", 207); -+ if (ret < 0) -+ dev_warn(card->dev, "Failed to set volume limit: %d\n", -+ ret); -+ } -+ ret = snd_allo_piano_dsp_program(rtd, set_mode, rate, set_lowpass); -+ if (ret < 0) -+ return ret; -+ -+ ret = snd_soc_dai_set_bclk_ratio(cpu_dai, sample_bits * 2); -+ -+ return ret; -+} -+ -+/* machine stream operations */ -+static struct snd_soc_ops snd_allo_piano_dac_ops = { -+ .hw_params = snd_allo_piano_dac_hw_params, -+}; -+ -+static struct snd_soc_dai_link_component allo_piano_2_1_codecs[] = { -+ { -+ .dai_name = "pcm512x-hifi", -+ }, -+ { -+ .dai_name = "pcm512x-hifi", -+ }, -+}; -+ -+static struct snd_soc_dai_link snd_allo_piano_dac_dai[] = { -+ { -+ .name = "PianoDACPlus", -+ .stream_name = "PianoDACPlus", -+ .cpu_dai_name = "bcm2708-i2s.0", -+ .platform_name = "bcm2708-i2s.0", -+ .codecs = allo_piano_2_1_codecs, -+ .num_codecs = 2, -+ .dai_fmt = SND_SOC_DAIFMT_I2S | -+ SND_SOC_DAIFMT_NB_NF | -+ SND_SOC_DAIFMT_CBS_CFS, -+ .ops = &snd_allo_piano_dac_ops, -+ .init = snd_allo_piano_dac_init, -+ }, -+}; -+ -+/* audio machine driver */ -+static struct snd_soc_card snd_allo_piano_dac = { -+ .name = "PianoDACPlus", -+ .owner = THIS_MODULE, -+ .dai_link = snd_allo_piano_dac_dai, -+ .num_links = ARRAY_SIZE(snd_allo_piano_dac_dai), -+ .controls = allo_piano_controls, -+ .num_controls = ARRAY_SIZE(allo_piano_controls), -+}; -+ -+static int snd_allo_piano_dac_probe(struct platform_device *pdev) -+{ -+ int ret = 0, i = 0; -+ struct snd_soc_card *card = &snd_allo_piano_dac; -+ -+ card->dev = &pdev->dev; -+ snd_allo_piano_dac.dev = &pdev->dev; -+ -+ if (pdev->dev.of_node) { -+ struct device_node *i2s_node; -+ struct snd_soc_dai_link *dai; -+ -+ dai = &snd_allo_piano_dac_dai[0]; -+ i2s_node = of_parse_phandle(pdev->dev.of_node, -+ "i2s-controller", 0); -+ if (i2s_node) { -+ for (i = 0; i < card->num_links; i++) { -+ dai->cpu_dai_name = NULL; -+ dai->cpu_of_node = i2s_node; -+ dai->platform_name = NULL; -+ dai->platform_of_node = i2s_node; -+ } -+ } -+ digital_gain_0db_limit = -+ !of_property_read_bool(pdev->dev.of_node, -+ "allo,24db_digital_gain"); -+ -+ allo_piano_2_1_codecs[0].of_node = -+ of_parse_phandle(pdev->dev.of_node, "audio-codec", 0); -+ if (!allo_piano_2_1_codecs[0].of_node) { -+ dev_err(&pdev->dev, -+ "Property 'audio-codec' missing or invalid\n"); -+ return -EINVAL; -+ } -+ -+ allo_piano_2_1_codecs[1].of_node = -+ of_parse_phandle(pdev->dev.of_node, "audio-codec", 1); -+ if (!allo_piano_2_1_codecs[1].of_node) { -+ dev_err(&pdev->dev, -+ "Property 'audio-codec' missing or invalid\n"); -+ return -EINVAL; -+ } -+ } -+ -+ ret = snd_soc_register_card(&snd_allo_piano_dac); -+ if (ret < 0) -+ dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", -+ ret); -+ -+ return ret; -+} -+ -+static int snd_allo_piano_dac_remove(struct platform_device *pdev) -+{ -+ return snd_soc_unregister_card(&snd_allo_piano_dac); -+} -+ -+static const struct of_device_id snd_allo_piano_dac_of_match[] = { -+ { .compatible = "allo,piano-dac-plus", }, -+ { /* sentinel */ }, -+}; -+ -+MODULE_DEVICE_TABLE(of, snd_allo_piano_dac_of_match); -+ -+static struct platform_driver snd_allo_piano_dac_driver = { -+ .driver = { -+ .name = "snd-allo-piano-dac-plus", -+ .owner = THIS_MODULE, -+ .of_match_table = snd_allo_piano_dac_of_match, -+ }, -+ .probe = snd_allo_piano_dac_probe, -+ .remove = snd_allo_piano_dac_remove, -+}; -+ -+module_platform_driver(snd_allo_piano_dac_driver); -+ -+MODULE_AUTHOR("Baswaraj K "); -+MODULE_DESCRIPTION("ALSA ASoC Machine Driver for Allo Piano DAC Plus"); -+MODULE_LICENSE("GPL v2"); - -From 3e10625281b5c6c03cf8b972809d3de056e235f1 Mon Sep 17 00:00:00 2001 -From: BabuSubashChandar -Date: Tue, 28 Mar 2017 20:04:42 +0530 -Subject: [PATCH 135/201] Add support for Allo Boss DAC add-on board for - Raspberry Pi. (#1924) - -Signed-off-by: Baswaraj K -Reviewed-by: Deepak -Reviewed-by: BabuSubashChandar ---- - arch/arm/boot/dts/overlays/Makefile | 1 + - arch/arm/boot/dts/overlays/README | 24 ++ - .../allo-boss-dac-pcm512x-audio-overlay.dts | 58 ++++ - drivers/clk/Makefile | 1 + - drivers/clk/clk-allo-dac-45Mhz.c | 161 +++++++++ - sound/soc/bcm/Kconfig | 8 + - sound/soc/bcm/Makefile | 2 + - sound/soc/bcm/allo-boss-dac.c | 374 +++++++++++++++++++++ - 8 files changed, 629 insertions(+) - create mode 100644 arch/arm/boot/dts/overlays/allo-boss-dac-pcm512x-audio-overlay.dts - create mode 100644 drivers/clk/clk-allo-dac-45Mhz.c - create mode 100644 sound/soc/bcm/allo-boss-dac.c - -diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile -index 73826c74d2cfb58cac1a72e523ce00b021411d16..b64dd7ac0630b2b525809a9f5221420f34a58ac9 100644 ---- a/arch/arm/boot/dts/overlays/Makefile -+++ b/arch/arm/boot/dts/overlays/Makefile -@@ -7,6 +7,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ - ads1115.dtbo \ - ads7846.dtbo \ - akkordion-iqdacplus.dtbo \ -+ allo-boss-dac-pcm512x-audio.dtbo \ - allo-piano-dac-pcm512x-audio.dtbo \ - allo-piano-dac-plus-pcm512x-audio.dtbo \ - at86rf233.dtbo \ -diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README -index 1e3420e80d620f3c376ffb7c905e7aba7f63d709..c9e954253a6318dbd2605b93026c04974b3271bd 100644 ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -263,6 +263,30 @@ Params: 24db_digital_gain Allow gain to be applied via the PCM512x codec - that does not result in clipping/distortion!) - - -+Name: allo-boss-dac-pcm512x-audio -+Info: Configures the Allo Boss DAC audio cards. -+Load: dtoverlay=allo-boss-dac-pcm512x-audio, -+Params: 24db_digital_gain Allow gain to be applied via the PCM512x codec -+ Digital volume control. Enable with -+ "dtoverlay=allo-boss-dac-pcm512x-audio, -+ 24db_digital_gain" -+ (The default behaviour is that the Digital -+ volume control is limited to a maximum of -+ 0dB. ie. it can attenuate but not provide -+ gain. For most users, this will be desired -+ as it will prevent clipping. By appending -+ the 24db_digital_gain parameter, the Digital -+ volume control will allow up to 24dB of -+ gain. If this parameter is enabled, it is the -+ responsibility of the user to ensure that -+ the Digital volume control is set to a value -+ that does not result in clipping/distortion!) -+ slave Force Boss DAC into slave mode, using Pi a -+ master for bit clock and frame clock. Enable -+ with "dtoverlay=allo-boss-dac-pcm512x-audio, -+ slave" -+ -+ - Name: allo-piano-dac-pcm512x-audio - Info: Configures the Allo Piano DAC (2.0/2.1) audio cards. - (NB. This initial support is for 2.0 channel audio ONLY! ie. stereo. -diff --git a/arch/arm/boot/dts/overlays/allo-boss-dac-pcm512x-audio-overlay.dts b/arch/arm/boot/dts/overlays/allo-boss-dac-pcm512x-audio-overlay.dts -new file mode 100644 -index 0000000000000000000000000000000000000000..7df335a3d82f7043d31ba69331cdf3185264d78c ---- /dev/null -+++ b/arch/arm/boot/dts/overlays/allo-boss-dac-pcm512x-audio-overlay.dts -@@ -0,0 +1,58 @@ -+/* -+ * Definitions for Allo Boss DAC board -+ */ -+ -+/dts-v1/; -+/plugin/; -+ -+/ { -+ compatible = "brcm,bcm2708"; -+ -+ fragment@0 { -+ target-path = "/clocks"; -+ __overlay__ { -+ boss_osc: boss_osc { -+ compatible = "allo,dac-clk"; -+ #clock-cells = <0>; -+ }; -+ }; -+ }; -+ -+ fragment@1 { -+ target = <&i2s>; -+ __overlay__ { -+ status = "okay"; -+ }; -+ }; -+ -+ fragment@2 { -+ target = <&i2c1>; -+ __overlay__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ -+ pcm5122@4d { -+ #sound-dai-cells = <0>; -+ compatible = "ti,pcm5122"; -+ clocks = <&boss_osc>; -+ reg = <0x4d>; -+ status = "okay"; -+ }; -+ }; -+ }; -+ -+ fragment@3 { -+ target = <&sound>; -+ boss_dac: __overlay__ { -+ compatible = "allo,boss-dac"; -+ i2s-controller = <&i2s>; -+ status = "okay"; -+ }; -+ }; -+ -+ __overrides__ { -+ 24db_digital_gain = <&boss_dac>,"allo,24db_digital_gain?"; -+ slave = <&boss_dac>,"allo,slave?"; -+ }; -+}; -diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile -index c901caf8988417053d19916172cf8eb8468a59fd..50f4737abdb4fd428b9cae26a1482f7be58e03cb 100644 ---- a/drivers/clk/Makefile -+++ b/drivers/clk/Makefile -@@ -17,6 +17,7 @@ endif - - # hardware specific clock types - # please keep this section sorted lexicographically by file path name -+obj-$(CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC) += clk-allo-dac-45Mhz.o - obj-$(CONFIG_MACH_ASM9260) += clk-asm9260.o - obj-$(CONFIG_COMMON_CLK_AXI_CLKGEN) += clk-axi-clkgen.o - obj-$(CONFIG_ARCH_AXXIA) += clk-axm5516.o -diff --git a/drivers/clk/clk-allo-dac-45Mhz.c b/drivers/clk/clk-allo-dac-45Mhz.c -new file mode 100644 -index 0000000000000000000000000000000000000000..d5e9e5b3495cfd2e94fae256f11bc6e0d1f470c6 ---- /dev/null -+++ b/drivers/clk/clk-allo-dac-45Mhz.c -@@ -0,0 +1,161 @@ -+/* -+ * Clock Driver for Allo DAC -+ * -+ * Author: Baswaraj K -+ * Copyright 2016 -+ * based on code by Stuart MacLean -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License -+ * version 2 as published by the Free Software Foundation. -+ * -+ * This program is distributed in the hope that it will be useful, but -+ * WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * General Public License for more details. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+/* Clock rate of CLK44EN attached to GPIO6 pin */ -+#define CLK_44EN_RATE 45158400UL -+/* Clock rate of CLK48EN attached to GPIO3 pin */ -+#define CLK_48EN_RATE 49152000UL -+ -+/** -+ * struct allo_dac_clk - Common struct to the Allo DAC -+ * @hw: clk_hw for the common clk framework -+ * @mode: 0 => CLK44EN, 1 => CLK48EN -+ */ -+struct clk_allo_hw { -+ struct clk_hw hw; -+ uint8_t mode; -+}; -+ -+#define to_allo_clk(_hw) container_of(_hw, struct clk_allo_hw, hw) -+ -+static const struct of_device_id clk_allo_dac_dt_ids[] = { -+ { .compatible = "allo,dac-clk",}, -+ { } -+}; -+MODULE_DEVICE_TABLE(of, clk_allo_dac_dt_ids); -+ -+static unsigned long clk_allo_dac_recalc_rate(struct clk_hw *hw, -+ unsigned long parent_rate) -+{ -+ return (to_allo_clk(hw)->mode == 0) ? CLK_44EN_RATE : -+ CLK_48EN_RATE; -+} -+ -+static long clk_allo_dac_round_rate(struct clk_hw *hw, -+ unsigned long rate, unsigned long *parent_rate) -+{ -+ long actual_rate; -+ -+ if (rate <= CLK_44EN_RATE) { -+ actual_rate = (long)CLK_44EN_RATE; -+ } else if (rate >= CLK_48EN_RATE) { -+ actual_rate = (long)CLK_48EN_RATE; -+ } else { -+ long diff44Rate = (long)(rate - CLK_44EN_RATE); -+ long diff48Rate = (long)(CLK_48EN_RATE - rate); -+ -+ if (diff44Rate < diff48Rate) -+ actual_rate = (long)CLK_44EN_RATE; -+ else -+ actual_rate = (long)CLK_48EN_RATE; -+ } -+ return actual_rate; -+} -+ -+ -+static int clk_allo_dac_set_rate(struct clk_hw *hw, -+ unsigned long rate, unsigned long parent_rate) -+{ -+ unsigned long actual_rate; -+ struct clk_allo_hw *clk = to_allo_clk(hw); -+ -+ actual_rate = (unsigned long)clk_allo_dac_round_rate(hw, rate, -+ &parent_rate); -+ clk->mode = (actual_rate == CLK_44EN_RATE) ? 0 : 1; -+ return 0; -+} -+ -+ -+const struct clk_ops clk_allo_dac_rate_ops = { -+ .recalc_rate = clk_allo_dac_recalc_rate, -+ .round_rate = clk_allo_dac_round_rate, -+ .set_rate = clk_allo_dac_set_rate, -+}; -+ -+static int clk_allo_dac_probe(struct platform_device *pdev) -+{ -+ int ret; -+ struct clk_allo_hw *proclk; -+ struct clk *clk; -+ struct device *dev; -+ struct clk_init_data init; -+ -+ dev = &pdev->dev; -+ -+ proclk = kzalloc(sizeof(struct clk_allo_hw), GFP_KERNEL); -+ if (!proclk) -+ return -ENOMEM; -+ -+ init.name = "clk-allo-dac"; -+ init.ops = &clk_allo_dac_rate_ops; -+ init.flags = CLK_IS_ROOT | CLK_IS_BASIC; -+ init.parent_names = NULL; -+ init.num_parents = 0; -+ -+ proclk->mode = 0; -+ proclk->hw.init = &init; -+ -+ clk = devm_clk_register(dev, &proclk->hw); -+ if (!IS_ERR(clk)) { -+ ret = of_clk_add_provider(dev->of_node, of_clk_src_simple_get, -+ clk); -+ } else { -+ dev_err(dev, "Fail to register clock driver\n"); -+ kfree(proclk); -+ ret = PTR_ERR(clk); -+ } -+ return ret; -+} -+ -+static int clk_allo_dac_remove(struct platform_device *pdev) -+{ -+ of_clk_del_provider(pdev->dev.of_node); -+ return 0; -+} -+ -+static struct platform_driver clk_allo_dac_driver = { -+ .probe = clk_allo_dac_probe, -+ .remove = clk_allo_dac_remove, -+ .driver = { -+ .name = "clk-allo-dac", -+ .of_match_table = clk_allo_dac_dt_ids, -+ }, -+}; -+ -+static int __init clk_allo_dac_init(void) -+{ -+ return platform_driver_register(&clk_allo_dac_driver); -+} -+core_initcall(clk_allo_dac_init); -+ -+static void __exit clk_allo_dac_exit(void) -+{ -+ platform_driver_unregister(&clk_allo_dac_driver); -+} -+module_exit(clk_allo_dac_exit); -+ -+MODULE_DESCRIPTION("Allo DAC clock driver"); -+MODULE_LICENSE("GPL v2"); -+MODULE_ALIAS("platform:clk-allo-dac"); -diff --git a/sound/soc/bcm/Kconfig b/sound/soc/bcm/Kconfig -index ee59713344b3d0385c4d659d6dab3da8c2a60633..be474a58151889f145ca5aeb789ea6c116c4fd44 100644 ---- a/sound/soc/bcm/Kconfig -+++ b/sound/soc/bcm/Kconfig -@@ -176,6 +176,14 @@ config SND_BCM2708_SOC_FE_PI_AUDIO - help - Say Y or M if you want to add support for Fe-Pi-Audio. - -+config SND_BCM2708_SOC_ALLO_BOSS_DAC -+ tristate "Support for allo Boss DAC" -+ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S -+ select SND_SOC_PCM512x_I2C -+ help -+ Say Y or M if you want to add support for allo Boss DAC. -+ -+ - config SND_PISOUND - tristate "Support for Blokas Labs pisound" - depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S -diff --git a/sound/soc/bcm/Makefile b/sound/soc/bcm/Makefile -index 54b4111ad820b3f8086867ca2ce86d5339fca93e..72e1620fa4038035804cf3b2a09c6b12e7ae0fe1 100644 ---- a/sound/soc/bcm/Makefile -+++ b/sound/soc/bcm/Makefile -@@ -31,6 +31,7 @@ snd-soc-audioinjector-octo-soundcard-objs := audioinjector-octo-soundcard.o - snd-soc-digidac1-soundcard-objs := digidac1-soundcard.o - snd-soc-dionaudio-loco-objs := dionaudio_loco.o - snd-soc-dionaudio-loco-v2-objs := dionaudio_loco-v2.o -+snd-soc-allo-boss-dac-objs := allo-boss-dac.o - snd-soc-allo-piano-dac-objs := allo-piano-dac.o - snd-soc-allo-piano-dac-plus-objs := allo-piano-dac-plus.o - snd-soc-pisound-objs := pisound.o -@@ -56,6 +57,7 @@ obj-$(CONFIG_SND_AUDIOINJECTOR_OCTO_SOUNDCARD) += snd-soc-audioinjector-octo-sou - obj-$(CONFIG_SND_DIGIDAC1_SOUNDCARD) += snd-soc-digidac1-soundcard.o - obj-$(CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO) += snd-soc-dionaudio-loco.o - obj-$(CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO_V2) += snd-soc-dionaudio-loco-v2.o -+obj-$(CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC) += snd-soc-allo-boss-dac.o - obj-$(CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC) += snd-soc-allo-piano-dac.o - obj-$(CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS) += snd-soc-allo-piano-dac-plus.o - obj-$(CONFIG_SND_PISOUND) += snd-soc-pisound.o -diff --git a/sound/soc/bcm/allo-boss-dac.c b/sound/soc/bcm/allo-boss-dac.c -new file mode 100644 -index 0000000000000000000000000000000000000000..c080e31065d99ab309ab3bdf41a44adfdd8f8039 ---- /dev/null -+++ b/sound/soc/bcm/allo-boss-dac.c -@@ -0,0 +1,374 @@ -+/* -+ * ALSA ASoC Machine Driver for Allo Boss DAC -+ * -+ * Author: Baswaraj K -+ * Copyright 2016 -+ * based on code by Daniel Matuschek, Stuart MacLean -+ * based on code by Florian Meier -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License -+ * version 2 as published by the Free Software Foundation. -+ * -+ * This program is distributed in the hope that it will be useful, but -+ * WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * General Public License for more details. -+ */ -+ -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include "../codecs/pcm512x.h" -+ -+#define ALLO_BOSS_NOCLOCK 0 -+#define ALLO_BOSS_CLK44EN 1 -+#define ALLO_BOSS_CLK48EN 2 -+ -+struct pcm512x_priv { -+ struct regmap *regmap; -+ struct clk *sclk; -+}; -+ -+/* Clock rate of CLK44EN attached to GPIO6 pin */ -+#define CLK_44EN_RATE 45158400UL -+/* Clock rate of CLK48EN attached to GPIO3 pin */ -+#define CLK_48EN_RATE 49152000UL -+ -+static bool slave; -+static bool snd_soc_allo_boss_master; -+static bool digital_gain_0db_limit = true; -+ -+static void snd_allo_boss_select_clk(struct snd_soc_codec *codec, -+ int clk_id) -+{ -+ switch (clk_id) { -+ case ALLO_BOSS_NOCLOCK: -+ snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x24, 0x00); -+ break; -+ case ALLO_BOSS_CLK44EN: -+ snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x24, 0x20); -+ break; -+ case ALLO_BOSS_CLK48EN: -+ snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x24, 0x04); -+ break; -+ } -+} -+ -+static void snd_allo_boss_clk_gpio(struct snd_soc_codec *codec) -+{ -+ snd_soc_update_bits(codec, PCM512x_GPIO_EN, 0x24, 0x24); -+ snd_soc_update_bits(codec, PCM512x_GPIO_OUTPUT_3, 0x0f, 0x02); -+ snd_soc_update_bits(codec, PCM512x_GPIO_OUTPUT_6, 0x0f, 0x02); -+} -+ -+static bool snd_allo_boss_is_sclk(struct snd_soc_codec *codec) -+{ -+ int sck; -+ -+ sck = snd_soc_read(codec, PCM512x_RATE_DET_4); -+ return (!(sck & 0x40)); -+} -+ -+static bool snd_allo_boss_is_sclk_sleep( -+ struct snd_soc_codec *codec) -+{ -+ msleep(2); -+ return snd_allo_boss_is_sclk(codec); -+} -+ -+static bool snd_allo_boss_is_master_card(struct snd_soc_codec *codec) -+{ -+ bool isClk44EN, isClk48En, isNoClk; -+ -+ snd_allo_boss_clk_gpio(codec); -+ -+ snd_allo_boss_select_clk(codec, ALLO_BOSS_CLK44EN); -+ isClk44EN = snd_allo_boss_is_sclk_sleep(codec); -+ -+ snd_allo_boss_select_clk(codec, ALLO_BOSS_NOCLOCK); -+ isNoClk = snd_allo_boss_is_sclk_sleep(codec); -+ -+ snd_allo_boss_select_clk(codec, ALLO_BOSS_CLK48EN); -+ isClk48En = snd_allo_boss_is_sclk_sleep(codec); -+ -+ return (isClk44EN && isClk48En && !isNoClk); -+} -+ -+static int snd_allo_boss_clk_for_rate(int sample_rate) -+{ -+ int type; -+ -+ switch (sample_rate) { -+ case 11025: -+ case 22050: -+ case 44100: -+ case 88200: -+ case 176400: -+ type = ALLO_BOSS_CLK44EN; -+ break; -+ default: -+ type = ALLO_BOSS_CLK48EN; -+ break; -+ } -+ return type; -+} -+ -+static void snd_allo_boss_set_sclk(struct snd_soc_codec *codec, -+ int sample_rate) -+{ -+ struct pcm512x_priv *pcm512x = snd_soc_codec_get_drvdata(codec); -+ -+ if (!IS_ERR(pcm512x->sclk)) { -+ int ctype; -+ -+ ctype = snd_allo_boss_clk_for_rate(sample_rate); -+ clk_set_rate(pcm512x->sclk, (ctype == ALLO_BOSS_CLK44EN) -+ ? CLK_44EN_RATE : CLK_48EN_RATE); -+ snd_allo_boss_select_clk(codec, ctype); -+ } -+} -+ -+static int snd_allo_boss_init(struct snd_soc_pcm_runtime *rtd) -+{ -+ struct snd_soc_codec *codec = rtd->codec; -+ struct pcm512x_priv *priv; -+ -+ if (slave) -+ snd_soc_allo_boss_master = false; -+ else -+ snd_soc_allo_boss_master = -+ snd_allo_boss_is_master_card(codec); -+ -+ if (snd_soc_allo_boss_master) { -+ struct snd_soc_dai_link *dai = rtd->dai_link; -+ -+ dai->name = "BossDAC"; -+ dai->stream_name = "BossDAC"; -+ dai->dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF -+ | SND_SOC_DAIFMT_CBM_CFM; -+ -+ snd_soc_update_bits(codec, PCM512x_BCLK_LRCLK_CFG, 0x31, 0x11); -+ snd_soc_update_bits(codec, PCM512x_MASTER_MODE, 0x03, 0x03); -+ snd_soc_update_bits(codec, PCM512x_MASTER_CLKDIV_2, 0x7f, 63); -+ } else { -+ priv = snd_soc_codec_get_drvdata(codec); -+ priv->sclk = ERR_PTR(-ENOENT); -+ } -+ -+ snd_soc_update_bits(codec, PCM512x_GPIO_EN, 0x08, 0x08); -+ snd_soc_update_bits(codec, PCM512x_GPIO_OUTPUT_4, 0x0f, 0x02); -+ snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08, 0x08); -+ -+ if (digital_gain_0db_limit) { -+ int ret; -+ struct snd_soc_card *card = rtd->card; -+ -+ ret = snd_soc_limit_volume(card, "Digital Playback Volume", -+ 207); -+ if (ret < 0) -+ dev_warn(card->dev, "Failed to set volume limit: %d\n", -+ ret); -+ } -+ -+ return 0; -+} -+ -+static int snd_allo_boss_update_rate_den( -+ struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) -+{ -+ struct snd_soc_pcm_runtime *rtd = substream->private_data; -+ struct snd_soc_codec *codec = rtd->codec; -+ struct pcm512x_priv *pcm512x = snd_soc_codec_get_drvdata(codec); -+ struct snd_ratnum *rats_no_pll; -+ unsigned int num = 0, den = 0; -+ int err; -+ -+ rats_no_pll = devm_kzalloc(rtd->dev, sizeof(*rats_no_pll), GFP_KERNEL); -+ if (!rats_no_pll) -+ return -ENOMEM; -+ -+ rats_no_pll->num = clk_get_rate(pcm512x->sclk) / 64; -+ rats_no_pll->den_min = 1; -+ rats_no_pll->den_max = 128; -+ rats_no_pll->den_step = 1; -+ -+ err = snd_interval_ratnum(hw_param_interval(params, -+ SNDRV_PCM_HW_PARAM_RATE), 1, rats_no_pll, &num, &den); -+ if (err >= 0 && den) { -+ params->rate_num = num; -+ params->rate_den = den; -+ } -+ -+ devm_kfree(rtd->dev, rats_no_pll); -+ return 0; -+} -+ -+static int snd_allo_boss_set_bclk_ratio_pro( -+ struct snd_soc_dai *cpu_dai, struct snd_pcm_hw_params *params) -+{ -+ int bratio = snd_pcm_format_physical_width(params_format(params)) -+ * params_channels(params); -+ return snd_soc_dai_set_bclk_ratio(cpu_dai, bratio); -+} -+ -+static int snd_allo_boss_hw_params( -+ struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) -+{ -+ int ret = 0; -+ struct snd_soc_pcm_runtime *rtd = substream->private_data; -+ struct snd_soc_dai *cpu_dai = rtd->cpu_dai; -+ unsigned int sample_bits = -+ snd_pcm_format_physical_width(params_format(params)); -+ -+ if (snd_soc_allo_boss_master) { -+ struct snd_soc_codec *codec = rtd->codec; -+ -+ snd_allo_boss_set_sclk(codec, -+ params_rate(params)); -+ -+ ret = snd_allo_boss_set_bclk_ratio_pro(cpu_dai, -+ params); -+ if (!ret) -+ ret = snd_allo_boss_update_rate_den( -+ substream, params); -+ } else { -+ if (snd_allo_boss_is_sclk(rtd->codec)) { -+ snd_soc_update_bits(rtd->codec, PCM512x_PLL_EN, -+ PCM512x_PLLE, 0x01); -+ snd_soc_update_bits(rtd->codec, PCM512x_PLL_REF, -+ PCM512x_SREF, PCM512x_SREF_BCK); -+ dev_dbg(rtd->codec->dev, -+ "Setting BCLK as input clock and Enable PLL\n"); -+ } else { -+ snd_soc_update_bits(rtd->codec, PCM512x_PLL_EN, -+ PCM512x_PLLE, 0x00); -+ snd_soc_update_bits(rtd->codec, PCM512x_PLL_REF, -+ PCM512x_SREF, PCM512x_SREF_SCK); -+ -+ dev_dbg(rtd->codec->dev, -+ "Setting SCLK as input clock and disabled PLL\n"); -+ } -+ -+ ret = snd_soc_dai_set_bclk_ratio(cpu_dai, sample_bits * 2); -+ } -+ return ret; -+} -+ -+static int snd_allo_boss_startup( -+ struct snd_pcm_substream *substream) -+{ -+ struct snd_soc_pcm_runtime *rtd = substream->private_data; -+ struct snd_soc_codec *codec = rtd->codec; -+ -+ snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08, 0x08); -+ return 0; -+} -+ -+static void snd_allo_boss_shutdown( -+ struct snd_pcm_substream *substream) -+{ -+ struct snd_soc_pcm_runtime *rtd = substream->private_data; -+ struct snd_soc_codec *codec = rtd->codec; -+ -+ snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08, 0x00); -+} -+ -+/* machine stream operations */ -+static struct snd_soc_ops snd_allo_boss_ops = { -+ .hw_params = snd_allo_boss_hw_params, -+ .startup = snd_allo_boss_startup, -+ .shutdown = snd_allo_boss_shutdown, -+}; -+ -+static struct snd_soc_dai_link snd_allo_boss_dai[] = { -+{ -+ .name = "Boss DAC", -+ .stream_name = "Boss DAC HiFi", -+ .cpu_dai_name = "bcm2708-i2s.0", -+ .codec_dai_name = "pcm512x-hifi", -+ .platform_name = "bcm2708-i2s.0", -+ .codec_name = "pcm512x.1-004d", -+ .dai_fmt = SND_SOC_DAIFMT_I2S | -+ SND_SOC_DAIFMT_NB_NF | -+ SND_SOC_DAIFMT_CBS_CFS, -+ .ops = &snd_allo_boss_ops, -+ .init = snd_allo_boss_init, -+}, -+}; -+ -+/* audio machine driver */ -+static struct snd_soc_card snd_allo_boss = { -+ .name = "BossDAC", -+ .owner = THIS_MODULE, -+ .dai_link = snd_allo_boss_dai, -+ .num_links = ARRAY_SIZE(snd_allo_boss_dai), -+}; -+ -+static int snd_allo_boss_probe(struct platform_device *pdev) -+{ -+ int ret = 0; -+ -+ snd_allo_boss.dev = &pdev->dev; -+ -+ if (pdev->dev.of_node) { -+ struct device_node *i2s_node; -+ struct snd_soc_dai_link *dai; -+ -+ dai = &snd_allo_boss_dai[0]; -+ i2s_node = of_parse_phandle(pdev->dev.of_node, -+ "i2s-controller", 0); -+ -+ if (i2s_node) { -+ dai->cpu_dai_name = NULL; -+ dai->cpu_of_node = i2s_node; -+ dai->platform_name = NULL; -+ dai->platform_of_node = i2s_node; -+ } -+ -+ digital_gain_0db_limit = !of_property_read_bool( -+ pdev->dev.of_node, "allo,24db_digital_gain"); -+ slave = of_property_read_bool(pdev->dev.of_node, -+ "allo,slave"); -+ } -+ -+ ret = snd_soc_register_card(&snd_allo_boss); -+ if (ret) -+ dev_err(&pdev->dev, -+ "snd_soc_register_card() failed: %d\n", ret); -+ -+ return ret; -+} -+ -+static int snd_allo_boss_remove(struct platform_device *pdev) -+{ -+ return snd_soc_unregister_card(&snd_allo_boss); -+} -+ -+static const struct of_device_id snd_allo_boss_of_match[] = { -+ { .compatible = "allo,boss-dac", }, -+ { /* sentinel */ }, -+}; -+MODULE_DEVICE_TABLE(of, snd_allo_boss_of_match); -+ -+static struct platform_driver snd_allo_boss_driver = { -+ .driver = { -+ .name = "snd-allo-boss-dac", -+ .owner = THIS_MODULE, -+ .of_match_table = snd_allo_boss_of_match, -+ }, -+ .probe = snd_allo_boss_probe, -+ .remove = snd_allo_boss_remove, -+}; -+ -+module_platform_driver(snd_allo_boss_driver); -+ -+MODULE_AUTHOR("Baswaraj K "); -+MODULE_DESCRIPTION("ALSA ASoC Machine Driver for Allo Boss DAC"); -+MODULE_LICENSE("GPL v2"); - -From c9a877558a1a1d9927de54d6e68b0bf541c31f3a Mon Sep 17 00:00:00 2001 -From: BabuSubashChandar C -Date: Thu, 30 Mar 2017 20:17:27 +0530 -Subject: [PATCH 136/201] Add support for new clock rate and mute gpios. - -Signed-off-by: Baswaraj K -Reviewed-by: Deepak -Reviewed-by: BabuSubashChandar ---- - .../allo-boss-dac-pcm512x-audio-overlay.dts | 1 + - arch/arm/configs/bcm2709_defconfig | 1 + - drivers/clk/Makefile | 2 +- - drivers/clk/clk-allo-dac-45Mhz.c | 161 --------------------- - drivers/clk/clk-allo-dac.c | 161 +++++++++++++++++++++ - sound/soc/bcm/Kconfig | 4 +- - sound/soc/bcm/allo-boss-dac.c | 145 +++++++++++++++---- - 7 files changed, 282 insertions(+), 193 deletions(-) - delete mode 100644 drivers/clk/clk-allo-dac-45Mhz.c - create mode 100644 drivers/clk/clk-allo-dac.c - -diff --git a/arch/arm/boot/dts/overlays/allo-boss-dac-pcm512x-audio-overlay.dts b/arch/arm/boot/dts/overlays/allo-boss-dac-pcm512x-audio-overlay.dts -index 7df335a3d82f7043d31ba69331cdf3185264d78c..ac1cfe093d9aa8a77ef25cc62a9d8100d81ca684 100644 ---- a/arch/arm/boot/dts/overlays/allo-boss-dac-pcm512x-audio-overlay.dts -+++ b/arch/arm/boot/dts/overlays/allo-boss-dac-pcm512x-audio-overlay.dts -@@ -47,6 +47,7 @@ - boss_dac: __overlay__ { - compatible = "allo,boss-dac"; - i2s-controller = <&i2s>; -+ mute-gpios = <&gpio 6 1>; - status = "okay"; - }; - }; -diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig -index f68fc97d2a9c28154880b5d55ce90b0b0974acc6..f8c97a20611f3f6688a0de4f5c0c167a0fa0bcd6 100644 ---- a/arch/arm/configs/bcm2709_defconfig -+++ b/arch/arm/configs/bcm2709_defconfig -@@ -882,6 +882,7 @@ CONFIG_SND_AUDIOINJECTOR_OCTO_SOUNDCARD=m - CONFIG_SND_DIGIDAC1_SOUNDCARD=m - CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO=m - CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO_V2=m -+CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC=m - CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC=m - CONFIG_SND_BCM2708_SOC_FE_PI_AUDIO=m - CONFIG_SND_PISOUND=m -diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile -index 50f4737abdb4fd428b9cae26a1482f7be58e03cb..35c943df626731560adbd49f489aaf3b4cfa11bf 100644 ---- a/drivers/clk/Makefile -+++ b/drivers/clk/Makefile -@@ -17,7 +17,7 @@ endif - - # hardware specific clock types - # please keep this section sorted lexicographically by file path name --obj-$(CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC) += clk-allo-dac-45Mhz.o -+obj-$(CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC) += clk-allo-dac.o - obj-$(CONFIG_MACH_ASM9260) += clk-asm9260.o - obj-$(CONFIG_COMMON_CLK_AXI_CLKGEN) += clk-axi-clkgen.o - obj-$(CONFIG_ARCH_AXXIA) += clk-axm5516.o -diff --git a/drivers/clk/clk-allo-dac-45Mhz.c b/drivers/clk/clk-allo-dac-45Mhz.c -deleted file mode 100644 -index d5e9e5b3495cfd2e94fae256f11bc6e0d1f470c6..0000000000000000000000000000000000000000 ---- a/drivers/clk/clk-allo-dac-45Mhz.c -+++ /dev/null -@@ -1,161 +0,0 @@ --/* -- * Clock Driver for Allo DAC -- * -- * Author: Baswaraj K -- * Copyright 2016 -- * based on code by Stuart MacLean -- * -- * This program is free software; you can redistribute it and/or -- * modify it under the terms of the GNU General Public License -- * version 2 as published by the Free Software Foundation. -- * -- * This program is distributed in the hope that it will be useful, but -- * WITHOUT ANY WARRANTY; without even the implied warranty of -- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- * General Public License for more details. -- */ -- --#include --#include --#include --#include --#include --#include --#include -- --/* Clock rate of CLK44EN attached to GPIO6 pin */ --#define CLK_44EN_RATE 45158400UL --/* Clock rate of CLK48EN attached to GPIO3 pin */ --#define CLK_48EN_RATE 49152000UL -- --/** -- * struct allo_dac_clk - Common struct to the Allo DAC -- * @hw: clk_hw for the common clk framework -- * @mode: 0 => CLK44EN, 1 => CLK48EN -- */ --struct clk_allo_hw { -- struct clk_hw hw; -- uint8_t mode; --}; -- --#define to_allo_clk(_hw) container_of(_hw, struct clk_allo_hw, hw) -- --static const struct of_device_id clk_allo_dac_dt_ids[] = { -- { .compatible = "allo,dac-clk",}, -- { } --}; --MODULE_DEVICE_TABLE(of, clk_allo_dac_dt_ids); -- --static unsigned long clk_allo_dac_recalc_rate(struct clk_hw *hw, -- unsigned long parent_rate) --{ -- return (to_allo_clk(hw)->mode == 0) ? CLK_44EN_RATE : -- CLK_48EN_RATE; --} -- --static long clk_allo_dac_round_rate(struct clk_hw *hw, -- unsigned long rate, unsigned long *parent_rate) --{ -- long actual_rate; -- -- if (rate <= CLK_44EN_RATE) { -- actual_rate = (long)CLK_44EN_RATE; -- } else if (rate >= CLK_48EN_RATE) { -- actual_rate = (long)CLK_48EN_RATE; -- } else { -- long diff44Rate = (long)(rate - CLK_44EN_RATE); -- long diff48Rate = (long)(CLK_48EN_RATE - rate); -- -- if (diff44Rate < diff48Rate) -- actual_rate = (long)CLK_44EN_RATE; -- else -- actual_rate = (long)CLK_48EN_RATE; -- } -- return actual_rate; --} -- -- --static int clk_allo_dac_set_rate(struct clk_hw *hw, -- unsigned long rate, unsigned long parent_rate) --{ -- unsigned long actual_rate; -- struct clk_allo_hw *clk = to_allo_clk(hw); -- -- actual_rate = (unsigned long)clk_allo_dac_round_rate(hw, rate, -- &parent_rate); -- clk->mode = (actual_rate == CLK_44EN_RATE) ? 0 : 1; -- return 0; --} -- -- --const struct clk_ops clk_allo_dac_rate_ops = { -- .recalc_rate = clk_allo_dac_recalc_rate, -- .round_rate = clk_allo_dac_round_rate, -- .set_rate = clk_allo_dac_set_rate, --}; -- --static int clk_allo_dac_probe(struct platform_device *pdev) --{ -- int ret; -- struct clk_allo_hw *proclk; -- struct clk *clk; -- struct device *dev; -- struct clk_init_data init; -- -- dev = &pdev->dev; -- -- proclk = kzalloc(sizeof(struct clk_allo_hw), GFP_KERNEL); -- if (!proclk) -- return -ENOMEM; -- -- init.name = "clk-allo-dac"; -- init.ops = &clk_allo_dac_rate_ops; -- init.flags = CLK_IS_ROOT | CLK_IS_BASIC; -- init.parent_names = NULL; -- init.num_parents = 0; -- -- proclk->mode = 0; -- proclk->hw.init = &init; -- -- clk = devm_clk_register(dev, &proclk->hw); -- if (!IS_ERR(clk)) { -- ret = of_clk_add_provider(dev->of_node, of_clk_src_simple_get, -- clk); -- } else { -- dev_err(dev, "Fail to register clock driver\n"); -- kfree(proclk); -- ret = PTR_ERR(clk); -- } -- return ret; --} -- --static int clk_allo_dac_remove(struct platform_device *pdev) --{ -- of_clk_del_provider(pdev->dev.of_node); -- return 0; --} -- --static struct platform_driver clk_allo_dac_driver = { -- .probe = clk_allo_dac_probe, -- .remove = clk_allo_dac_remove, -- .driver = { -- .name = "clk-allo-dac", -- .of_match_table = clk_allo_dac_dt_ids, -- }, --}; -- --static int __init clk_allo_dac_init(void) --{ -- return platform_driver_register(&clk_allo_dac_driver); --} --core_initcall(clk_allo_dac_init); -- --static void __exit clk_allo_dac_exit(void) --{ -- platform_driver_unregister(&clk_allo_dac_driver); --} --module_exit(clk_allo_dac_exit); -- --MODULE_DESCRIPTION("Allo DAC clock driver"); --MODULE_LICENSE("GPL v2"); --MODULE_ALIAS("platform:clk-allo-dac"); -diff --git a/drivers/clk/clk-allo-dac.c b/drivers/clk/clk-allo-dac.c -new file mode 100644 -index 0000000000000000000000000000000000000000..0baf821d6947ebb757c8ea4594f6c1b04b4e10dd ---- /dev/null -+++ b/drivers/clk/clk-allo-dac.c -@@ -0,0 +1,161 @@ -+/* -+ * Clock Driver for Allo DAC -+ * -+ * Author: Baswaraj K -+ * Copyright 2016 -+ * based on code by Stuart MacLean -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License -+ * version 2 as published by the Free Software Foundation. -+ * -+ * This program is distributed in the hope that it will be useful, but -+ * WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * General Public License for more details. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+/* Clock rate of CLK44EN attached to GPIO6 pin */ -+#define CLK_44EN_RATE 45158400UL -+/* Clock rate of CLK48EN attached to GPIO3 pin */ -+#define CLK_48EN_RATE 49152000UL -+ -+/** -+ * struct allo_dac_clk - Common struct to the Allo DAC -+ * @hw: clk_hw for the common clk framework -+ * @mode: 0 => CLK44EN, 1 => CLK48EN -+ */ -+struct clk_allo_hw { -+ struct clk_hw hw; -+ uint8_t mode; -+}; -+ -+#define to_allo_clk(_hw) container_of(_hw, struct clk_allo_hw, hw) -+ -+static const struct of_device_id clk_allo_dac_dt_ids[] = { -+ { .compatible = "allo,dac-clk",}, -+ { } -+}; -+MODULE_DEVICE_TABLE(of, clk_allo_dac_dt_ids); -+ -+static unsigned long clk_allo_dac_recalc_rate(struct clk_hw *hw, -+ unsigned long parent_rate) -+{ -+ return (to_allo_clk(hw)->mode == 0) ? CLK_44EN_RATE : -+ CLK_48EN_RATE; -+} -+ -+static long clk_allo_dac_round_rate(struct clk_hw *hw, -+ unsigned long rate, unsigned long *parent_rate) -+{ -+ long actual_rate; -+ -+ if (rate <= CLK_44EN_RATE) { -+ actual_rate = (long)CLK_44EN_RATE; -+ } else if (rate >= CLK_48EN_RATE) { -+ actual_rate = (long)CLK_48EN_RATE; -+ } else { -+ long diff44Rate = (long)(rate - CLK_44EN_RATE); -+ long diff48Rate = (long)(CLK_48EN_RATE - rate); -+ -+ if (diff44Rate < diff48Rate) -+ actual_rate = (long)CLK_44EN_RATE; -+ else -+ actual_rate = (long)CLK_48EN_RATE; -+ } -+ return actual_rate; -+} -+ -+ -+static int clk_allo_dac_set_rate(struct clk_hw *hw, -+ unsigned long rate, unsigned long parent_rate) -+{ -+ unsigned long actual_rate; -+ struct clk_allo_hw *clk = to_allo_clk(hw); -+ -+ actual_rate = (unsigned long)clk_allo_dac_round_rate(hw, rate, -+ &parent_rate); -+ clk->mode = (actual_rate == CLK_44EN_RATE) ? 0 : 1; -+ return 0; -+} -+ -+ -+const struct clk_ops clk_allo_dac_rate_ops = { -+ .recalc_rate = clk_allo_dac_recalc_rate, -+ .round_rate = clk_allo_dac_round_rate, -+ .set_rate = clk_allo_dac_set_rate, -+}; -+ -+static int clk_allo_dac_probe(struct platform_device *pdev) -+{ -+ int ret; -+ struct clk_allo_hw *proclk; -+ struct clk *clk; -+ struct device *dev; -+ struct clk_init_data init; -+ -+ dev = &pdev->dev; -+ -+ proclk = kzalloc(sizeof(struct clk_allo_hw), GFP_KERNEL); -+ if (!proclk) -+ return -ENOMEM; -+ -+ init.name = "clk-allo-dac"; -+ init.ops = &clk_allo_dac_rate_ops; -+ init.flags = CLK_IS_BASIC; -+ init.parent_names = NULL; -+ init.num_parents = 0; -+ -+ proclk->mode = 0; -+ proclk->hw.init = &init; -+ -+ clk = devm_clk_register(dev, &proclk->hw); -+ if (!IS_ERR(clk)) { -+ ret = of_clk_add_provider(dev->of_node, of_clk_src_simple_get, -+ clk); -+ } else { -+ dev_err(dev, "Fail to register clock driver\n"); -+ kfree(proclk); -+ ret = PTR_ERR(clk); -+ } -+ return ret; -+} -+ -+static int clk_allo_dac_remove(struct platform_device *pdev) -+{ -+ of_clk_del_provider(pdev->dev.of_node); -+ return 0; -+} -+ -+static struct platform_driver clk_allo_dac_driver = { -+ .probe = clk_allo_dac_probe, -+ .remove = clk_allo_dac_remove, -+ .driver = { -+ .name = "clk-allo-dac", -+ .of_match_table = clk_allo_dac_dt_ids, -+ }, -+}; -+ -+static int __init clk_allo_dac_init(void) -+{ -+ return platform_driver_register(&clk_allo_dac_driver); -+} -+core_initcall(clk_allo_dac_init); -+ -+static void __exit clk_allo_dac_exit(void) -+{ -+ platform_driver_unregister(&clk_allo_dac_driver); -+} -+module_exit(clk_allo_dac_exit); -+ -+MODULE_DESCRIPTION("Allo DAC clock driver"); -+MODULE_LICENSE("GPL v2"); -+MODULE_ALIAS("platform:clk-allo-dac"); -diff --git a/sound/soc/bcm/Kconfig b/sound/soc/bcm/Kconfig -index be474a58151889f145ca5aeb789ea6c116c4fd44..c472f67b6167fecbdc099c1ceaa96b10555e8039 100644 ---- a/sound/soc/bcm/Kconfig -+++ b/sound/soc/bcm/Kconfig -@@ -177,11 +177,11 @@ config SND_BCM2708_SOC_FE_PI_AUDIO - Say Y or M if you want to add support for Fe-Pi-Audio. - - config SND_BCM2708_SOC_ALLO_BOSS_DAC -- tristate "Support for allo Boss DAC" -+ tristate "Support for Allo Boss DAC" - depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S - select SND_SOC_PCM512x_I2C - help -- Say Y or M if you want to add support for allo Boss DAC. -+ Say Y or M if you want to add support for Allo Boss DAC. - - - config SND_PISOUND -diff --git a/sound/soc/bcm/allo-boss-dac.c b/sound/soc/bcm/allo-boss-dac.c -index c080e31065d99ab309ab3bdf41a44adfdd8f8039..203ab76c7045b081578e23bda1099dd103d11154 100644 ---- a/sound/soc/bcm/allo-boss-dac.c -+++ b/sound/soc/bcm/allo-boss-dac.c -@@ -2,8 +2,9 @@ - * ALSA ASoC Machine Driver for Allo Boss DAC - * - * Author: Baswaraj K -- * Copyright 2016 -- * based on code by Daniel Matuschek, Stuart MacLean -+ * Copyright 2017 -+ * based on code by Daniel Matuschek, -+ * Stuart MacLean - * based on code by Florian Meier - * - * This program is free software; you can redistribute it and/or -@@ -17,6 +18,7 @@ - */ - - #include -+#include - #include - #include - #include -@@ -36,6 +38,8 @@ struct pcm512x_priv { - struct clk *sclk; - }; - -+static struct gpio_desc *mute_gpio; -+ - /* Clock rate of CLK44EN attached to GPIO6 pin */ - #define CLK_44EN_RATE 45158400UL - /* Clock rate of CLK48EN attached to GPIO3 pin */ -@@ -111,6 +115,7 @@ static int snd_allo_boss_clk_for_rate(int sample_rate) - case 44100: - case 88200: - case 176400: -+ case 352800: - type = ALLO_BOSS_CLK44EN; - break; - default: -@@ -138,7 +143,7 @@ static void snd_allo_boss_set_sclk(struct snd_soc_codec *codec, - static int snd_allo_boss_init(struct snd_soc_pcm_runtime *rtd) - { - struct snd_soc_codec *codec = rtd->codec; -- struct pcm512x_priv *priv; -+ struct pcm512x_priv *priv = snd_soc_codec_get_drvdata(codec); - - if (slave) - snd_soc_allo_boss_master = false; -@@ -150,15 +155,22 @@ static int snd_allo_boss_init(struct snd_soc_pcm_runtime *rtd) - struct snd_soc_dai_link *dai = rtd->dai_link; - - dai->name = "BossDAC"; -- dai->stream_name = "BossDAC"; -+ dai->stream_name = "Boss DAC HiFi [Master]"; - dai->dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF - | SND_SOC_DAIFMT_CBM_CFM; - - snd_soc_update_bits(codec, PCM512x_BCLK_LRCLK_CFG, 0x31, 0x11); - snd_soc_update_bits(codec, PCM512x_MASTER_MODE, 0x03, 0x03); - snd_soc_update_bits(codec, PCM512x_MASTER_CLKDIV_2, 0x7f, 63); -+ /* -+ * Default sclk to CLK_48EN_RATE, otherwise codec -+ * pcm512x_dai_startup_master method could call -+ * snd_pcm_hw_constraint_ratnums using CLK_44EN/64 -+ * which will mask 384k sample rate. -+ */ -+ if (!IS_ERR(priv->sclk)) -+ clk_set_rate(priv->sclk, CLK_48EN_RATE); - } else { -- priv = snd_soc_codec_get_drvdata(codec); - priv->sclk = ERR_PTR(-ENOENT); - } - -@@ -218,6 +230,52 @@ static int snd_allo_boss_set_bclk_ratio_pro( - return snd_soc_dai_set_bclk_ratio(cpu_dai, bratio); - } - -+static void snd_allo_boss_gpio_mute(struct snd_soc_card *card) -+{ -+ if (mute_gpio) -+ gpiod_set_value_cansleep(mute_gpio, 1); -+} -+ -+static void snd_allo_boss_gpio_unmute(struct snd_soc_card *card) -+{ -+ if (mute_gpio) -+ gpiod_set_value_cansleep(mute_gpio, 0); -+} -+ -+static int snd_allo_boss_set_bias_level(struct snd_soc_card *card, -+ struct snd_soc_dapm_context *dapm, enum snd_soc_bias_level level) -+{ -+ struct snd_soc_pcm_runtime *rtd; -+ struct snd_soc_dai *codec_dai; -+ -+ rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); -+ codec_dai = rtd->codec_dai; -+ -+ if (dapm->dev != codec_dai->dev) -+ return 0; -+ -+ switch (level) { -+ case SND_SOC_BIAS_PREPARE: -+ if (dapm->bias_level != SND_SOC_BIAS_STANDBY) -+ break; -+ /* UNMUTE DAC */ -+ snd_allo_boss_gpio_unmute(card); -+ break; -+ -+ case SND_SOC_BIAS_STANDBY: -+ if (dapm->bias_level != SND_SOC_BIAS_PREPARE) -+ break; -+ /* MUTE DAC */ -+ snd_allo_boss_gpio_mute(card); -+ break; -+ -+ default: -+ break; -+ } -+ -+ return 0; -+} -+ - static int snd_allo_boss_hw_params( - struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) - { -@@ -239,23 +297,6 @@ static int snd_allo_boss_hw_params( - ret = snd_allo_boss_update_rate_den( - substream, params); - } else { -- if (snd_allo_boss_is_sclk(rtd->codec)) { -- snd_soc_update_bits(rtd->codec, PCM512x_PLL_EN, -- PCM512x_PLLE, 0x01); -- snd_soc_update_bits(rtd->codec, PCM512x_PLL_REF, -- PCM512x_SREF, PCM512x_SREF_BCK); -- dev_dbg(rtd->codec->dev, -- "Setting BCLK as input clock and Enable PLL\n"); -- } else { -- snd_soc_update_bits(rtd->codec, PCM512x_PLL_EN, -- PCM512x_PLLE, 0x00); -- snd_soc_update_bits(rtd->codec, PCM512x_PLL_REF, -- PCM512x_SREF, PCM512x_SREF_SCK); -- -- dev_dbg(rtd->codec->dev, -- "Setting SCLK as input clock and disabled PLL\n"); -- } -- - ret = snd_soc_dai_set_bclk_ratio(cpu_dai, sample_bits * 2); - } - return ret; -@@ -266,8 +307,23 @@ static int snd_allo_boss_startup( - { - struct snd_soc_pcm_runtime *rtd = substream->private_data; - struct snd_soc_codec *codec = rtd->codec; -+ struct snd_soc_card *card = rtd->card; - - snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08, 0x08); -+ snd_allo_boss_gpio_mute(card); -+ -+ if (snd_soc_allo_boss_master) { -+ struct pcm512x_priv *priv = snd_soc_codec_get_drvdata(codec); -+ /* -+ * Default sclk to CLK_48EN_RATE, otherwise codec -+ * pcm512x_dai_startup_master method could call -+ * snd_pcm_hw_constraint_ratnums using CLK_44EN/64 -+ * which will mask 384k sample rate. -+ */ -+ if (!IS_ERR(priv->sclk)) -+ clk_set_rate(priv->sclk, CLK_48EN_RATE); -+ } -+ - return 0; - } - -@@ -280,11 +336,21 @@ static void snd_allo_boss_shutdown( - snd_soc_update_bits(codec, PCM512x_GPIO_CONTROL_1, 0x08, 0x00); - } - -+static int snd_allo_boss_prepare( -+ struct snd_pcm_substream *substream) -+{ -+ struct snd_soc_pcm_runtime *rtd = substream->private_data; -+ struct snd_soc_card *card = rtd->card; -+ -+ snd_allo_boss_gpio_unmute(card); -+ return 0; -+} - /* machine stream operations */ - static struct snd_soc_ops snd_allo_boss_ops = { - .hw_params = snd_allo_boss_hw_params, - .startup = snd_allo_boss_startup, - .shutdown = snd_allo_boss_shutdown, -+ .prepare = snd_allo_boss_prepare, - }; - - static struct snd_soc_dai_link snd_allo_boss_dai[] = { -@@ -335,19 +401,40 @@ static int snd_allo_boss_probe(struct platform_device *pdev) - digital_gain_0db_limit = !of_property_read_bool( - pdev->dev.of_node, "allo,24db_digital_gain"); - slave = of_property_read_bool(pdev->dev.of_node, -- "allo,slave"); -- } -+ "allo,slave"); -+ -+ mute_gpio = devm_gpiod_get_optional(&pdev->dev, "mute", -+ GPIOD_OUT_LOW); -+ if (IS_ERR(mute_gpio)) { -+ ret = PTR_ERR(mute_gpio); -+ dev_err(&pdev->dev, -+ "failed to get mute gpio: %d\n", ret); -+ return ret; -+ } - -- ret = snd_soc_register_card(&snd_allo_boss); -- if (ret) -- dev_err(&pdev->dev, -- "snd_soc_register_card() failed: %d\n", ret); -+ if (mute_gpio) -+ snd_allo_boss.set_bias_level = -+ snd_allo_boss_set_bias_level; - -- return ret; -+ ret = snd_soc_register_card(&snd_allo_boss); -+ if (ret) { -+ dev_err(&pdev->dev, -+ "snd_soc_register_card() failed: %d\n", ret); -+ return ret; -+ } -+ -+ if (mute_gpio) -+ snd_allo_boss_gpio_mute(&snd_allo_boss); -+ -+ return 0; -+ } -+ -+ return -EINVAL; - } - - static int snd_allo_boss_remove(struct platform_device *pdev) - { -+ snd_allo_boss_gpio_mute(&snd_allo_boss); - return snd_soc_unregister_card(&snd_allo_boss); - } - - -From 90faa8c413e3f88ed89f839a342ff7e12374fe57 Mon Sep 17 00:00:00 2001 -From: BabuSubashChandar -Date: Sat, 1 Apr 2017 00:46:52 +0530 -Subject: [PATCH 137/201] Add clock changes and mute gpios (#1938) - -Also improve code style and adhere to ALSA coding conventions. - -Signed-off-by: Baswaraj K -Reviewed-by: Vijay Kumar B. -Reviewed-by: Raashid Muhammed ---- - arch/arm/boot/dts/overlays/README | 3 + - .../allo-piano-dac-plus-pcm512x-audio-overlay.dts | 12 +- - arch/arm/configs/bcm2709_defconfig | 1 + - arch/arm/configs/bcmrpi_defconfig | 2 + - sound/soc/bcm/allo-piano-dac-plus.c | 338 +++++++++++++++++---- - 5 files changed, 291 insertions(+), 65 deletions(-) - -diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README -index c9e954253a6318dbd2605b93026c04974b3271bd..1377e5b8e8363c3e0ede318ce54bd784cb70d4c9 100644 ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -323,6 +323,9 @@ Params: 24db_digital_gain Allow gain to be applied via the PCM512x codec - responsibility of the user to ensure that - the Digital volume control is set to a value - that does not result in clipping/distortion!) -+ glb_mclk This option is only with Kali board. If enabled, -+ MCLK for Kali is used and PLL is disabled for -+ better voice quality. (default Off) - - - Name: at86rf233 -diff --git a/arch/arm/boot/dts/overlays/allo-piano-dac-plus-pcm512x-audio-overlay.dts b/arch/arm/boot/dts/overlays/allo-piano-dac-plus-pcm512x-audio-overlay.dts -index 6943b55ca5f96097668e2d10c05f56a26be62b0a..5c1c81c427a8b396ca9e9c903e97f2711850d4c6 100644 ---- a/arch/arm/boot/dts/overlays/allo-piano-dac-plus-pcm512x-audio-overlay.dts -+++ b/arch/arm/boot/dts/overlays/allo-piano-dac-plus-pcm512x-audio-overlay.dts -@@ -19,13 +19,13 @@ - #size-cells = <0>; - status = "okay"; - -- pcm5122_4c: pcm5122@4c { -+ allo_pcm5122_4c: pcm5122@4c { - #sound-dai-cells = <0>; - compatible = "ti,pcm5122"; - reg = <0x4c>; - status = "okay"; - }; -- pcm5122_4d: pcm5122@4d { -+ allo_pcm5122_4d: pcm5122@4d { - #sound-dai-cells = <0>; - compatible = "ti,pcm5122"; - reg = <0x4d>; -@@ -38,14 +38,18 @@ - target = <&sound>; - piano_dac: __overlay__ { - compatible = "allo,piano-dac-plus"; -- audio-codec = <&pcm5122_4c &pcm5122_4d>; -+ audio-codec = <&allo_pcm5122_4c &allo_pcm5122_4d>; - i2s-controller = <&i2s>; -+ mute1-gpios = <&gpio 6 1>; -+ mute2-gpios = <&gpio 25 1>; - status = "okay"; - }; - }; - - __overrides__ { - 24db_digital_gain = -- <&piano_dac>,"piano,24db_digital_gain?"; -+ <&piano_dac>,"allo,24db_digital_gain?"; -+ glb_mclk = -+ <&piano_dac>,"allo,glb_mclk?"; - }; - }; -diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig -index f8c97a20611f3f6688a0de4f5c0c167a0fa0bcd6..94227b4a4f8a9b3a4627dceaf7c654da4f2f87df 100644 ---- a/arch/arm/configs/bcm2709_defconfig -+++ b/arch/arm/configs/bcm2709_defconfig -@@ -884,6 +884,7 @@ CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO=m - CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO_V2=m - CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC=m - CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC=m -+CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS=m - CONFIG_SND_BCM2708_SOC_FE_PI_AUDIO=m - CONFIG_SND_PISOUND=m - CONFIG_SND_SOC_ADAU1701=m -diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index 1a9b95f1b731c48130a0b468d95d533f458cb2d6..db6589288b6abd6b76b934de07e8976456e14e61 100644 ---- a/arch/arm/configs/bcmrpi_defconfig -+++ b/arch/arm/configs/bcmrpi_defconfig -@@ -876,7 +876,9 @@ CONFIG_SND_AUDIOINJECTOR_OCTO_SOUNDCARD=m - CONFIG_SND_DIGIDAC1_SOUNDCARD=m - CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO=m - CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO_V2=m -+CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC=m - CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC=m -+CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS=m - CONFIG_SND_BCM2708_SOC_FE_PI_AUDIO=m - CONFIG_SND_PISOUND=m - CONFIG_SND_SOC_ADAU1701=m -diff --git a/sound/soc/bcm/allo-piano-dac-plus.c b/sound/soc/bcm/allo-piano-dac-plus.c -index f66f42abadbd5f9d3fe000676e8297ed91630e47..56e43f98846b41e487b3089813f7edc3c08517eb 100644 ---- a/sound/soc/bcm/allo-piano-dac-plus.c -+++ b/sound/soc/bcm/allo-piano-dac-plus.c -@@ -18,7 +18,7 @@ - - #include - #include -- -+#include - #include - #include - #include -@@ -34,9 +34,19 @@ struct dsp_code { - char val; - }; - --static struct snd_soc_pcm_runtime *rtd_glb; -+struct glb_pool { -+ struct mutex lock; -+ unsigned int set_lowpass; -+ unsigned int set_mode; -+ unsigned int set_rate; -+ unsigned int dsp_page_number; -+}; -+ - static bool digital_gain_0db_limit = true; --unsigned int set_lowpass, set_mode, set_rate, dsp_page_number; -+bool glb_mclk; -+ -+static struct gpio_desc *mute_gpio[2]; -+ - - static const char * const allo_piano_mode_texts[] = { - "2.0", -@@ -68,12 +78,14 @@ static const char * const allo_piano_dsp_low_pass_texts[] = { - static const SOC_ENUM_SINGLE_DECL(allo_piano_enum, - 0, 0, allo_piano_dsp_low_pass_texts); - --static int snd_allo_piano_dsp_program(struct snd_soc_pcm_runtime *rtd, -+static int __snd_allo_piano_dsp_program(struct snd_soc_pcm_runtime *rtd, - unsigned int mode, unsigned int rate, unsigned int lowpass) - { - const struct firmware *fw; -- char firmware_name[40]; -+ char firmware_name[60]; - int ret = 0, dac = 0; -+ struct snd_soc_card *card = rtd->card; -+ struct glb_pool *glb_ptr = card->drvdata; - - if (rate <= 46000) - rate = 44100; -@@ -88,47 +100,51 @@ static int snd_allo_piano_dsp_program(struct snd_soc_pcm_runtime *rtd, - else - rate = 192000; - -- /* same configuration loaded */ -- if ((rate == set_rate) && (lowpass == set_lowpass) -- && (mode == set_mode)) -- return 1; -+ if ((lowpass > 14) || (lowpass < 0)) -+ lowpass = 3; -+ if ((mode > 2) || (mode < 0)) -+ mode = 0; - -- set_rate = rate; -- set_mode = mode; -+ /* same configuration loaded */ -+ if ((rate == glb_ptr->set_rate) && (lowpass == glb_ptr->set_lowpass) -+ && (mode == glb_ptr->set_mode)) -+ return 0; - - if (mode == 0) { /* 2.0 */ - snd_soc_write(rtd->codec_dais[1]->codec, -- PCM512x_MUTE, 0x11); -+ PCM512x_MUTE, 0x11); -+ glb_ptr->set_rate = rate; -+ glb_ptr->set_mode = mode; -+ glb_ptr->set_lowpass = lowpass; - return 1; - } else { - snd_soc_write(rtd->codec_dais[1]->codec, -- PCM512x_MUTE, 0x00); -+ PCM512x_MUTE, 0x00); - } - -- set_lowpass = lowpass; -- - for (dac = 0; dac < rtd->num_codecs; dac++) { - struct dsp_code *dsp_code_read; -- int i = 1; - struct snd_soc_codec *codec = rtd->codec_dais[dac]->codec; -+ int i = 1; - - if (dac == 0) { /* high */ - sprintf(firmware_name, -- "alloPiano/2.2/allo-piano-dsp-%d-%d-%d.bin", -- rate, ((set_lowpass * 10) + 60), dac); -+ "allo/piano/2.2/allo-piano-dsp-%d-%d-%d.bin", -+ rate, ((lowpass * 10) + 60), dac); - } else { /* low */ - sprintf(firmware_name, -- "alloPiano/2.%d/allo-piano-dsp-%d-%d-%d.bin", -- set_mode, rate, ((set_lowpass * 10) + 60), dac); -+ "allo/piano/2.%d/allo-piano-dsp-%d-%d-%d.bin", -+ mode, rate, ((lowpass * 10) + 60), dac); - } - - dev_info(codec->dev, "Dsp Firmware File Name: %s\n", -- firmware_name); -+ firmware_name); - - ret = request_firmware(&fw, firmware_name, codec->dev); - if (ret < 0) { -- dev_err(codec->dev, "Error: AlloPiano Firmware %s missing. %d\n", -- firmware_name, ret); -+ dev_err(codec->dev, -+ "Error: Allo Piano Firmware %s missing. %d\n", -+ firmware_name, ret); - goto err; - } - -@@ -136,62 +152,97 @@ static int snd_allo_piano_dsp_program(struct snd_soc_pcm_runtime *rtd, - dsp_code_read = (struct dsp_code *)&fw->data[i]; - - if (dsp_code_read->offset == 0) { -- dsp_page_number = dsp_code_read->val; -+ glb_ptr->dsp_page_number = dsp_code_read->val; - ret = snd_soc_write(rtd->codec_dais[dac]->codec, - PCM512x_PAGE_BASE(0), - dsp_code_read->val); - - } else if (dsp_code_read->offset != 0) { - ret = snd_soc_write(rtd->codec_dais[dac]->codec, -- (PCM512x_PAGE_BASE(dsp_page_number) + -+ (PCM512x_PAGE_BASE( -+ glb_ptr->dsp_page_number) + - dsp_code_read->offset), - dsp_code_read->val); -- - } - if (ret < 0) { - dev_err(codec->dev, - "Failed to write Register: %d\n", ret); -+ release_firmware(fw); - goto err; - } - i = i + 3; - } - release_firmware(fw); - } -+ glb_ptr->set_rate = rate; -+ glb_ptr->set_mode = mode; -+ glb_ptr->set_lowpass = lowpass; - return 1; - - err: -- release_firmware(fw); -+ return ret; -+} -+ -+static int snd_allo_piano_dsp_program(struct snd_soc_pcm_runtime *rtd, -+ unsigned int mode, unsigned int rate, unsigned int lowpass) -+{ -+ struct snd_soc_card *card = rtd->card; -+ struct glb_pool *glb_ptr = card->drvdata; -+ int ret = 0; -+ -+ mutex_lock(&glb_ptr->lock); -+ -+ ret = __snd_allo_piano_dsp_program(rtd, -+ mode, rate, lowpass); -+ mutex_unlock(&glb_ptr->lock); -+ - return ret; - } - - static int snd_allo_piano_mode_get(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_value *ucontrol) - { -- ucontrol->value.integer.value[0] = set_mode; -+ struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); -+ struct glb_pool *glb_ptr = card->drvdata; -+ -+ ucontrol->value.integer.value[0] = glb_ptr->set_mode; - return 0; - } - - static int snd_allo_piano_mode_put(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_value *ucontrol) - { -- return(snd_allo_piano_dsp_program(rtd_glb, -- ucontrol->value.integer.value[0], -- set_rate, set_lowpass)); -+ struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); -+ struct snd_soc_pcm_runtime *rtd; -+ struct glb_pool *glb_ptr = card->drvdata; -+ -+ rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); -+ return(snd_allo_piano_dsp_program(rtd, -+ ucontrol->value.integer.value[0], -+ glb_ptr->set_rate, glb_ptr->set_lowpass)); - } - - static int snd_allo_piano_lowpass_get(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_value *ucontrol) - { -- ucontrol->value.integer.value[0] = set_lowpass; -+ struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); -+ struct glb_pool *glb_ptr = card->drvdata; -+ -+ ucontrol->value.integer.value[0] = glb_ptr->set_lowpass; - return 0; - } - - static int snd_allo_piano_lowpass_put(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_value *ucontrol) - { -- return(snd_allo_piano_dsp_program(rtd_glb, -- set_mode, set_rate, -- ucontrol->value.integer.value[0])); -+ struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); -+ struct snd_soc_pcm_runtime *rtd; -+ struct glb_pool *glb_ptr = card->drvdata; -+ -+ rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); -+ return(snd_allo_piano_dsp_program(rtd, -+ glb_ptr->set_mode, glb_ptr->set_rate, -+ ucontrol->value.integer.value[0])); - } - - static int pcm512x_get_reg_sub(struct snd_kcontrol *kcontrol, -@@ -199,15 +250,18 @@ static int pcm512x_get_reg_sub(struct snd_kcontrol *kcontrol, - { - struct soc_mixer_control *mc = - (struct soc_mixer_control *)kcontrol->private_value; -+ struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); -+ struct snd_soc_pcm_runtime *rtd; - unsigned int left_val = 0; - unsigned int right_val = 0; - -- left_val = snd_soc_read(rtd_glb->codec_dais[1]->codec, -+ rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); -+ left_val = snd_soc_read(rtd->codec_dais[1]->codec, - PCM512x_DIGITAL_VOLUME_2); - if (left_val < 0) - return left_val; - -- right_val = snd_soc_read(rtd_glb->codec_dais[1]->codec, -+ right_val = snd_soc_read(rtd->codec_dais[1]->codec, - PCM512x_DIGITAL_VOLUME_3); - if (right_val < 0) - return right_val; -@@ -225,16 +279,19 @@ static int pcm512x_set_reg_sub(struct snd_kcontrol *kcontrol, - { - struct soc_mixer_control *mc = - (struct soc_mixer_control *)kcontrol->private_value; -+ struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); -+ struct snd_soc_pcm_runtime *rtd; - unsigned int left_val = (ucontrol->value.integer.value[0] & mc->max); - unsigned int right_val = (ucontrol->value.integer.value[1] & mc->max); - int ret = 0; - -- ret = snd_soc_write(rtd_glb->codec_dais[1]->codec, -+ rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); -+ ret = snd_soc_write(rtd->codec_dais[1]->codec, - PCM512x_DIGITAL_VOLUME_2, (~left_val)); - if (ret < 0) - return ret; - -- ret = snd_soc_write(rtd_glb->codec_dais[1]->codec, -+ ret = snd_soc_write(rtd->codec_dais[1]->codec, - PCM512x_DIGITAL_VOLUME_3, (~right_val)); - if (ret < 0) - return ret; -@@ -245,9 +302,12 @@ static int pcm512x_set_reg_sub(struct snd_kcontrol *kcontrol, - static int pcm512x_get_reg_sub_switch(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_value *ucontrol) - { -+ struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); -+ struct snd_soc_pcm_runtime *rtd; - int val = 0; - -- val = snd_soc_read(rtd_glb->codec_dais[1]->codec, PCM512x_MUTE); -+ rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); -+ val = snd_soc_read(rtd->codec_dais[1]->codec, PCM512x_MUTE); - if (val < 0) - return val; - -@@ -260,11 +320,14 @@ static int pcm512x_get_reg_sub_switch(struct snd_kcontrol *kcontrol, - static int pcm512x_set_reg_sub_switch(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_value *ucontrol) - { -+ struct snd_soc_card *card = snd_kcontrol_chip(kcontrol); -+ struct snd_soc_pcm_runtime *rtd; - unsigned int left_val = (ucontrol->value.integer.value[0]); - unsigned int right_val = (ucontrol->value.integer.value[1]); - int ret = 0; - -- ret = snd_soc_write(rtd_glb->codec_dais[1]->codec, PCM512x_MUTE, -+ rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); -+ ret = snd_soc_write(rtd->codec_dais[1]->codec, PCM512x_MUTE, - ~((left_val & 0x01)<<4 | (right_val & 0x01))); - if (ret < 0) - return ret; -@@ -276,23 +339,23 @@ static int pcm512x_set_reg_sub_switch(struct snd_kcontrol *kcontrol, - static const DECLARE_TLV_DB_SCALE(digital_tlv_sub, -10350, 50, 1); - - static const struct snd_kcontrol_new allo_piano_controls[] = { -- SOC_ENUM_EXT("Subwoofer mode", -+ SOC_ENUM_EXT("Subwoofer mode Route", - allo_piano_mode_enum, - snd_allo_piano_mode_get, - snd_allo_piano_mode_put), - -- SOC_ENUM_EXT("Lowpass", allo_piano_enum, -+ SOC_ENUM_EXT("Lowpass Route", allo_piano_enum, - snd_allo_piano_lowpass_get, - snd_allo_piano_lowpass_put), - -- SOC_DOUBLE_R_EXT_TLV("Subwoofer Digital Playback Volume", -+ SOC_DOUBLE_R_EXT_TLV("Subwoofer Playback Volume", - PCM512x_DIGITAL_VOLUME_2, - PCM512x_DIGITAL_VOLUME_3, 0, 255, 1, - pcm512x_get_reg_sub, - pcm512x_set_reg_sub, - digital_tlv_sub), - -- SOC_DOUBLE_EXT("Subwoofer Digital Playback Switch", -+ SOC_DOUBLE_EXT("Subwoofer Playback Switch", - PCM512x_MUTE, - PCM512x_RQML_SHIFT, - PCM512x_RQMR_SHIFT, 1, 1, -@@ -302,11 +365,20 @@ static const struct snd_kcontrol_new allo_piano_controls[] = { - - static int snd_allo_piano_dac_init(struct snd_soc_pcm_runtime *rtd) - { -- rtd_glb = rtd; -+ struct snd_soc_card *card = rtd->card; -+ struct glb_pool *glb_ptr; -+ -+ glb_ptr = kmalloc(sizeof(struct glb_pool), GFP_KERNEL); -+ if (!glb_ptr) -+ return -ENOMEM; -+ -+ memset(glb_ptr, 0x00, sizeof(glb_ptr)); -+ card->drvdata = glb_ptr; -+ -+ mutex_init(&glb_ptr->lock); - - if (digital_gain_0db_limit) { - int ret; -- struct snd_soc_card *card = rtd->card; - - ret = snd_soc_limit_volume(card, "Digital Playback Volume", - 207); -@@ -318,7 +390,71 @@ static int snd_allo_piano_dac_init(struct snd_soc_pcm_runtime *rtd) - return 0; - } - --static int snd_allo_piano_dac_hw_params(struct snd_pcm_substream *substream, -+static void snd_allo_piano_gpio_mute(struct snd_soc_card *card) -+{ -+ if (mute_gpio[0]) -+ gpiod_set_value_cansleep(mute_gpio[0], 1); -+ -+ if (mute_gpio[1]) -+ gpiod_set_value_cansleep(mute_gpio[1], 1); -+} -+ -+static void snd_allo_piano_gpio_unmute(struct snd_soc_card *card) -+{ -+ if (mute_gpio[0]) -+ gpiod_set_value_cansleep(mute_gpio[0], 0); -+ -+ if (mute_gpio[1]) -+ gpiod_set_value_cansleep(mute_gpio[1], 0); -+} -+ -+static int snd_allo_piano_set_bias_level(struct snd_soc_card *card, -+ struct snd_soc_dapm_context *dapm, enum snd_soc_bias_level level) -+{ -+ struct snd_soc_pcm_runtime *rtd; -+ struct snd_soc_dai *codec_dai; -+ -+ rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); -+ codec_dai = rtd->codec_dai; -+ -+ if (dapm->dev != codec_dai->dev) -+ return 0; -+ -+ switch (level) { -+ case SND_SOC_BIAS_PREPARE: -+ if (dapm->bias_level != SND_SOC_BIAS_STANDBY) -+ break; -+ /* UNMUTE DAC */ -+ snd_allo_piano_gpio_unmute(card); -+ break; -+ -+ case SND_SOC_BIAS_STANDBY: -+ if (dapm->bias_level != SND_SOC_BIAS_PREPARE) -+ break; -+ /* MUTE DAC */ -+ snd_allo_piano_gpio_mute(card); -+ break; -+ -+ default: -+ break; -+ } -+ -+ return 0; -+} -+ -+static int snd_allo_piano_dac_startup( -+ struct snd_pcm_substream *substream) -+{ -+ struct snd_soc_pcm_runtime *rtd = substream->private_data; -+ struct snd_soc_card *card = rtd->card; -+ -+ snd_allo_piano_gpio_mute(card); -+ -+ return 0; -+} -+ -+static int snd_allo_piano_dac_hw_params( -+ struct snd_pcm_substream *substream, - struct snd_pcm_hw_params *params) - { - struct snd_soc_pcm_runtime *rtd = substream->private_data; -@@ -327,17 +463,49 @@ static int snd_allo_piano_dac_hw_params(struct snd_pcm_substream *substream, - snd_pcm_format_physical_width(params_format(params)); - unsigned int rate = params_rate(params); - struct snd_soc_card *card = rtd->card; -- int ret = 0; -+ struct glb_pool *glb_ptr = card->drvdata; -+ int ret = 0, val = 0, dac; -+ -+ for (dac = 0; (glb_mclk && dac < 2); dac++) { -+ /* Configure the PLL clock reference for both the Codecs */ -+ val = snd_soc_read(rtd->codec_dais[dac]->codec, -+ PCM512x_RATE_DET_4); -+ if (val < 0) { -+ dev_err(rtd->codec_dais[dac]->codec->dev, -+ "Failed to read register PCM512x_RATE_DET_4\n"); -+ return val; -+ } -+ -+ if (val & 0x40) { -+ snd_soc_write(rtd->codec_dais[dac]->codec, -+ PCM512x_PLL_REF, -+ PCM512x_SREF_BCK); -+ -+ dev_info(rtd->codec_dais[dac]->codec->dev, -+ "Setting BCLK as input clock & Enable PLL\n"); -+ } else { -+ snd_soc_write(rtd->codec_dais[dac]->codec, -+ PCM512x_PLL_EN, -+ 0x00); -+ -+ snd_soc_write(rtd->codec_dais[dac]->codec, -+ PCM512x_PLL_REF, -+ PCM512x_SREF_SCK); -+ -+ dev_info(rtd->codec_dais[dac]->codec->dev, -+ "Setting SCLK as input clock & disabled PLL\n"); -+ } -+ } - -- rtd_glb = rtd; /* TODO */ - if (digital_gain_0db_limit) { - ret = snd_soc_limit_volume(card, -- "Subwoofer Digital Playback Volume", 207); -+ "Subwoofer Playback Volume", 207); - if (ret < 0) - dev_warn(card->dev, "Failed to set volume limit: %d\n", - ret); - } -- ret = snd_allo_piano_dsp_program(rtd, set_mode, rate, set_lowpass); -+ ret = snd_allo_piano_dsp_program(rtd, glb_ptr->set_mode, rate, -+ glb_ptr->set_lowpass); - if (ret < 0) - return ret; - -@@ -346,9 +514,21 @@ static int snd_allo_piano_dac_hw_params(struct snd_pcm_substream *substream, - return ret; - } - -+static int snd_allo_piano_dac_prepare( -+ struct snd_pcm_substream *substream) -+{ -+ struct snd_soc_pcm_runtime *rtd = substream->private_data; -+ struct snd_soc_card *card = rtd->card; -+ -+ snd_allo_piano_gpio_unmute(card); -+ return 0; -+} -+ - /* machine stream operations */ - static struct snd_soc_ops snd_allo_piano_dac_ops = { -+ .startup = snd_allo_piano_dac_startup, - .hw_params = snd_allo_piano_dac_hw_params, -+ .prepare = snd_allo_piano_dac_prepare, - }; - - static struct snd_soc_dai_link_component allo_piano_2_1_codecs[] = { -@@ -388,11 +568,11 @@ static struct snd_soc_card snd_allo_piano_dac = { - - static int snd_allo_piano_dac_probe(struct platform_device *pdev) - { -- int ret = 0, i = 0; - struct snd_soc_card *card = &snd_allo_piano_dac; -+ int ret = 0, i = 0; - - card->dev = &pdev->dev; -- snd_allo_piano_dac.dev = &pdev->dev; -+ platform_set_drvdata(pdev, &snd_allo_piano_dac); - - if (pdev->dev.of_node) { - struct device_node *i2s_node; -@@ -400,7 +580,7 @@ static int snd_allo_piano_dac_probe(struct platform_device *pdev) - - dai = &snd_allo_piano_dac_dai[0]; - i2s_node = of_parse_phandle(pdev->dev.of_node, -- "i2s-controller", 0); -+ "i2s-controller", 0); - if (i2s_node) { - for (i = 0; i < card->num_links; i++) { - dai->cpu_dai_name = NULL; -@@ -413,6 +593,9 @@ static int snd_allo_piano_dac_probe(struct platform_device *pdev) - !of_property_read_bool(pdev->dev.of_node, - "allo,24db_digital_gain"); - -+ glb_mclk = of_property_read_bool(pdev->dev.of_node, -+ "allo,glb_mclk"); -+ - allo_piano_2_1_codecs[0].of_node = - of_parse_phandle(pdev->dev.of_node, "audio-codec", 0); - if (!allo_piano_2_1_codecs[0].of_node) { -@@ -428,18 +611,51 @@ static int snd_allo_piano_dac_probe(struct platform_device *pdev) - "Property 'audio-codec' missing or invalid\n"); - return -EINVAL; - } -- } - -- ret = snd_soc_register_card(&snd_allo_piano_dac); -- if (ret < 0) -- dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", -- ret); -+ mute_gpio[0] = devm_gpiod_get_optional(&pdev->dev, "mute1", -+ GPIOD_OUT_LOW); -+ if (IS_ERR(mute_gpio[0])) { -+ ret = PTR_ERR(mute_gpio[0]); -+ dev_err(&pdev->dev, -+ "failed to get mute1 gpio6: %d\n", ret); -+ return ret; -+ } - -- return ret; -+ mute_gpio[1] = devm_gpiod_get_optional(&pdev->dev, "mute2", -+ GPIOD_OUT_LOW); -+ if (IS_ERR(mute_gpio[1])) { -+ ret = PTR_ERR(mute_gpio[1]); -+ dev_err(&pdev->dev, -+ "failed to get mute2 gpio25: %d\n", ret); -+ return ret; -+ } -+ -+ if (mute_gpio[0] && mute_gpio[1]) -+ snd_allo_piano_dac.set_bias_level = -+ snd_allo_piano_set_bias_level; -+ -+ ret = snd_soc_register_card(&snd_allo_piano_dac); -+ if (ret < 0) { -+ dev_err(&pdev->dev, -+ "snd_soc_register_card() failed: %d\n", ret); -+ return ret; -+ } -+ -+ if ((mute_gpio[0]) && (mute_gpio[1])) -+ snd_allo_piano_gpio_mute(&snd_allo_piano_dac); -+ -+ return 0; -+ } -+ -+ return -EINVAL; - } - - static int snd_allo_piano_dac_remove(struct platform_device *pdev) - { -+ struct snd_soc_card *card = platform_get_drvdata(pdev); -+ -+ kfree(&card->drvdata); -+ snd_allo_piano_gpio_mute(&snd_allo_piano_dac); - return snd_soc_unregister_card(&snd_allo_piano_dac); - } - - -From cd7c6b864b007dddd1af03884f8b91fe63d37602 Mon Sep 17 00:00:00 2001 +From 617bafcff4a60b78c02f14f1908902db7502d91a Mon Sep 17 00:00:00 2001 From: Yasunari Takiguchi Date: Fri, 14 Apr 2017 10:43:57 +0100 -Subject: [PATCH 138/201] This is the driver for Sony CXD2880 DVB-T2/T tuner + +Subject: [PATCH 117/134] 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. @@ -133141,493 +131254,92 @@ index 0000000000000000000000000000000000000000..82e122349055be817eb74ed5bbcd7560 +MODULE_AUTHOR("Sony Semiconductor Solutions Corporation"); +MODULE_LICENSE("GPL v2"); -From 9ebb7aaa59678b508c211da86753b78d8d1d3ffd Mon Sep 17 00:00:00 2001 -From: Yasunari Takiguchi -Date: Thu, 22 Dec 2016 15:34:12 +0900 -Subject: [PATCH 139/201] BCM2708: Add Raspberry Pi TV HAT Device Tree Support +From c5645e6290ba3b38fd6e72f961b253d010e33714 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Wed, 14 Sep 2016 09:18:09 +0100 +Subject: [PATCH 118/134] raspberrypi-firmware: Define the MBOX channel in the + header. -This is an EXAMPLE CODE of Raspberry Pi TV HAT device tree overlay. -Although this is not a part of our release code, it has been used to verify -CXD2880 device driver with TV HAT. - -Add the following line to /boot/config.txt to enable TV HAT: - -dtoverlay=rpi-tv - -Reboot Raspberry Pi and check the existance of /proc/device-tree/soc/spi@7e204000/cxd2880@0. -If exists, the installation is successful. you should be able to find the following three files. -/dev/dvb/adapter0/frontend0 -/dev/dvb/adapter0/demux0 -/dev/dvb/adapter0/dvr0 - -Signed-off-by: Yasunari Takiguchi -Signed-off-by: Masayuki Yamamoto -Signed-off-by: Hideki Nozawa -Signed-off-by: Kota Yonezawa -Signed-off-by: Toshihiko Matsumoto -Signed-off-by: Satoshi Watanabe +Signed-off-by: Eric Anholt --- - arch/arm/boot/dts/overlays/Makefile | 1 + - arch/arm/boot/dts/overlays/README | 6 ++++++ - arch/arm/boot/dts/overlays/rpi-tv-overlay.dts | 31 +++++++++++++++++++++++++++ - 3 files changed, 38 insertions(+) - create mode 100644 arch/arm/boot/dts/overlays/rpi-tv-overlay.dts + include/soc/bcm2835/raspberrypi-firmware.h | 2 ++ + 1 file changed, 2 insertions(+) -diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile -index b64dd7ac0630b2b525809a9f5221420f34a58ac9..e2f66a55dc5afe13d690c2c17827054ac94b7168 100644 ---- a/arch/arm/boot/dts/overlays/Makefile -+++ b/arch/arm/boot/dts/overlays/Makefile -@@ -81,6 +81,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ - rpi-ft5406.dtbo \ - rpi-proto.dtbo \ - rpi-sense.dtbo \ -+ rpi-tv.dtbo \ - rra-digidac1-wm8741-audio.dtbo \ - sc16is750-i2c.dtbo \ - sc16is752-spi1.dtbo \ -diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README -index 1377e5b8e8363c3e0ede318ce54bd784cb70d4c9..e2a803e5180cf78d67b6723cfd2f6d3b2b54e53b 100644 ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -1142,6 +1142,12 @@ Load: dtoverlay=rpi-sense - Params: +diff --git a/include/soc/bcm2835/raspberrypi-firmware.h b/include/soc/bcm2835/raspberrypi-firmware.h +index c819c21b0158a59c1308882e5a40e3f3fe73cbdf..de2a3dcd562beb752266eaf0070e55861d553f5f 100644 +--- a/include/soc/bcm2835/raspberrypi-firmware.h ++++ b/include/soc/bcm2835/raspberrypi-firmware.h +@@ -12,6 +12,8 @@ + #include + #include ++#define RPI_FIRMWARE_CHAN_FB 1 ++ + struct rpi_firmware; -+Name: rpi-tv -+Info: Raspberry Pi TV HAT -+Load: dtoverlay=rpi-tv -+Params: -+ -+ - Name: rra-digidac1-wm8741-audio - Info: Configures the Red Rocks Audio DigiDAC1 soundcard - Load: dtoverlay=rra-digidac1-wm8741-audio -diff --git a/arch/arm/boot/dts/overlays/rpi-tv-overlay.dts b/arch/arm/boot/dts/overlays/rpi-tv-overlay.dts -new file mode 100644 -index 0000000000000000000000000000000000000000..a68f6f793d8efd8b2e2adf9f2fb6426f61ff464a ---- /dev/null -+++ b/arch/arm/boot/dts/overlays/rpi-tv-overlay.dts -@@ -0,0 +1,31 @@ -+// rpi-tv HAT -+ -+/dts-v1/; -+/plugin/; -+ -+/ { -+ compatible = "brcm,bcm2708", "brcm,bcm2709"; -+ -+ fragment@0 { -+ target = <&spi0>; -+ __overlay__ { -+ /* needed to avoid dtc warning */ -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ status = "okay"; -+ -+ spidev@0 { -+ status = "disabled"; -+ }; -+ -+ cxd2880@0 { -+ compatible = "sony,cxd2880"; -+ reg = <0>; /* CE0 */ -+ spi-max-frequency = <50000000>; -+ status = "okay"; -+ }; -+ }; -+ }; -+ -+}; + enum rpi_firmware_property_status { -From 63dfa9e479f808c5a3d6a1aacbd6199359b58376 Mon Sep 17 00:00:00 2001 -From: P33M -Date: Thu, 27 Apr 2017 16:24:34 +0100 -Subject: [PATCH 140/201] dwc_otg: make nak_holdoff work as intended with empty - queues +From 374b27bc790642e431596320ff2b2a2ebf418ca5 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Wed, 14 Sep 2016 09:16:19 +0100 +Subject: [PATCH 119/134] raspberrypi-firmware: Export the general transaction + function. -If URBs reading from non-periodic split endpoints were dequeued and -the last transfer from the endpoint was a NAK handshake, the resulting -qh->nak_frame value was stale which would result in unnecessarily long -polling intervals for the first subsequent transfer with a fresh URB. +The vc4-firmware-kms module is going to be doing the MBOX FB call. -Fixup qh->nak_frame in dwc_otg_hcd_urb_dequeue and also guard against -a case where a single URB is submitted to the endpoint, a NAK was -received on the transfer immediately prior to receiving data and the -device subsequently resubmits another URB past the qh->nak_frame interval. - -Fixes https://github.com/raspberrypi/linux/issues/1709 +Signed-off-by: Eric Anholt --- - drivers/usb/host/dwc_otg/dwc_otg_hcd.c | 4 +++- - drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c | 10 ++++++---- - drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c | 4 ++++ - 3 files changed, 13 insertions(+), 5 deletions(-) + drivers/firmware/raspberrypi.c | 3 ++- + include/soc/bcm2835/raspberrypi-firmware.h | 1 + + 2 files changed, 3 insertions(+), 1 deletion(-) -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c -index 0eb335f4bc8ec30fa68f830fc3e382330302686e..4852d08d542f66880244d3dac3bbd35e7f4feb4e 100644 ---- a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c -+++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c -@@ -616,7 +616,7 @@ int dwc_otg_hcd_urb_dequeue(dwc_otg_hcd_t * hcd, - if (fiq_fsm_enable && (hcd->fiq_state->channel[n].fsm != FIQ_PASSTHROUGH)) { - qh->channel->halt_status = DWC_OTG_HC_XFER_URB_DEQUEUE; - qh->channel->halt_pending = 1; -- hcd->fiq_state->channel[n].fsm = FIQ_DEQUEUE_ISSUED; -+ //hcd->fiq_state->channel[n].fsm = FIQ_DEQUEUE_ISSUED; - } else { - dwc_otg_hc_halt(hcd->core_if, qh->channel, - DWC_OTG_HC_XFER_URB_DEQUEUE); -@@ -634,6 +634,8 @@ int dwc_otg_hcd_urb_dequeue(dwc_otg_hcd_t * hcd, - hcd->core_if->dma_desc_enable?"DMA ":""); - if (!hcd->core_if->dma_desc_enable) { - uint8_t b = urb_qtd->in_process; -+ if (nak_holdoff && qh->do_split && dwc_qh_is_non_per(qh)) -+ qh->nak_frame = 0xFFFF; - dwc_otg_hcd_qtd_remove_and_free(hcd, urb_qtd, qh); - if (b) { - dwc_otg_hcd_qh_deactivate(hcd, qh, 0); -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 b2618c15d1f1f0b062d4146672de5ae50e9e2d33..608e036be2c9484465ab836de70129335d3d2d96 100644 ---- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c -+++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c -@@ -2382,15 +2382,17 @@ void dwc_otg_hcd_handle_hc_fsm(dwc_otg_hcd_t *hcd, uint32_t num) - fiq_print(FIQDBG_INT, hcd->fiq_state, "OUT %01d %01d ", num , st->fsm); +diff --git a/drivers/firmware/raspberrypi.c b/drivers/firmware/raspberrypi.c +index 3f070bd38a91511c986e3fb114b15bd4ac32634c..f261b64d1657c02290904d841e1f087c34e27ded 100644 +--- a/drivers/firmware/raspberrypi.c ++++ b/drivers/firmware/raspberrypi.c +@@ -42,7 +42,7 @@ static void response_callback(struct mbox_client *cl, void *msg) + * Sends a request to the firmware through the BCM2835 mailbox driver, + * and synchronously waits for the reply. + */ +-static int ++int + rpi_firmware_transaction(struct rpi_firmware *fw, u32 chan, u32 data) + { + u32 message = MBOX_MSG(chan, data); +@@ -63,6 +63,7 @@ rpi_firmware_transaction(struct rpi_firmware *fw, u32 chan, u32 data) - hostchannels = hcd->available_host_channels; -+ if (hc->halt_pending) { -+ /* Dequeue: The FIQ was allowed to complete the transfer but state has been cleared. */ -+ release_channel(hcd, hc, NULL, hc->halt_status); -+ return; -+ } - switch (st->fsm) { - case FIQ_TEST: - break; - - case FIQ_DEQUEUE_ISSUED: -- /* hc_halt was called. QTD no longer exists. */ -- /* TODO: for a nonperiodic split transaction, need to issue a -- * CLEAR_TT_BUFFER hub command if we were in the start-split phase. -- */ -+ /* Handled above, but keep for posterity */ - release_channel(hcd, hc, NULL, hc->halt_status); - break; - -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c -index c2dff94e8e6edd22e4427aaa1eac7aad972cb6bd..85a6d431ca54b47dc10573aa72d1ad69d06f2e36 100644 ---- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c -+++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c -@@ -793,6 +793,10 @@ void dwc_otg_hcd_qh_deactivate(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh, - /* Add back to inactive non-periodic schedule. */ - dwc_otg_hcd_qh_add(hcd, qh); - //hcd->fiq_state->kick_np_queues = 1; -+ } else { -+ if(nak_holdoff && qh->do_split) { -+ qh->nak_frame = 0xFFFF; -+ } - } - } else { - uint16_t frame_number = dwc_otg_hcd_get_frame_number(hcd); - -From 91ff5f9916e05c8ad569cc86b442c917a03d4452 Mon Sep 17 00:00:00 2001 -From: P33M -Date: Tue, 2 May 2017 16:31:15 +0100 -Subject: [PATCH 141/201] dwc_otg: fix split transaction data toggle handling - around dequeues - -See https://github.com/raspberrypi/linux/issues/1709 - -Fix several issues regarding endpoint state when URBs are dequeued -- If the HCD is disconnected, flush FIQ-enabled channels properly -- Save the data toggle state for bulk endpoints if the last transfer - from an endpoint where URBs were dequeued returned a data packet -- Reset hc->start_pkt_count properly in assign_and_init_hc() ---- - drivers/usb/host/dwc_otg/dwc_otg_hcd.c | 10 ++++++++-- - drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c | 19 ++++++++++++++++--- - 2 files changed, 24 insertions(+), 5 deletions(-) - -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c -index 4852d08d542f66880244d3dac3bbd35e7f4feb4e..37c9d7d38287b616fcd335e80aa4110521fa98ca 100644 ---- a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c -+++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c -@@ -193,8 +193,13 @@ static void kill_urbs_in_qh_list(dwc_otg_hcd_t * hcd, dwc_list_link_t * qh_list) - * It is possible that the channel has already halted - * but not yet been through the IRQ handler. - */ -- dwc_otg_hc_halt(hcd->core_if, qh->channel, -- DWC_OTG_HC_XFER_URB_DEQUEUE); -+ if (fiq_fsm_enable && (hcd->fiq_state->channel[qh->channel->hc_num].fsm != FIQ_PASSTHROUGH)) { -+ qh->channel->halt_status = DWC_OTG_HC_XFER_URB_DEQUEUE; -+ qh->channel->halt_pending = 1; -+ } else { -+ dwc_otg_hc_halt(hcd->core_if, qh->channel, -+ DWC_OTG_HC_XFER_URB_DEQUEUE); -+ } - if(microframe_schedule) - hcd->available_host_channels++; - qh->channel = NULL; -@@ -1270,6 +1275,7 @@ static void assign_and_init_hc(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh) - if (qh->do_split) { - uint32_t hub_addr, port_addr; - hc->do_split = 1; -+ hc->start_pkt_count = 1; - hc->xact_pos = qtd->isoc_split_pos; - /* We don't need to do complete splits anymore */ - // if(fiq_fsm_enable) -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 608e036be2c9484465ab836de70129335d3d2d96..718a1accc0c219a1764ce53d291de6a2b6f93608 100644 ---- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c -+++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c -@@ -2378,12 +2378,20 @@ void dwc_otg_hcd_handle_hc_fsm(dwc_otg_hcd_t *hcd, uint32_t num) - dwc_otg_qh_t *qh = hc->qh; - dwc_otg_hc_regs_t *hc_regs = hcd->core_if->host_if->hc_regs[num]; - hcint_data_t hcint = hcd->fiq_state->channel[num].hcint_copy; -+ hctsiz_data_t hctsiz = hcd->fiq_state->channel[num].hctsiz_copy; - int hostchannels = 0; - fiq_print(FIQDBG_INT, hcd->fiq_state, "OUT %01d %01d ", num , st->fsm); - - hostchannels = hcd->available_host_channels; - if (hc->halt_pending) { - /* Dequeue: The FIQ was allowed to complete the transfer but state has been cleared. */ -+ if (st->fsm == FIQ_NP_SPLIT_DONE && hcint.b.xfercomp && qh->ep_type == UE_BULK) { -+ if (hctsiz.b.pid == DWC_HCTSIZ_DATA0) { -+ qh->data_toggle = DWC_OTG_HC_PID_DATA1; -+ } else { -+ qh->data_toggle = DWC_OTG_HC_PID_DATA0; -+ } -+ } - release_channel(hcd, hc, NULL, hc->halt_status); - return; - } -@@ -2641,10 +2649,15 @@ int32_t dwc_otg_hcd_handle_hc_n_intr(dwc_otg_hcd_t * dwc_otg_hcd, uint32_t num) - hc = dwc_otg_hcd->hc_ptr_array[num]; - hc_regs = dwc_otg_hcd->core_if->host_if->hc_regs[num]; - if(hc->halt_status == DWC_OTG_HC_XFER_URB_DEQUEUE) { -- /* We are responding to a channel disable. Driver -- * state is cleared - our qtd has gone away. -+ /* A dequeue was issued for this transfer. Our QTD has gone away -+ * but in the case of a FIQ transfer, the transfer would have run -+ * to completion. - */ -- release_channel(dwc_otg_hcd, hc, NULL, hc->halt_status); -+ if (fiq_fsm_enable && dwc_otg_hcd->fiq_state->channel[num].fsm != FIQ_PASSTHROUGH) { -+ dwc_otg_hcd_handle_hc_fsm(dwc_otg_hcd, num); -+ } else { -+ release_channel(dwc_otg_hcd, hc, NULL, hc->halt_status); -+ } - return 1; - } - qtd = DWC_CIRCLEQ_FIRST(&hc->qh->qtd_list); - -From 6590ccf17df2fd07d683320e2dca016117d1ab89 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Tue, 2 May 2017 16:36:05 +0100 -Subject: [PATCH 142/201] vcsm: Treat EBUSY as success rather than SIGBUS - -Currently if two cores access the same page concurrently one will return VM_FAULT_NOPAGE -and the other VM_FAULT_SIGBUS crashing the user code. - -Also report when mapping fails. - -Signed-off-by: popcornmix ---- - drivers/char/broadcom/vc_sm/vmcs_sm.c | 9 +++++++++ - 1 file changed, 9 insertions(+) - -diff --git a/drivers/char/broadcom/vc_sm/vmcs_sm.c b/drivers/char/broadcom/vc_sm/vmcs_sm.c -index fd71d9fbb400d71bb8cfb8672080e7c3053e3ae9..fd2ca788dcd56b1702454d71b7bedd4203179500 100644 ---- a/drivers/char/broadcom/vc_sm/vmcs_sm.c -+++ b/drivers/char/broadcom/vc_sm/vmcs_sm.c -@@ -1181,11 +1181,20 @@ static int vcsm_vma_fault(struct vm_fault *vmf) - switch (ret) { - case 0: - case -ERESTARTSYS: -+ /* -+ * EBUSY is ok: this just means that another thread -+ * already did the job. -+ */ -+ case -EBUSY: - return VM_FAULT_NOPAGE; - case -ENOMEM: - case -EAGAIN: -+ pr_err("[%s]: failed to map page pfn:%lx virt:%lx ret:%d\n", __func__, -+ pfn, (unsigned long)vmf->address, ret); - return VM_FAULT_OOM; - default: -+ pr_err("[%s]: failed to map page pfn:%lx virt:%lx ret:%d\n", __func__, -+ pfn, (unsigned long)vmf->address, ret); - return VM_FAULT_SIGBUS; - } + return ret; } - -From 4694aad3a41f3f4afd53c8e1ffcb8cf9a87bb8db Mon Sep 17 00:00:00 2001 -From: P33M -Date: Thu, 4 May 2017 12:58:11 +0100 -Subject: [PATCH 143/201] fiq_fsm: Use correct states when starting isoc OUT - transfers - -In fiq_fsm_start_next_periodic() if an isochronous OUT transfer -was selected, no regard was given as to whether this was a single-packet -transfer or a multi-packet staged transfer. - -For single-packet transfers, this had the effect of repeatedly sending -OUT packets with bogus data and lengths. - -Eventually if the channel was repeatedly enabled enough times, this -would lock up the OTG core and no further bus transfers would happen. - -Set the FSM state up properly if we select a single-packet transfer. - -Fixes https://github.com/raspberrypi/linux/issues/1842 ---- - drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c b/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c -index 9304279592cb5b388086ef91cb52f1e9f94868ce..208252645c09d1d17bf07673989f91b7f4b3ef7a 100644 ---- a/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c -+++ b/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c -@@ -491,7 +491,10 @@ static void notrace noinline fiq_fsm_start_next_periodic(struct fiq_state *st, i - if (st->channel[n].fsm == FIQ_PER_ISO_OUT_PENDING) { - if (!fiq_fsm_tt_in_use(st, num_channels, n)) { - fiq_print(FIQDBG_INT, st, "NEXTISO "); -- st->channel[n].fsm = FIQ_PER_ISO_OUT_ACTIVE; -+ if (st->channel[n].nrpackets == 1) -+ st->channel[n].fsm = FIQ_PER_ISO_OUT_LAST; -+ else -+ st->channel[n].fsm = FIQ_PER_ISO_OUT_ACTIVE; - fiq_fsm_restart_channel(st, n, 0); - break; - } - -From ec24caf52270ce50c59081921f6409e9fed6c840 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 4 May 2017 17:38:22 +0100 -Subject: [PATCH 144/201] bcm2708_fb: Avoid firmware mbox call in vc_mem_copy - -If firmware has locked up it is useful to get vcdbg log out without a firmware mbox response. -Issue the mbox call at probe time instead. - -Signed-off-by: popcornmix ---- - drivers/video/fbdev/bcm2708_fb.c | 18 ++++++++++-------- - 1 file changed, 10 insertions(+), 8 deletions(-) - -diff --git a/drivers/video/fbdev/bcm2708_fb.c b/drivers/video/fbdev/bcm2708_fb.c -index 53c5a0bdadb4be9251affdabed66305842a08e72..612293cf9f1bd93ad2f2aefdd7ca0f5eb2a412f0 100644 ---- a/drivers/video/fbdev/bcm2708_fb.c -+++ b/drivers/video/fbdev/bcm2708_fb.c -@@ -96,6 +96,7 @@ struct bcm2708_fb { - wait_queue_head_t dma_waitq; - struct bcm2708_fb_stats stats; - unsigned long fb_bus_address; -+ struct { u32 base, length; } gpu; - }; ++EXPORT_SYMBOL_GPL(rpi_firmware_transaction); - #define to_bcm2708(info) container_of(info, struct bcm2708_fb, fb) -@@ -472,7 +473,6 @@ static long vc_mem_copy(struct bcm2708_fb *fb, unsigned long arg) - dma_addr_t bus_addr; - long rc = 0; - size_t offset; -- struct { u32 base, length; } gpu = {}; + /** + * rpi_firmware_property_list - Submit firmware property list +diff --git a/include/soc/bcm2835/raspberrypi-firmware.h b/include/soc/bcm2835/raspberrypi-firmware.h +index de2a3dcd562beb752266eaf0070e55861d553f5f..dc7fd58afd5dddebf9b17065bb069a1db663362c 100644 +--- a/include/soc/bcm2835/raspberrypi-firmware.h ++++ b/include/soc/bcm2835/raspberrypi-firmware.h +@@ -156,5 +156,6 @@ static inline struct rpi_firmware *rpi_firmware_get(struct device_node *firmware + return NULL; + } + #endif ++int rpi_firmware_transaction(struct rpi_firmware *fw, u32 chan, u32 data); - /* restrict this to root user */ - if (!uid_eq(current_euid(), GLOBAL_ROOT_UID)) -@@ -491,16 +491,13 @@ static long vc_mem_copy(struct bcm2708_fb *fb, unsigned long arg) - goto out; - } - -- rc = rpi_firmware_property(fb->fw, -- RPI_FIRMWARE_GET_VC_MEMORY, -- &gpu, sizeof(gpu)); -- if (rc != 0 || gpu.base == 0 || gpu.length == 0) { -- pr_err("[%s]: Unable to determine gpu memory %ld,%x,%x)\n", __func__, rc, gpu.base, gpu.length); -+ if (fb->gpu.base == 0 || fb->gpu.length == 0) { -+ pr_err("[%s]: Unable to determine gpu memory (%x,%x)\n", __func__, fb->gpu.base, fb->gpu.length); - return -EFAULT; - } - -- if (INTALIAS_NORMAL(ioparam.src) < gpu.base || INTALIAS_NORMAL(ioparam.src) >= gpu.base + gpu.length) { -- pr_err("[%s]: Invalid memory access %x (%x-%x)", __func__, INTALIAS_NORMAL(ioparam.src), gpu.base, gpu.base + gpu.length); -+ if (INTALIAS_NORMAL(ioparam.src) < fb->gpu.base || INTALIAS_NORMAL(ioparam.src) >= fb->gpu.base + fb->gpu.length) { -+ pr_err("[%s]: Invalid memory access %x (%x-%x)", __func__, INTALIAS_NORMAL(ioparam.src), fb->gpu.base, fb->gpu.base + fb->gpu.length); - return -EFAULT; - } - -@@ -869,6 +866,11 @@ static int bcm2708_fb_probe(struct platform_device *dev) - fb->dev = dev; - fb->fb.device = &dev->dev; - -+ // failure here isn't fatal, but we'll fail in vc_mem_copy if fb->gpu is not valid -+ rpi_firmware_property(fb->fw, -+ RPI_FIRMWARE_GET_VC_MEMORY, -+ &fb->gpu, sizeof(fb->gpu)); -+ - ret = bcm2708_fb_register(fb); - if (ret == 0) { - platform_set_drvdata(dev, fb); + #endif /* __SOC_RASPBERRY_FIRMWARE_H__ */ -From 15c99f3dbb328e128abadf6e31c083cc656f7401 Mon Sep 17 00:00:00 2001 -From: Nisar Sayed -Date: Tue, 9 May 2017 18:51:42 +0100 -Subject: [PATCH 145/201] According to RFC 2460, IPv6 UDP calculated checksum - yields a result of zero must be changed to 0xffff, however this feature is - not supported by smsc95xx family hence enable csum offload only for IPv4 - TCP/UDP packets. - -Signed-off-by: Nisar Sayed - -Reported-by: popcorn mix ---- - drivers/net/usb/smsc95xx.c | 10 +++++++--- - 1 file changed, 7 insertions(+), 3 deletions(-) - -diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c -index f6661e388f6e801c1b88e48a3b71407bd70cf56e..b84e98508b5d97165b68dfc30240950e78bb14c3 100644 ---- a/drivers/net/usb/smsc95xx.c -+++ b/drivers/net/usb/smsc95xx.c -@@ -694,7 +694,7 @@ static int smsc95xx_set_features(struct net_device *netdev, - if (ret < 0) - return ret; - -- if (features & NETIF_F_HW_CSUM) -+ if (features & NETIF_F_IP_CSUM) - read_buf |= Tx_COE_EN_; - else - read_buf &= ~Tx_COE_EN_; -@@ -1342,12 +1342,16 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf) - - spin_lock_init(&pdata->mac_cr_lock); - -+ /* RFC 2460, IPv6 UDP calculated checksum yields a result of zero must be -+ * changed to 0xffff, this feature is not supported by smsc95xx family, -+ * hence enable csum offload only for IPv4 TCP/UDP packets. -+ */ - if (DEFAULT_TX_CSUM_ENABLE) -- dev->net->features |= NETIF_F_HW_CSUM; -+ dev->net->features |= NETIF_F_IP_CSUM; - if (DEFAULT_RX_CSUM_ENABLE) - dev->net->features |= NETIF_F_RXCSUM; - -- dev->net->hw_features = NETIF_F_HW_CSUM | NETIF_F_RXCSUM; -+ dev->net->hw_features = NETIF_F_IP_CSUM | NETIF_F_RXCSUM; - - smsc95xx_init_mac_address(dev); - - -From c98202cb43187bb55df96fabfbec20a859316def Mon Sep 17 00:00:00 2001 +From 1bd16b096644cbb6cb0f57543b34f89175f4d166 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 14 Sep 2016 08:39:33 +0100 -Subject: [PATCH 146/201] drm/vc4: Add a mode for using the closed firmware for +Subject: [PATCH 120/134] drm/vc4: Add a mode for using the closed firmware for display. Signed-off-by: Eric Anholt --- drivers/gpu/drm/vc4/Makefile | 1 + - drivers/gpu/drm/vc4/vc4_crtc.c | 13 + + drivers/gpu/drm/vc4/vc4_crtc.c | 17 + drivers/gpu/drm/vc4/vc4_drv.c | 1 + drivers/gpu/drm/vc4/vc4_drv.h | 7 + - drivers/gpu/drm/vc4/vc4_firmware_kms.c | 660 +++++++++++++++++++++++++++++++++ - 5 files changed, 682 insertions(+) + drivers/gpu/drm/vc4/vc4_firmware_kms.c | 658 +++++++++++++++++++++++++++++++++ + 5 files changed, 684 insertions(+) create mode 100644 drivers/gpu/drm/vc4/vc4_firmware_kms.c diff --git a/drivers/gpu/drm/vc4/Makefile b/drivers/gpu/drm/vc4/Makefile @@ -133643,10 +131355,10 @@ index 61f45d122bd0f73b04d4e6aefd0b7ec6f607d04e..897f658bee287f84f7dde8dca43090ad vc4_gem.o \ vc4_hdmi.o \ diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c -index 9fcf05ca492b0c065a323f69be32ed3cc93b630f..0ed39e6b9bae3d5dd3d578a3e4400f12e8a56a53 100644 +index d86c8cce318270a0e34b09c3a1713d48e1a4ff0b..54a44511b8bc05cda2cf9330fe2ff673ab075baa 100644 --- a/drivers/gpu/drm/vc4/vc4_crtc.c +++ b/drivers/gpu/drm/vc4/vc4_crtc.c -@@ -163,6 +163,9 @@ int vc4_crtc_get_scanoutpos(struct drm_device *dev, unsigned int crtc_id, +@@ -164,6 +164,9 @@ int vc4_crtc_get_scanoutpos(struct drm_device *dev, unsigned int crtc_id, int vblank_lines; int ret = 0; @@ -133656,8 +131368,12 @@ index 9fcf05ca492b0c065a323f69be32ed3cc93b630f..0ed39e6b9bae3d5dd3d578a3e4400f12 /* preempt_disable_rt() should go right here in PREEMPT_RT patchset. */ /* Get optional system timestamp before query. */ -@@ -659,6 +662,11 @@ int vc4_enable_vblank(struct drm_device *dev, unsigned int crtc_id) - struct drm_crtc *crtc = drm_crtc_from_index(dev, crtc_id); +@@ -658,8 +661,15 @@ static void vc4_crtc_atomic_flush(struct drm_crtc *crtc, + + static int vc4_enable_vblank(struct drm_crtc *crtc) + { ++ struct drm_device *dev = crtc->dev; ++ struct vc4_dev *vc4 = to_vc4_dev(dev); struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); + if (vc4->firmware_kms) { @@ -133668,8 +131384,12 @@ index 9fcf05ca492b0c065a323f69be32ed3cc93b630f..0ed39e6b9bae3d5dd3d578a3e4400f12 CRTC_WRITE(PV_INTEN, PV_INT_VFP_START); return 0; -@@ -669,6 +677,11 @@ void vc4_disable_vblank(struct drm_device *dev, unsigned int crtc_id) - struct drm_crtc *crtc = drm_crtc_from_index(dev, crtc_id); +@@ -667,8 +677,15 @@ static int vc4_enable_vblank(struct drm_crtc *crtc) + + static void vc4_disable_vblank(struct drm_crtc *crtc) + { ++ struct drm_device *dev = crtc->dev; ++ struct vc4_dev *vc4 = to_vc4_dev(dev); struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); + if (vc4->firmware_kms) { @@ -133681,10 +131401,10 @@ index 9fcf05ca492b0c065a323f69be32ed3cc93b630f..0ed39e6b9bae3d5dd3d578a3e4400f12 } diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c -index a459745e96f7bb1f81b24077042da4c0c0063525..6661655bd19950e3d530ed6ae826af424fa23466 100644 +index 61e674baf3a6f6cd0c0356d245d9879f7fdd1b67..b2b5a412623da3ef6d3a7efb09516b4535d77d2f 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c -@@ -298,6 +298,7 @@ static struct platform_driver *const component_drivers[] = { +@@ -311,6 +311,7 @@ static struct platform_driver *const component_drivers[] = { &vc4_dsi_driver, &vc4_hvs_driver, &vc4_crtc_driver, @@ -133693,7 +131413,7 @@ index a459745e96f7bb1f81b24077042da4c0c0063525..6661655bd19950e3d530ed6ae826af42 }; diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h -index 0e59f3ee1b8344505a8f9d1e3abd478cee3dd37a..5042d5e024ce73b4b83f2c8fda80402300441f27 100644 +index dffce6293d875416e38a7c722a1e26dc925f4bf5..a8a7ecb22e69e20f86315f949964e6bf7a9e50b6 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.h +++ b/drivers/gpu/drm/vc4/vc4_drv.h @@ -14,6 +14,9 @@ @@ -133706,7 +131426,7 @@ index 0e59f3ee1b8344505a8f9d1e3abd478cee3dd37a..5042d5e024ce73b4b83f2c8fda804023 struct vc4_hdmi *hdmi; struct vc4_hvs *hvs; struct vc4_v3d *v3d; -@@ -470,6 +473,10 @@ int vc4_dpi_debugfs_regs(struct seq_file *m, void *unused); +@@ -468,6 +471,10 @@ int vc4_dpi_debugfs_regs(struct seq_file *m, void *unused); extern struct platform_driver vc4_dsi_driver; int vc4_dsi_debugfs_regs(struct seq_file *m, void *unused); @@ -133719,10 +131439,10 @@ index 0e59f3ee1b8344505a8f9d1e3abd478cee3dd37a..5042d5e024ce73b4b83f2c8fda804023 void vc4_gem_destroy(struct drm_device *dev); diff --git a/drivers/gpu/drm/vc4/vc4_firmware_kms.c b/drivers/gpu/drm/vc4/vc4_firmware_kms.c new file mode 100644 -index 0000000000000000000000000000000000000000..d18a1dae51a2275846c9826b5bf1ba57ae97b55c +index 0000000000000000000000000000000000000000..1e09980c61a91246156c4ab661c03779baa1fc97 --- /dev/null +++ b/drivers/gpu/drm/vc4/vc4_firmware_kms.c -@@ -0,0 +1,660 @@ +@@ -0,0 +1,658 @@ +/* + * Copyright (C) 2016 Broadcom + * @@ -133901,7 +131621,6 @@ index 0000000000000000000000000000000000000000..d18a1dae51a2275846c9826b5bf1ba57 + bo->paddr + fb->offsets[0], + 0, 0, /* hotx, hoty */}; + WARN_ON_ONCE(fb->pitches[0] != state->crtc_w * 4); -+ WARN_ON_ONCE(fb->bits_per_pixel != 32); + + ret = rpi_firmware_property(vc4->firmware, + RPI_FIRMWARE_SET_CURSOR_STATE, @@ -134073,14 +131792,14 @@ index 0000000000000000000000000000000000000000..d18a1dae51a2275846c9826b5bf1ba57 +static int vc4_page_flip(struct drm_crtc *crtc, + struct drm_framebuffer *fb, + struct drm_pending_vblank_event *event, -+ uint32_t flags) ++ uint32_t flags, struct drm_modeset_acquire_ctx *ctx) +{ + if (flags & DRM_MODE_PAGE_FLIP_ASYNC) { + DRM_ERROR("Async flips aren't allowed\n"); + return -EINVAL; + } + -+ return drm_atomic_helper_page_flip(crtc, fb, event, flags); ++ return drm_atomic_helper_page_flip(crtc, fb, event, flags, ctx); +} + +static const struct drm_crtc_funcs vc4_crtc_funcs = { @@ -134304,7 +132023,6 @@ index 0000000000000000000000000000000000000000..d18a1dae51a2275846c9826b5bf1ba57 + drm_crtc_helper_add(crtc, &vc4_crtc_helper_funcs); + primary_plane->crtc = crtc; + cursor_plane->crtc = crtc; -+ vc4->crtc[drm_crtc_index(crtc)] = vc4_crtc; + + vc4_encoder = devm_kzalloc(dev, sizeof(*vc4_encoder), GFP_KERNEL); + if (!vc4_encoder) @@ -134384,10 +132102,10 @@ index 0000000000000000000000000000000000000000..d18a1dae51a2275846c9826b5bf1ba57 + }, +}; -From 0c24f3f931a9887fdc2cb87f1adb74a88ef22205 Mon Sep 17 00:00:00 2001 +From d25b18dc18acfd66d367bf29b5dec9fc17cc8e1a Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 1 Feb 2017 17:09:18 -0800 -Subject: [PATCH 147/201] drm/vc4: Name the primary and cursor planes in fkms. +Subject: [PATCH 121/134] drm/vc4: Name the primary and cursor planes in fkms. This makes debugging nicer, compared to trying to remember what the IDs are. @@ -134398,10 +132116,10 @@ Signed-off-by: Eric Anholt 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_firmware_kms.c b/drivers/gpu/drm/vc4/vc4_firmware_kms.c -index d18a1dae51a2275846c9826b5bf1ba57ae97b55c..e49ce68b607a7ffc2329e3235362f3bc21ed5cbb 100644 +index 1e09980c61a91246156c4ab661c03779baa1fc97..174a2f90c5bd78798ed47cca243b68a968e6e735 100644 --- a/drivers/gpu/drm/vc4/vc4_firmware_kms.c +++ b/drivers/gpu/drm/vc4/vc4_firmware_kms.c -@@ -267,7 +267,7 @@ static struct drm_plane *vc4_fkms_plane_init(struct drm_device *dev, +@@ -266,7 +266,7 @@ static struct drm_plane *vc4_fkms_plane_init(struct drm_device *dev, ret = drm_universal_plane_init(dev, plane, 0xff, &vc4_plane_funcs, primary ? &xrgb8888 : &argb8888, 1, @@ -134411,10 +132129,10 @@ index d18a1dae51a2275846c9826b5bf1ba57ae97b55c..e49ce68b607a7ffc2329e3235362f3bc if (type == DRM_PLANE_TYPE_PRIMARY) { vc4_plane->fbinfo = -From d64116905a24dfaef77d7c6f338e16b1b8275bbf Mon Sep 17 00:00:00 2001 +From bed4aacf7045c0c45e05f9fcf61d7d00008d5b1a Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 1 Feb 2017 17:10:09 -0800 -Subject: [PATCH 148/201] drm/vc4: Add DRM_DEBUG_ATOMIC for the insides of +Subject: [PATCH 122/134] drm/vc4: Add DRM_DEBUG_ATOMIC for the insides of fkms. Trying to debug weston on fkms involved figuring out what calls I was @@ -134426,7 +132144,7 @@ Signed-off-by: Eric Anholt 1 file changed, 26 insertions(+) diff --git a/drivers/gpu/drm/vc4/vc4_firmware_kms.c b/drivers/gpu/drm/vc4/vc4_firmware_kms.c -index e49ce68b607a7ffc2329e3235362f3bc21ed5cbb..dbf065677202fbebf8e3a0cffbe880aa42daef3f 100644 +index 174a2f90c5bd78798ed47cca243b68a968e6e735..611a3c6d622deb9b511fe70c363d201b091c414a 100644 --- a/drivers/gpu/drm/vc4/vc4_firmware_kms.c +++ b/drivers/gpu/drm/vc4/vc4_firmware_kms.c @@ -102,6 +102,11 @@ static int vc4_plane_set_primary_blank(struct drm_plane *plane, bool blank) @@ -134458,9 +132176,9 @@ index e49ce68b607a7ffc2329e3235362f3bc21ed5cbb..dbf065677202fbebf8e3a0cffbe880aa ret = rpi_firmware_transaction(vc4->firmware, RPI_FIRMWARE_CHAN_FB, vc4_plane->fbinfo_bus_addr); -@@ -178,6 +193,15 @@ static void vc4_cursor_plane_atomic_update(struct drm_plane *plane, +@@ -177,6 +192,15 @@ static void vc4_cursor_plane_atomic_update(struct drm_plane *plane, + 0, 0, /* hotx, hoty */}; WARN_ON_ONCE(fb->pitches[0] != state->crtc_w * 4); - WARN_ON_ONCE(fb->bits_per_pixel != 32); + DRM_DEBUG_ATOMIC("[PLANE:%d:%s] update %dx%d cursor at %d,%d (0x%08x/%d)", + plane->base.id, plane->name, @@ -134474,7 +132192,7 @@ index e49ce68b607a7ffc2329e3235362f3bc21ed5cbb..dbf065677202fbebf8e3a0cffbe880aa ret = rpi_firmware_property(vc4->firmware, RPI_FIRMWARE_SET_CURSOR_STATE, &packet_state, -@@ -200,6 +224,8 @@ static void vc4_cursor_plane_atomic_disable(struct drm_plane *plane, +@@ -199,6 +223,8 @@ static void vc4_cursor_plane_atomic_disable(struct drm_plane *plane, u32 packet_state[] = { false, 0, 0, 0 }; int ret; @@ -134484,10 +132202,10 @@ index e49ce68b607a7ffc2329e3235362f3bc21ed5cbb..dbf065677202fbebf8e3a0cffbe880aa RPI_FIRMWARE_SET_CURSOR_STATE, &packet_state, -From e0f3a7fc85b1ee8037bea2285832a84995368c74 Mon Sep 17 00:00:00 2001 +From ee8a77d112711673bc90e43f659c7099b4963977 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 2 Feb 2017 09:42:18 -0800 -Subject: [PATCH 149/201] drm/vc4: Fix sending of page flip completion events +Subject: [PATCH 123/134] 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 @@ -134503,10 +132221,10 @@ Signed-off-by: Eric Anholt 1 file changed, 15 insertions(+) diff --git a/drivers/gpu/drm/vc4/vc4_firmware_kms.c b/drivers/gpu/drm/vc4/vc4_firmware_kms.c -index dbf065677202fbebf8e3a0cffbe880aa42daef3f..da818a207bfa639b8cea48d94bcf4566f97db816 100644 +index 611a3c6d622deb9b511fe70c363d201b091c414a..eb97443533c5a8fb5e142541adb1165b55e32aea 100644 --- a/drivers/gpu/drm/vc4/vc4_firmware_kms.c +++ b/drivers/gpu/drm/vc4/vc4_firmware_kms.c -@@ -338,6 +338,21 @@ static int vc4_crtc_atomic_check(struct drm_crtc *crtc, +@@ -337,6 +337,21 @@ static int vc4_crtc_atomic_check(struct drm_crtc *crtc, static void vc4_crtc_atomic_flush(struct drm_crtc *crtc, struct drm_crtc_state *old_state) { @@ -134529,63 +132247,10 @@ index dbf065677202fbebf8e3a0cffbe880aa42daef3f..da818a207bfa639b8cea48d94bcf4566 static void vc4_crtc_handle_page_flip(struct vc4_crtc *vc4_crtc) -From 5c87e424ef4c258ef7b6117f835ef5f2e877bd24 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Wed, 10 May 2017 21:39:45 +0100 -Subject: [PATCH 150/201] squash: vc4_firmware_kms fixups - ---- - drivers/gpu/drm/vc4/vc4_crtc.c | 2 ++ - drivers/gpu/drm/vc4/vc4_firmware_kms.c | 4 ++-- - 2 files changed, 4 insertions(+), 2 deletions(-) - -diff --git a/drivers/gpu/drm/vc4/vc4_crtc.c b/drivers/gpu/drm/vc4/vc4_crtc.c -index 0ed39e6b9bae3d5dd3d578a3e4400f12e8a56a53..a0e2a33e8b8cd61a0c2e9ae030a323e208ad4169 100644 ---- a/drivers/gpu/drm/vc4/vc4_crtc.c -+++ b/drivers/gpu/drm/vc4/vc4_crtc.c -@@ -659,6 +659,7 @@ static void vc4_crtc_atomic_flush(struct drm_crtc *crtc, - - int vc4_enable_vblank(struct drm_device *dev, unsigned int crtc_id) - { -+ struct vc4_dev *vc4 = to_vc4_dev(dev); - struct drm_crtc *crtc = drm_crtc_from_index(dev, crtc_id); - struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); - -@@ -674,6 +675,7 @@ int vc4_enable_vblank(struct drm_device *dev, unsigned int crtc_id) - - void vc4_disable_vblank(struct drm_device *dev, unsigned int crtc_id) - { -+ struct vc4_dev *vc4 = to_vc4_dev(dev); - struct drm_crtc *crtc = drm_crtc_from_index(dev, crtc_id); - struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); - -diff --git a/drivers/gpu/drm/vc4/vc4_firmware_kms.c b/drivers/gpu/drm/vc4/vc4_firmware_kms.c -index da818a207bfa639b8cea48d94bcf4566f97db816..35425063cca47a33936c4853f7cc320c3630fdb2 100644 ---- a/drivers/gpu/drm/vc4/vc4_firmware_kms.c -+++ b/drivers/gpu/drm/vc4/vc4_firmware_kms.c -@@ -191,7 +191,7 @@ static void vc4_cursor_plane_atomic_update(struct drm_plane *plane, - bo->paddr + fb->offsets[0], - 0, 0, /* hotx, hoty */}; - WARN_ON_ONCE(fb->pitches[0] != state->crtc_w * 4); -- WARN_ON_ONCE(fb->bits_per_pixel != 32); -+ //WARN_ON_ONCE(fb->bits_per_pixel != 32); - - DRM_DEBUG_ATOMIC("[PLANE:%d:%s] update %dx%d cursor at %d,%d (0x%08x/%d)", - plane->base.id, plane->name, -@@ -620,7 +620,7 @@ static int vc4_fkms_bind(struct device *dev, struct device *master, void *data) - drm_crtc_helper_add(crtc, &vc4_crtc_helper_funcs); - primary_plane->crtc = crtc; - cursor_plane->crtc = crtc; -- vc4->crtc[drm_crtc_index(crtc)] = vc4_crtc; -+ //vc4->crtc[drm_crtc_index(crtc)] = vc4_crtc; - - vc4_encoder = devm_kzalloc(dev, sizeof(*vc4_encoder), GFP_KERNEL); - if (!vc4_encoder) - -From 13a668f002da7a03f0a832889dac21e2746164a8 Mon Sep 17 00:00:00 2001 +From e5fa50e219df7aabf415f172b65f6273da43b46b Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 18 Apr 2017 21:43:46 +0100 -Subject: [PATCH 151/201] vc4_fkms: Apply firmware overscan offset to hardware +Subject: [PATCH 124/134] vc4_fkms: Apply firmware overscan offset to hardware cursor --- @@ -134593,7 +132258,7 @@ Subject: [PATCH 151/201] vc4_fkms: Apply firmware overscan offset to hardware 1 file changed, 17 insertions(+) diff --git a/drivers/gpu/drm/vc4/vc4_firmware_kms.c b/drivers/gpu/drm/vc4/vc4_firmware_kms.c -index 35425063cca47a33936c4853f7cc320c3630fdb2..ca03b85f27d8c0966acd977cba9c758dab4ffb5f 100644 +index eb97443533c5a8fb5e142541adb1165b55e32aea..aa0ab7bcd904b775f64045c4d5baf39a4aacccc1 100644 --- a/drivers/gpu/drm/vc4/vc4_firmware_kms.c +++ b/drivers/gpu/drm/vc4/vc4_firmware_kms.c @@ -40,6 +40,7 @@ struct vc4_crtc { @@ -134612,7 +132277,7 @@ index 35425063cca47a33936c4853f7cc320c3630fdb2..ca03b85f27d8c0966acd977cba9c758d struct drm_plane_state *state = plane->state; struct drm_framebuffer *fb = state->fb; struct drm_gem_cma_object *bo = drm_fb_cma_get_gem_obj(fb, 0); -@@ -202,6 +204,12 @@ static void vc4_cursor_plane_atomic_update(struct drm_plane *plane, +@@ -201,6 +203,12 @@ static void vc4_cursor_plane_atomic_update(struct drm_plane *plane, bo->paddr + fb->offsets[0], fb->pitches[0]); @@ -134625,7 +132290,7 @@ index 35425063cca47a33936c4853f7cc320c3630fdb2..ca03b85f27d8c0966acd977cba9c758d ret = rpi_firmware_property(vc4->firmware, RPI_FIRMWARE_SET_CURSOR_STATE, &packet_state, -@@ -645,6 +653,15 @@ static int vc4_fkms_bind(struct device *dev, struct device *master, void *data) +@@ -643,6 +651,15 @@ static int vc4_fkms_bind(struct device *dev, struct device *master, void *data) if (ret) goto err_destroy_connector; @@ -134642,652 +132307,90 @@ index 35425063cca47a33936c4853f7cc320c3630fdb2..ca03b85f27d8c0966acd977cba9c758d return 0; -From b08e540a1e7494805e8a7ff2fb7ba98a7d464f90 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Thu, 11 May 2017 16:58:16 +0100 -Subject: [PATCH 152/201] BCM270X_DT: Tidy up mmc, sdhost, sdio overlays +From 79c9e731dedef00608ecbfab8f0d958afe926128 Mon Sep 17 00:00:00 2001 +From: Eric Anholt +Date: Mon, 15 May 2017 09:28:36 -0700 +Subject: [PATCH 125/134] drm/vc4: Mark the device as active when enabling + runtime PM. -The mmc, sdhost, sdio and sdio-1bit overlays had a few -anachronisms and oddities which were overdue for fixing. -The new versions should be functionally equivalent. +Failing to do so meant that we got a resume() callback on first use of +the device, so we would leak the bin BO that we allocated during +probe. + +Signed-off-by: Eric Anholt +Fixes: 553c942f8b2c ("drm/vc4: Allow using more than 256MB of CMA memory.") +--- + drivers/gpu/drm/vc4/vc4_v3d.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/gpu/drm/vc4/vc4_v3d.c b/drivers/gpu/drm/vc4/vc4_v3d.c +index 7cc346ad9b0baed63701d1fae8f0306aa7713129..c82326ff994d03719a66d42f8f9ac0e2e6570aa8 100644 +--- a/drivers/gpu/drm/vc4/vc4_v3d.c ++++ b/drivers/gpu/drm/vc4/vc4_v3d.c +@@ -222,6 +222,7 @@ static int vc4_v3d_bind(struct device *dev, struct device *master, void *data) + return ret; + } + ++ pm_runtime_set_active(dev); + pm_runtime_use_autosuspend(dev); + pm_runtime_set_autosuspend_delay(dev, 40); /* a little over 2 frames. */ + pm_runtime_enable(dev); + +From 81b4c921a67ed9362a990a9ee9e49c48903789df Mon Sep 17 00:00:00 2001 +From: Phil Elwell +Date: Tue, 16 May 2017 14:39:49 +0100 +Subject: [PATCH 126/134] mmc: Change downstream MMC driver CONFIG option + +The upstream SDHOST driver has now claimed CONFIG_MMC_BCM2835, which +clashes with the downstream MMC driver. Rename the downstream option to +CONFIG_MMC_BCM2835_MMC. Signed-off-by: Phil Elwell --- - arch/arm/boot/dts/overlays/mmc-overlay.dts | 1 + - arch/arm/boot/dts/overlays/sdhost-overlay.dts | 1 - - arch/arm/boot/dts/overlays/sdio-1bit-overlay.dts | 11 ++++++----- - arch/arm/boot/dts/overlays/sdio-overlay.dts | 11 ++++++----- - 4 files changed, 13 insertions(+), 11 deletions(-) + drivers/mmc/host/Kconfig | 4 ++-- + drivers/mmc/host/Makefile | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) -diff --git a/arch/arm/boot/dts/overlays/mmc-overlay.dts b/arch/arm/boot/dts/overlays/mmc-overlay.dts -index d32b02ca01ced5ab3de00d66d5412c8fda4bc510..88251ad653917674f80c2975de2e425fca00b71f 100644 ---- a/arch/arm/boot/dts/overlays/mmc-overlay.dts -+++ b/arch/arm/boot/dts/overlays/mmc-overlay.dts -@@ -21,6 +21,7 @@ - mmc_pins: mmc_pins { - brcm,pins = <48 49 50 51 52 53>; - brcm,function = <7>; /* alt3 */ -+ brcm,pull = <0 2 2 2 2 2>; - }; - }; - }; -diff --git a/arch/arm/boot/dts/overlays/sdhost-overlay.dts b/arch/arm/boot/dts/overlays/sdhost-overlay.dts -index a431177a1c9d320d5432ea448ad4d0f696c34525..de3d1b0a5e403057a8e94f85695de4076d77e31f 100644 ---- a/arch/arm/boot/dts/overlays/sdhost-overlay.dts -+++ b/arch/arm/boot/dts/overlays/sdhost-overlay.dts -@@ -11,7 +11,6 @@ - frag0: __overlay__ { - brcm,overclock-50 = <0>; - brcm,pio-limit = <1>; -- brcm,debug-flags = <0>; - status = "okay"; - }; - }; -diff --git a/arch/arm/boot/dts/overlays/sdio-1bit-overlay.dts b/arch/arm/boot/dts/overlays/sdio-1bit-overlay.dts -index 46d453859b31f5c700a8a2e39a2c209330bc108f..0b7f2c6f2603b631e1985df7fbf66749149566d6 100644 ---- a/arch/arm/boot/dts/overlays/sdio-1bit-overlay.dts -+++ b/arch/arm/boot/dts/overlays/sdio-1bit-overlay.dts -@@ -1,11 +1,12 @@ --/* Enable 1-bit SDIO from MMC interface via GPIOs 22-25. Includes sdhost overlay. */ -+/dts-v1/; -+/plugin/; +diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig +index 6300af1eff1a52608455682fdc412c96e8438ad4..e577d20963bcb1f61756d5d7050328b967b522d4 100644 +--- a/drivers/mmc/host/Kconfig ++++ b/drivers/mmc/host/Kconfig +@@ -4,7 +4,7 @@ --/include/ "sdhost-overlay.dts" -+/* Enable 1-bit SDIO from MMC interface via GPIOs 22-25. Includes sdhost overlay. */ + comment "MMC/SD/SDIO Host Controller Drivers" - /{ - compatible = "brcm,bcm2708"; +-config MMC_BCM2835 ++config MMC_BCM2835_MMC + tristate "MMC support on BCM2835" + depends on MACH_BCM2708 || MACH_BCM2709 || ARCH_BCM2835 + help +@@ -16,7 +16,7 @@ config MMC_BCM2835 -- fragment@3 { -+ fragment@0 { - target = <&mmc>; - sdio_mmc: __overlay__ { - compatible = "brcm,bcm2835-mmc"; -@@ -18,12 +19,12 @@ - }; - }; - -- fragment@4 { -+ fragment@1 { - target = <&gpio>; - __overlay__ { - sdio_pins: sdio_pins { - brcm,pins = <22 23 24 25>; -- brcm,function = <7 7 7 7>; /* ALT3 = SD1 */ -+ brcm,function = <7>; /* ALT3 = SD1 */ - brcm,pull = <0 2 2 2>; - }; - }; -diff --git a/arch/arm/boot/dts/overlays/sdio-overlay.dts b/arch/arm/boot/dts/overlays/sdio-overlay.dts -index 398bd812c716c9e472fbac5aba4fe882114c65d1..215d5e3e8a8ca4363457fed1f7425427bb5086d7 100644 ---- a/arch/arm/boot/dts/overlays/sdio-overlay.dts -+++ b/arch/arm/boot/dts/overlays/sdio-overlay.dts -@@ -1,11 +1,12 @@ --/* Enable SDIO from MMC interface via GPIOs 22-27. Includes sdhost overlay. */ -+/dts-v1/; -+/plugin/; - --/include/ "sdhost-overlay.dts" -+/* Enable SDIO from MMC interface via GPIOs 22-27. Includes sdhost overlay. */ - - /{ - compatible = "brcm,bcm2708"; - -- fragment@3 { -+ fragment@0 { - target = <&mmc>; - sdio_mmc: __overlay__ { - pinctrl-names = "default"; -@@ -17,12 +18,12 @@ - }; - }; - -- fragment@4 { -+ fragment@1 { - target = <&gpio>; - __overlay__ { - sdio_pins: sdio_pins { - brcm,pins = <22 23 24 25 26 27>; -- brcm,function = <7 7 7 7 7 7>; /* ALT3 = SD1 */ -+ brcm,function = <7>; /* ALT3 = SD1 */ - brcm,pull = <0 2 2 2 2 2>; - }; - }; + config MMC_BCM2835_DMA + bool "DMA support on BCM2835 Arasan controller" +- depends on MMC_BCM2835 ++ depends on MMC_BCM2835_MMC + help + Enable DMA support on the Arasan SDHCI controller in Broadcom 2708 + based chips. +diff --git a/drivers/mmc/host/Makefile b/drivers/mmc/host/Makefile +index f4b8951af214fd0b0392d4fb38b29a0b41c7340e..d352fabf6b61c803fef3e10f974214bf5e48d270 100644 +--- a/drivers/mmc/host/Makefile ++++ b/drivers/mmc/host/Makefile +@@ -18,7 +18,7 @@ obj-$(CONFIG_MMC_SDHCI_S3C) += sdhci-s3c.o + obj-$(CONFIG_MMC_SDHCI_SIRF) += sdhci-sirf.o + obj-$(CONFIG_MMC_SDHCI_F_SDH30) += sdhci_f_sdh30.o + obj-$(CONFIG_MMC_SDHCI_SPEAR) += sdhci-spear.o +-obj-$(CONFIG_MMC_BCM2835) += bcm2835-mmc.o ++obj-$(CONFIG_MMC_BCM2835_MMC) += bcm2835-mmc.o + obj-$(CONFIG_MMC_BCM2835_SDHOST) += bcm2835-sdhost.o + obj-$(CONFIG_MMC_WBSD) += wbsd.o + obj-$(CONFIG_MMC_AU1X) += au1xmmc.o -From 5d96d56bfd181f30a4e0f02efc8e6748aebd1095 Mon Sep 17 00:00:00 2001 -From: P33M -Date: Fri, 12 May 2017 12:24:00 +0100 -Subject: [PATCH 153/201] dwc_otg: fix several potential crash sources - -On root port disconnect events, the host driver state is cleared and -in-progress host channels are forcibly stopped. This doesn't play -well with the FIQ running in the background, so: -- Guard the disconnect callback with both the host spinlock and FIQ - spinlock -- Move qtd dereference in dwc_otg_handle_hc_fsm() after the early-out - so we don't dereference a qtd that has gone away -- Turn catch-all BUG()s in dwc_otg_handle_hc_fsm() into warnings. ---- - drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c | 2 ++ - drivers/usb/host/dwc_otg/dwc_otg_hcd.c | 27 +++++++++++++++++++---- - drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c | 33 +++++++++++++++++++---------- - 3 files changed, 47 insertions(+), 15 deletions(-) - -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c b/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c -index 96c76e38cd372b8ca8c375ae8d8653f32a3faf80..9fb7229f43ae4561c9dc1980065381a48711ae41 100644 ---- a/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c -+++ b/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c -@@ -973,7 +973,9 @@ int32_t dwc_otg_handle_disconnect_intr(dwc_otg_core_if_t * core_if) - } else { - if (core_if->op_state == A_HOST) { - /* A-Cable still connected but device disconnected. */ -+ DWC_SPINUNLOCK(core_if->lock); - cil_hcd_disconnect(core_if); -+ DWC_SPINLOCK(core_if->lock); - if (core_if->adp_enable) { - gpwrdn_data_t gpwrdn = { .d32 = 0 }; - cil_hcd_stop(core_if); -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c -index 37c9d7d38287b616fcd335e80aa4110521fa98ca..9a647b75027378e25eef00b5fc2a9166514b5c59 100644 ---- a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c -+++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c -@@ -290,13 +290,16 @@ static int32_t dwc_otg_hcd_disconnect_cb(void *p) - gintsts_data_t intr; - dwc_otg_hcd_t *dwc_otg_hcd = p; - -+ DWC_SPINLOCK(dwc_otg_hcd->lock); - /* - * Set status flags for the hub driver. - */ - dwc_otg_hcd->flags.b.port_connect_status_change = 1; - dwc_otg_hcd->flags.b.port_connect_status = 0; -- if(fiq_enable) -+ if(fiq_enable) { - local_fiq_disable(); -+ fiq_fsm_spin_lock(&dwc_otg_hcd->fiq_state->lock); -+ } - /* - * Shutdown any transfers in process by clearing the Tx FIFO Empty - * interrupt mask and status bits and disabling subsequent host -@@ -389,7 +392,8 @@ static int32_t dwc_otg_hcd_disconnect_cb(void *p) - * in release_channel_ddma(). Which called from ep_disable - * when device disconnect. - */ -- channel->qh = NULL; -+ if (dwc_otg_hcd->core_if->dma_desc_enable) -+ channel->qh = NULL; - } - } - if(fiq_fsm_enable) { -@@ -400,13 +404,16 @@ static int32_t dwc_otg_hcd_disconnect_cb(void *p) - - } - -- if(fiq_enable) -+ if(fiq_enable) { -+ fiq_fsm_spin_unlock(&dwc_otg_hcd->fiq_state->lock); - local_fiq_enable(); -+ } - - if (dwc_otg_hcd->fops->disconnect) { - dwc_otg_hcd->fops->disconnect(dwc_otg_hcd); - } - -+ DWC_SPINUNLOCK(dwc_otg_hcd->lock); - return 1; - } - -@@ -1750,8 +1757,20 @@ int fiq_fsm_queue_split_transaction(dwc_otg_hcd_t *hcd, dwc_otg_qh_t *qh) - int hub_addr, port_addr, frame, uframe; - struct fiq_channel_state *st = &hcd->fiq_state->channel[hc->hc_num]; - -- if (st->fsm != FIQ_PASSTHROUGH) -+ /* -+ * Non-periodic channel assignments stay in the non_periodic_active queue. -+ * Therefore we get repeatedly called until the FIQ's done processing this channel. -+ */ -+ if (qh->channel->xfer_started == 1) - return 0; -+ -+ if (st->fsm != FIQ_PASSTHROUGH) { -+ pr_warn_ratelimited("%s:%d: Queue called for an active channel\n", __func__, __LINE__); -+ return 0; -+ } -+ -+ qh->channel->xfer_started = 1; -+ - st->nr_errors = 0; - - st->hcchar_copy.d32 = 0; -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 718a1accc0c219a1764ce53d291de6a2b6f93608..cf23baaa388562b5843be4cfa6c206cbdc4e780d 100644 ---- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c -+++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c -@@ -2374,8 +2374,7 @@ void dwc_otg_hcd_handle_hc_fsm(dwc_otg_hcd_t *hcd, uint32_t num) - { - struct fiq_channel_state *st = &hcd->fiq_state->channel[num]; - dwc_hc_t *hc = hcd->hc_ptr_array[num]; -- dwc_otg_qtd_t *qtd = DWC_CIRCLEQ_FIRST(&hc->qh->qtd_list); -- dwc_otg_qh_t *qh = hc->qh; -+ dwc_otg_qtd_t *qtd; - dwc_otg_hc_regs_t *hc_regs = hcd->core_if->host_if->hc_regs[num]; - hcint_data_t hcint = hcd->fiq_state->channel[num].hcint_copy; - hctsiz_data_t hctsiz = hcd->fiq_state->channel[num].hctsiz_copy; -@@ -2385,16 +2384,19 @@ void dwc_otg_hcd_handle_hc_fsm(dwc_otg_hcd_t *hcd, uint32_t num) - hostchannels = hcd->available_host_channels; - if (hc->halt_pending) { - /* Dequeue: The FIQ was allowed to complete the transfer but state has been cleared. */ -- if (st->fsm == FIQ_NP_SPLIT_DONE && hcint.b.xfercomp && qh->ep_type == UE_BULK) { -+ if (hc->qh && st->fsm == FIQ_NP_SPLIT_DONE && -+ hcint.b.xfercomp && hc->qh->ep_type == UE_BULK) { - if (hctsiz.b.pid == DWC_HCTSIZ_DATA0) { -- qh->data_toggle = DWC_OTG_HC_PID_DATA1; -+ hc->qh->data_toggle = DWC_OTG_HC_PID_DATA1; - } else { -- qh->data_toggle = DWC_OTG_HC_PID_DATA0; -+ hc->qh->data_toggle = DWC_OTG_HC_PID_DATA0; - } - } - release_channel(hcd, hc, NULL, hc->halt_status); - return; - } -+ -+ qtd = DWC_CIRCLEQ_FIRST(&hc->qh->qtd_list); - switch (st->fsm) { - case FIQ_TEST: - break; -@@ -2413,6 +2415,11 @@ void dwc_otg_hcd_handle_hc_fsm(dwc_otg_hcd_t *hcd, uint32_t num) - handle_hc_xfercomp_intr(hcd, hc, hc_regs, qtd); - } else if (hcint.b.nak) { - handle_hc_nak_intr(hcd, hc, hc_regs, qtd); -+ } else { -+ DWC_WARN("Unexpected IRQ state on FSM transaction:" -+ "dev_addr=%d ep=%d fsm=%d, hcint=0x%08x\n", -+ hc->dev_addr, hc->ep_num, st->fsm, hcint.d32); -+ release_channel(hcd, hc, qtd, DWC_OTG_HC_XFER_NO_HALT_STATUS); - } - break; - -@@ -2428,8 +2435,10 @@ void dwc_otg_hcd_handle_hc_fsm(dwc_otg_hcd_t *hcd, uint32_t num) - } else if (hcint.b.ahberr) { - handle_hc_ahberr_intr(hcd, hc, hc_regs, qtd); - } else { -- local_fiq_disable(); -- BUG(); -+ DWC_WARN("Unexpected IRQ state on FSM transaction:" -+ "dev_addr=%d ep=%d fsm=%d, hcint=0x%08x\n", -+ hc->dev_addr, hc->ep_num, st->fsm, hcint.d32); -+ release_channel(hcd, hc, qtd, DWC_OTG_HC_XFER_NO_HALT_STATUS); - } - break; - -@@ -2445,8 +2454,10 @@ void dwc_otg_hcd_handle_hc_fsm(dwc_otg_hcd_t *hcd, uint32_t num) - } else if (hcint.b.ahberr) { - handle_hc_ahberr_intr(hcd, hc, hc_regs, qtd); - } else { -- local_fiq_disable(); -- BUG(); -+ DWC_WARN("Unexpected IRQ state on FSM transaction:" -+ "dev_addr=%d ep=%d fsm=%d, hcint=0x%08x\n", -+ hc->dev_addr, hc->ep_num, st->fsm, hcint.d32); -+ release_channel(hcd, hc, qtd, DWC_OTG_HC_XFER_NO_HALT_STATUS); - } - break; - -@@ -2504,7 +2515,7 @@ void dwc_otg_hcd_handle_hc_fsm(dwc_otg_hcd_t *hcd, uint32_t num) - } else { - frame_desc->status = 0; - /* Unswizzle dma */ -- len = dwc_otg_fiq_unsetup_per_dma(hcd, qh, qtd, num); -+ len = dwc_otg_fiq_unsetup_per_dma(hcd, hc->qh, qtd, num); - frame_desc->actual_length = len; - } - qtd->isoc_frame_index++; -@@ -2566,7 +2577,7 @@ void dwc_otg_hcd_handle_hc_fsm(dwc_otg_hcd_t *hcd, uint32_t num) - * The status is recorded as the interrupt state should the transaction - * fail. - */ -- dwc_otg_fiq_unmangle_isoc(hcd, qh, qtd, num); -+ dwc_otg_fiq_unmangle_isoc(hcd, hc->qh, qtd, num); - hcd->fops->complete(hcd, qtd->urb->priv, qtd->urb, 0); - release_channel(hcd, hc, qtd, DWC_OTG_HC_XFER_URB_COMPLETE); - break; - -From eb789b2b0ae17a062b05e501caf893a1d6308104 Mon Sep 17 00:00:00 2001 -From: P33M -Date: Mon, 15 May 2017 14:27:48 +0100 -Subject: [PATCH 154/201] dwc_otg: delete hcd->channel_lock - -The lock serves no purpose as it is only held while the HCD spinlock -is already being held. ---- - drivers/usb/host/dwc_otg/dwc_otg_hcd.c | 15 --------------- - drivers/usb/host/dwc_otg/dwc_otg_hcd.h | 1 - - drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c | 5 ----- - drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c | 4 ---- - 4 files changed, 25 deletions(-) - -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c -index 9a647b75027378e25eef00b5fc2a9166514b5c59..5ec991624c7865901b22ea01b9f2c58c8535ecfd 100644 ---- a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c -+++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c -@@ -938,7 +938,6 @@ static void dwc_otg_hcd_free(dwc_otg_hcd_t * dwc_otg_hcd) - } else if (dwc_otg_hcd->status_buf != NULL) { - DWC_FREE(dwc_otg_hcd->status_buf); - } -- DWC_SPINLOCK_FREE(dwc_otg_hcd->channel_lock); - DWC_SPINLOCK_FREE(dwc_otg_hcd->lock); - /* Set core_if's lock pointer to NULL */ - dwc_otg_hcd->core_if->lock = NULL; -@@ -969,10 +968,8 @@ int dwc_otg_hcd_init(dwc_otg_hcd_t * hcd, dwc_otg_core_if_t * core_if) - - #if (defined(DWC_LINUX) && defined(CONFIG_DEBUG_SPINLOCK)) - DWC_SPINLOCK_ALLOC_LINUX_DEBUG(hcd->lock); -- DWC_SPINLOCK_ALLOC_LINUX_DEBUG(hcd->channel_lock); - #else - hcd->lock = DWC_SPINLOCK_ALLOC(); -- hcd->channel_lock = DWC_SPINLOCK_ALLOC(); - #endif - DWC_DEBUGPL(DBG_HCDV, "init of HCD %p given core_if %p\n", - hcd, core_if); -@@ -1997,7 +1994,6 @@ dwc_otg_transaction_type_e dwc_otg_hcd_select_transactions(dwc_otg_hcd_t * hcd) - dwc_otg_qh_t *qh; - int num_channels; - dwc_irqflags_t flags; -- dwc_spinlock_t *channel_lock = hcd->channel_lock; - dwc_otg_transaction_type_e ret_val = DWC_OTG_TRANSACTION_NONE; - - #ifdef DEBUG_HOST_CHANNELS -@@ -2016,13 +2012,10 @@ dwc_otg_transaction_type_e dwc_otg_hcd_select_transactions(dwc_otg_hcd_t * hcd) - - if (microframe_schedule) { - // Make sure we leave one channel for non periodic transactions. -- DWC_SPINLOCK_IRQSAVE(channel_lock, &flags); - if (hcd->available_host_channels <= 1) { -- DWC_SPINUNLOCK_IRQRESTORE(channel_lock, flags); - break; - } - hcd->available_host_channels--; -- DWC_SPINUNLOCK_IRQRESTORE(channel_lock, flags); - #ifdef DEBUG_HOST_CHANNELS - last_sel_trans_num_per_scheduled++; - #endif /* DEBUG_HOST_CHANNELS */ -@@ -2035,10 +2028,8 @@ dwc_otg_transaction_type_e dwc_otg_hcd_select_transactions(dwc_otg_hcd_t * hcd) - * periodic assigned schedule. - */ - qh_ptr = DWC_LIST_NEXT(qh_ptr); -- DWC_SPINLOCK_IRQSAVE(channel_lock, &flags); - DWC_LIST_MOVE_HEAD(&hcd->periodic_sched_assigned, - &qh->qh_list_entry); -- DWC_SPINUNLOCK_IRQRESTORE(channel_lock, flags); - } - - /* -@@ -2076,13 +2067,10 @@ dwc_otg_transaction_type_e dwc_otg_hcd_select_transactions(dwc_otg_hcd_t * hcd) - } - - if (microframe_schedule) { -- DWC_SPINLOCK_IRQSAVE(channel_lock, &flags); - if (hcd->available_host_channels < 1) { -- DWC_SPINUNLOCK_IRQRESTORE(channel_lock, flags); - break; - } - hcd->available_host_channels--; -- DWC_SPINUNLOCK_IRQRESTORE(channel_lock, flags); - #ifdef DEBUG_HOST_CHANNELS - last_sel_trans_num_nonper_scheduled++; - #endif /* DEBUG_HOST_CHANNELS */ -@@ -2095,11 +2083,8 @@ dwc_otg_transaction_type_e dwc_otg_hcd_select_transactions(dwc_otg_hcd_t * hcd) - * non-periodic active schedule. - */ - qh_ptr = DWC_LIST_NEXT(qh_ptr); -- DWC_SPINLOCK_IRQSAVE(channel_lock, &flags); - DWC_LIST_MOVE_HEAD(&hcd->non_periodic_sched_active, - &qh->qh_list_entry); -- DWC_SPINUNLOCK_IRQRESTORE(channel_lock, flags); -- - - if (!microframe_schedule) - hcd->non_periodic_channels++; -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd.h b/drivers/usb/host/dwc_otg/dwc_otg_hcd.h -index 4539cd7b802d3e49ac9a6cb3f1d88b475a1ace16..7f7e9eaffd6a3c3d898855562fbec11289f77f53 100644 ---- a/drivers/usb/host/dwc_otg/dwc_otg_hcd.h -+++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd.h -@@ -568,7 +568,6 @@ struct dwc_otg_hcd { - - /* */ - dwc_spinlock_t *lock; -- dwc_spinlock_t *channel_lock; - /** - * Private data that could be used by OS wrapper. - */ -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c -index 126e99ab2fc43f11d89a08ff0476181ead84029f..bd8a20403713442f6748137d6b5de67e94c3893f 100644 ---- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c -+++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_ddma.c -@@ -279,17 +279,12 @@ void dump_frame_list(dwc_otg_hcd_t * hcd) - - static void release_channel_ddma(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh) - { -- dwc_irqflags_t flags; -- dwc_spinlock_t *channel_lock = hcd->channel_lock; -- - dwc_hc_t *hc = qh->channel; - if (dwc_qh_is_non_per(qh)) { -- DWC_SPINLOCK_IRQSAVE(channel_lock, &flags); - if (!microframe_schedule) - hcd->non_periodic_channels--; - else - hcd->available_host_channels++; -- DWC_SPINUNLOCK_IRQRESTORE(channel_lock, flags); - } else - update_frame_list(hcd, qh, 0); - -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 cf23baaa388562b5843be4cfa6c206cbdc4e780d..a4355afc77b68718fdaba6c5d4be257dadc75036 100644 ---- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c -+++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c -@@ -945,7 +945,6 @@ static void release_channel(dwc_otg_hcd_t * hcd, - dwc_otg_transaction_type_e tr_type; - int free_qtd; - dwc_irqflags_t flags; -- dwc_spinlock_t *channel_lock = hcd->channel_lock; - - int hog_port = 0; - -@@ -1034,11 +1033,8 @@ static void release_channel(dwc_otg_hcd_t * hcd, - break; - } - } else { -- -- DWC_SPINLOCK_IRQSAVE(channel_lock, &flags); - hcd->available_host_channels++; - fiq_print(FIQDBG_INT, hcd->fiq_state, "AHC = %d ", hcd->available_host_channels); -- DWC_SPINUNLOCK_IRQRESTORE(channel_lock, flags); - } - - /* Try to queue more transfers now that there's a free channel. */ - -From 991025a123887325e36da252494a15c7817034d8 Mon Sep 17 00:00:00 2001 -From: P33M -Date: Mon, 15 May 2017 14:51:42 +0100 -Subject: [PATCH 155/201] dwc_otg: remove unnecessary dma-mode channel halts on - disconnect interrupt - -Host channels are already halted in kill_urbs_in_qh_list() with the -subsequent interrupt processing behaving as if the URB was dequeued -via HCD callback. - -There's no need to clobber the host channel registers a second time -as this exposes races between the driver and host channel resulting -in hcd->free_hc_list becoming corrupted. ---- - drivers/usb/host/dwc_otg/dwc_otg_hcd.c | 30 ------------------------------ - 1 file changed, 30 deletions(-) - -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c -index 5ec991624c7865901b22ea01b9f2c58c8535ecfd..a2dc6337836b2719f4c954edeeb2a71301931b04 100644 ---- a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c -+++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c -@@ -200,8 +200,6 @@ static void kill_urbs_in_qh_list(dwc_otg_hcd_t * hcd, dwc_list_link_t * qh_list) - dwc_otg_hc_halt(hcd->core_if, qh->channel, - DWC_OTG_HC_XFER_URB_DEQUEUE); - } -- if(microframe_schedule) -- hcd->available_host_channels++; - qh->channel = NULL; - } - dwc_otg_hcd_qh_remove(hcd, qh); -@@ -369,39 +367,11 @@ static int32_t dwc_otg_hcd_disconnect_cb(void *p) - } - } - -- for (i = 0; i < num_channels; i++) { -- channel = dwc_otg_hcd->hc_ptr_array[i]; -- if (DWC_CIRCLEQ_EMPTY_ENTRY(channel, hc_list_entry)) { -- hc_regs = -- dwc_otg_hcd->core_if->host_if->hc_regs[i]; -- hcchar.d32 = DWC_READ_REG32(&hc_regs->hcchar); -- if (hcchar.b.chen) { -- /* Halt the channel. */ -- hcchar.b.chdis = 1; -- DWC_WRITE_REG32(&hc_regs->hcchar, -- hcchar.d32); -- } -- -- dwc_otg_hc_cleanup(dwc_otg_hcd->core_if, -- channel); -- DWC_CIRCLEQ_INSERT_TAIL -- (&dwc_otg_hcd->free_hc_list, channel, -- hc_list_entry); -- /* -- * Added for Descriptor DMA to prevent channel double cleanup -- * in release_channel_ddma(). Which called from ep_disable -- * when device disconnect. -- */ -- if (dwc_otg_hcd->core_if->dma_desc_enable) -- channel->qh = NULL; -- } -- } - if(fiq_fsm_enable) { - for(i=0; i < 128; i++) { - dwc_otg_hcd->hub_port[i] = 0; - } - } -- - } - - if(fiq_enable) { - -From 27d820f1ebd7ede586490d47d4cefd4a1eb5ffa7 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Mon, 15 May 2017 16:40:05 +0100 -Subject: [PATCH 156/201] config: Add CONFIG_TOUCHSCREEN_GOODIX - ---- - 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 94227b4a4f8a9b3a4627dceaf7c654da4f2f87df..268ac2b47d3fac00e3e53c19c44d5a30b16b3101 100644 ---- a/arch/arm/configs/bcm2709_defconfig -+++ b/arch/arm/configs/bcm2709_defconfig -@@ -565,6 +565,7 @@ CONFIG_JOYSTICK_RPISENSE=m - CONFIG_INPUT_TOUCHSCREEN=y - CONFIG_TOUCHSCREEN_ADS7846=m - CONFIG_TOUCHSCREEN_EGALAX=m -+CONFIG_TOUCHSCREEN_GOODIX=m - CONFIG_TOUCHSCREEN_RPI_FT5406=m - CONFIG_TOUCHSCREEN_USB_COMPOSITE=m - CONFIG_TOUCHSCREEN_STMPE=m -diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index db6589288b6abd6b76b934de07e8976456e14e61..88072e3b55eb230be44f6d23012428eda3de3453 100644 ---- a/arch/arm/configs/bcmrpi_defconfig -+++ b/arch/arm/configs/bcmrpi_defconfig -@@ -561,6 +561,7 @@ CONFIG_JOYSTICK_RPISENSE=m - CONFIG_INPUT_TOUCHSCREEN=y - CONFIG_TOUCHSCREEN_ADS7846=m - CONFIG_TOUCHSCREEN_EGALAX=m -+CONFIG_TOUCHSCREEN_GOODIX=m - CONFIG_TOUCHSCREEN_RPI_FT5406=m - CONFIG_TOUCHSCREEN_USB_COMPOSITE=m - CONFIG_TOUCHSCREEN_STMPE=m - -From 059f3edd429d8aac4c6195e355f967d6bea0fe47 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Thu, 18 May 2017 11:40:43 +0100 -Subject: [PATCH 157/201] config: Add FB_TFT_ST7789V module - ---- - arch/arm/configs/bcm2709_defconfig | 1 + - arch/arm/configs/bcmrpi_defconfig | 1 + - 2 files changed, 2 insertions(+) - -diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig -index 268ac2b47d3fac00e3e53c19c44d5a30b16b3101..4b1321172dc050ee4a172f8d410b35472f2ae29e 100644 ---- a/arch/arm/configs/bcm2709_defconfig -+++ b/arch/arm/configs/bcm2709_defconfig -@@ -1143,6 +1143,7 @@ CONFIG_FB_TFT_SSD1306=m - CONFIG_FB_TFT_SSD1331=m - CONFIG_FB_TFT_SSD1351=m - CONFIG_FB_TFT_ST7735R=m -+CONFIG_FB_TFT_ST7789V=m - CONFIG_FB_TFT_TINYLCD=m - CONFIG_FB_TFT_TLS8204=m - CONFIG_FB_TFT_UC1701=m -diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index 88072e3b55eb230be44f6d23012428eda3de3453..65e3676b48ab0c0f54375ecf875fc2552c457e09 100644 ---- a/arch/arm/configs/bcmrpi_defconfig -+++ b/arch/arm/configs/bcmrpi_defconfig -@@ -1150,6 +1150,7 @@ CONFIG_FB_TFT_SSD1306=m - CONFIG_FB_TFT_SSD1331=m - CONFIG_FB_TFT_SSD1351=m - CONFIG_FB_TFT_ST7735R=m -+CONFIG_FB_TFT_ST7789V=m - CONFIG_FB_TFT_TINYLCD=m - CONFIG_FB_TFT_TLS8204=m - CONFIG_FB_TFT_UC1701=m - -From 19484b5e5532c985f15947df750bdcb09ced3f1d Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Tue, 16 May 2017 15:58:00 +0100 -Subject: [PATCH 158/201] config: Add CONFIG_TOUCHSCREEN_EDT_FT5X06 - ---- - 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 4b1321172dc050ee4a172f8d410b35472f2ae29e..589ca1cb499e288fc36a00db251970110a7be053 100644 ---- a/arch/arm/configs/bcm2709_defconfig -+++ b/arch/arm/configs/bcm2709_defconfig -@@ -566,6 +566,7 @@ CONFIG_INPUT_TOUCHSCREEN=y - CONFIG_TOUCHSCREEN_ADS7846=m - CONFIG_TOUCHSCREEN_EGALAX=m - CONFIG_TOUCHSCREEN_GOODIX=m -+CONFIG_TOUCHSCREEN_EDT_FT5X06=m - CONFIG_TOUCHSCREEN_RPI_FT5406=m - CONFIG_TOUCHSCREEN_USB_COMPOSITE=m - CONFIG_TOUCHSCREEN_STMPE=m -diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index 65e3676b48ab0c0f54375ecf875fc2552c457e09..7381eeba83ecd4a2c956ab2093ece4f8a57c6ea4 100644 ---- a/arch/arm/configs/bcmrpi_defconfig -+++ b/arch/arm/configs/bcmrpi_defconfig -@@ -562,6 +562,7 @@ CONFIG_INPUT_TOUCHSCREEN=y - CONFIG_TOUCHSCREEN_ADS7846=m - CONFIG_TOUCHSCREEN_EGALAX=m - CONFIG_TOUCHSCREEN_GOODIX=m -+CONFIG_TOUCHSCREEN_EDT_FT5X06=m - CONFIG_TOUCHSCREEN_RPI_FT5406=m - CONFIG_TOUCHSCREEN_USB_COMPOSITE=m - CONFIG_TOUCHSCREEN_STMPE=m - -From b1012be3cff4a646439b2aa0211835c505af12e0 Mon Sep 17 00:00:00 2001 +From 9ac1b87065ff7ab130a3c14866ec91687ffd3d79 Mon Sep 17 00:00:00 2001 From: popcornmix Date: Tue, 16 May 2017 19:34:52 +0100 -Subject: [PATCH 159/201] config: Add CONFIG_I2C_ROBOTFUZZ_OSIF +Subject: [PATCH 127/134] config: Add CONFIG_I2C_ROBOTFUZZ_OSIF --- arch/arm/configs/bcm2709_defconfig | 1 + @@ -135295,10 +132398,10 @@ Subject: [PATCH 159/201] config: Add CONFIG_I2C_ROBOTFUZZ_OSIF 2 files changed, 2 insertions(+) diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig -index 589ca1cb499e288fc36a00db251970110a7be053..12157f209bc0a503c1bc3f04224784451c03f964 100644 +index 90713b5b0d1ccd80abf420e8ba1bd24a7ad5c5a6..ef4f52539bc903ce1e3543d3104adac7dbf36a8a 100644 --- a/arch/arm/configs/bcm2709_defconfig +++ b/arch/arm/configs/bcm2709_defconfig -@@ -614,6 +614,7 @@ CONFIG_I2C_MUX_PCA954x=m +@@ -613,6 +613,7 @@ CONFIG_I2C_MUX_PCA954x=m CONFIG_I2C_BCM2708=m CONFIG_I2C_BCM2835=m CONFIG_I2C_GPIO=m @@ -135307,7 +132410,7 @@ index 589ca1cb499e288fc36a00db251970110a7be053..12157f209bc0a503c1bc3f0422478445 CONFIG_SPI_BCM2835=m CONFIG_SPI_BCM2835AUX=m diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index 7381eeba83ecd4a2c956ab2093ece4f8a57c6ea4..35dc0b5084256f2ae755703edc3eb67cab0759ec 100644 +index ace19d6f5bc04091130bd28b65ce25e863117a43..17952377907afac28fd982ca2f9102067a062d6e 100644 --- a/arch/arm/configs/bcmrpi_defconfig +++ b/arch/arm/configs/bcmrpi_defconfig @@ -610,6 +610,7 @@ CONFIG_I2C_MUX_PCA954x=m @@ -135319,534 +132422,10 @@ index 7381eeba83ecd4a2c956ab2093ece4f8a57c6ea4..35dc0b5084256f2ae755703edc3eb67c CONFIG_SPI_BCM2835=m CONFIG_SPI_BCM2835AUX=m -From 23af6b7907bd85259b1e78974a00ca9dc0c23d07 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Wed, 26 Apr 2017 17:28:47 +0100 -Subject: [PATCH 160/201] clk: bcm2835: Limit PCM clock to OSC and PLLD_PER - -It is unwise to use sources other than the oscillator and PLLD_PER for -the PCM peripheral (and perhaps others - TBD) because their rate can -change and they may even be switched off, so explicitly restrict the -choice using dummy entries in the list of potential parents (item index -is significant). - -See: https://github.com/raspberrypi/linux/issues/1949 - -Signed-off-by: Phil Elwell ---- - drivers/clk/bcm/clk-bcm2835.c | 11 +++++++++++ - 1 file changed, 11 insertions(+) - -diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c -index fe3298b54cdfb96bd90fb4f39e13921d2e1d4356..c24b4defb2b046e4ecdc109befc2b22497060647 100644 ---- a/drivers/clk/bcm/clk-bcm2835.c -+++ b/drivers/clk/bcm/clk-bcm2835.c -@@ -1562,6 +1562,16 @@ static const char *const bcm2835_clock_per_parents[] = { - "pllh_aux", - }; - -+static const char *const bcm2835_pcm_per_parents[] = { -+ "-", -+ "xosc", -+ "-", -+ "-", -+ "-", -+ "-", -+ "plld_per", -+}; -+ - #define REGISTER_PER_CLK(...) REGISTER_CLK( \ - .num_mux_parents = ARRAY_SIZE(bcm2835_clock_per_parents), \ - .parents = bcm2835_clock_per_parents, \ -@@ -2051,6 +2061,7 @@ static const struct bcm2835_clk_desc clk_desc_array[] = { - .int_bits = 12, - .frac_bits = 12, - .is_mash_clock = true, -+ .parents = bcm2835_pcm_per_parents, - .tcnt_mux = 23), - [BCM2835_CLOCK_PWM] = REGISTER_PER_CLK( - .name = "pwm", - -From db88a1925a00c477096b25c4cff130f84f36a583 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Mon, 22 May 2017 13:56:41 +0100 -Subject: [PATCH 161/201] clk: bcm2835: Minimise clock jitter for PCM clock - -Fractional clock dividers generate accurate average frequencies but -with jitter, particularly when the integer divisor is small. - -Introduce a new metric of clock accuracy to penalise clocks with a good -average but worse jitter compared to clocks with an average which is no -better but with lower jitter. The metric is the ideal rate minus the -worse deviation from that ideal using the nearest integer divisors. - -Use this metric for parent selection for clocks requiring low jitter -(currently just PCM). - -Signed-off-by: Phil Elwell ---- - drivers/clk/bcm/clk-bcm2835.c | 39 ++++++++++++++++++++++++++++++++++----- - 1 file changed, 34 insertions(+), 5 deletions(-) - -diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c -index c24b4defb2b046e4ecdc109befc2b22497060647..db3ba74acf78f4dfec0d2206b58bc7c3a09f72fe 100644 ---- a/drivers/clk/bcm/clk-bcm2835.c -+++ b/drivers/clk/bcm/clk-bcm2835.c -@@ -534,6 +534,7 @@ struct bcm2835_clock_data { - - bool is_vpu_clock; - bool is_mash_clock; -+ bool low_jitter; - - u32 tcnt_mux; - }; -@@ -1154,7 +1155,8 @@ static unsigned long bcm2835_clock_choose_div_and_prate(struct clk_hw *hw, - int parent_idx, - unsigned long rate, - u32 *div, -- unsigned long *prate) -+ unsigned long *prate, -+ unsigned long *avgrate) - { - struct bcm2835_clock *clock = bcm2835_clock_from_hw(hw); - struct bcm2835_cprman *cprman = clock->cprman; -@@ -1166,11 +1168,33 @@ static unsigned long bcm2835_clock_choose_div_and_prate(struct clk_hw *hw, - parent = clk_hw_get_parent_by_index(hw, parent_idx); - - if (!(BIT(parent_idx) & data->set_rate_parent)) { -+ unsigned long tmp_rate; -+ - *prate = clk_hw_get_rate(parent); - *div = bcm2835_clock_choose_div(hw, rate, *prate, true); - -- return bcm2835_clock_rate_from_divisor(clock, *prate, -- *div); -+ tmp_rate = bcm2835_clock_rate_from_divisor(clock, *prate, *div); -+ *avgrate = tmp_rate; -+ -+ if (data->low_jitter && (*div & CM_DIV_FRAC_MASK)) { -+ unsigned long high, low; -+ u32 idiv = *div & ~CM_DIV_FRAC_MASK; -+ -+ high = bcm2835_clock_rate_from_divisor(clock, *prate, -+ idiv); -+ idiv += CM_DIV_FRAC_MASK + 1; -+ low = bcm2835_clock_rate_from_divisor(clock, *prate, -+ idiv); -+ -+ /* Return a value which is the maximum deviation -+ * below the ideal rate, for use as a metric. -+ */ -+ if ((tmp_rate - low) < (high - tmp_rate)) -+ tmp_rate = low; -+ else -+ tmp_rate -= high - tmp_rate; -+ } -+ return tmp_rate; - } - - if (data->frac_bits) -@@ -1197,6 +1221,7 @@ static unsigned long bcm2835_clock_choose_div_and_prate(struct clk_hw *hw, - - *div = curdiv << CM_DIV_FRAC_BITS; - *prate = curdiv * best_rate; -+ *avgrate = best_rate; - - return best_rate; - } -@@ -1208,6 +1233,7 @@ static int bcm2835_clock_determine_rate(struct clk_hw *hw, - bool current_parent_is_pllc; - unsigned long rate, best_rate = 0; - unsigned long prate, best_prate = 0; -+ unsigned long avgrate, best_avgrate = 0; - size_t i; - u32 div; - -@@ -1232,11 +1258,13 @@ static int bcm2835_clock_determine_rate(struct clk_hw *hw, - continue; - - rate = bcm2835_clock_choose_div_and_prate(hw, i, req->rate, -- &div, &prate); -+ &div, &prate, -+ &avgrate); - if (rate > best_rate && rate <= req->rate) { - best_parent = parent; - best_prate = prate; - best_rate = rate; -+ best_avgrate = avgrate; - } - } - -@@ -1246,7 +1274,7 @@ static int bcm2835_clock_determine_rate(struct clk_hw *hw, - req->best_parent_hw = best_parent; - req->best_parent_rate = best_prate; - -- req->rate = best_rate; -+ req->rate = best_avgrate; - - return 0; - } -@@ -2061,6 +2089,7 @@ static const struct bcm2835_clk_desc clk_desc_array[] = { - .int_bits = 12, - .frac_bits = 12, - .is_mash_clock = true, -+ .low_jitter = true, - .parents = bcm2835_pcm_per_parents, - .tcnt_mux = 23), - [BCM2835_CLOCK_PWM] = REGISTER_PER_CLK( - -From 3ae725f1779f1e196c9e99fb05d689c725b0cf62 Mon Sep 17 00:00:00 2001 -From: Bilal Amarni -Date: Wed, 24 May 2017 10:52:50 +0200 -Subject: [PATCH 162/201] [ARM64] enable drivers for GPIO expander and vcio - ---- - arch/arm64/configs/bcmrpi3_defconfig | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/arch/arm64/configs/bcmrpi3_defconfig b/arch/arm64/configs/bcmrpi3_defconfig -index 4d85c231c5ea0244e1b05fb4a5e3c8fd3e651ddf..9dcb58a519d041fadae99c81a7bda621b2a49f12 100644 ---- a/arch/arm64/configs/bcmrpi3_defconfig -+++ b/arch/arm64/configs/bcmrpi3_defconfig -@@ -575,6 +575,8 @@ CONFIG_SERIO_RAW=m - CONFIG_GAMEPORT=m - CONFIG_GAMEPORT_NS558=m - CONFIG_GAMEPORT_L4=m -+CONFIG_BRCM_CHAR_DRIVERS=y -+CONFIG_BCM_VCIO=y - # CONFIG_BCM2835_DEVGPIOMEM is not set - # CONFIG_BCM2835_SMI_DEV is not set - # CONFIG_LEGACY_PTYS is not set -@@ -609,6 +611,7 @@ CONFIG_PPS=m - CONFIG_PPS_CLIENT_LDISC=m - CONFIG_PPS_CLIENT_GPIO=m - CONFIG_GPIO_SYSFS=y -+CONFIG_GPIO_BCM_EXP=y - CONFIG_GPIO_BCM_VIRT=y - CONFIG_GPIO_ARIZONA=m - CONFIG_GPIO_STMPE=y - -From eeaf6979cd212eac0924e600dc2e95bdac67b034 Mon Sep 17 00:00:00 2001 -From: P33M -Date: Thu, 25 May 2017 16:04:53 +0100 -Subject: [PATCH 163/201] dwc_otg: make periodic scheduling behave properly for - FS buses - -If the root port is in full-speed mode, transfer times at 12mbit/s -would be calculated but matched against high-speed quotas. - -Reinitialise hcd->frame_usecs[i] on each port enable event so that -full-speed bandwidth can be tracked sensibly. - -Also, don't bother using the FIQ for transfers when in full-speed -mode - at the slower bus speed, interrupt frequency is reduced by -an order of magnitude. - -Related issue: https://github.com/raspberrypi/linux/issues/2020 ---- - drivers/usb/host/dwc_otg/dwc_otg_hcd.c | 15 ++++++++++----- - drivers/usb/host/dwc_otg/dwc_otg_hcd.h | 7 +++++-- - drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c | 4 ++++ - drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c | 19 ++++++++++++------- - 4 files changed, 31 insertions(+), 14 deletions(-) - -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c -index a2dc6337836b2719f4c954edeeb2a71301931b04..38bf5fc792d32352f9e208e0e90f968599b9bc31 100644 ---- a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c -+++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c -@@ -926,8 +926,6 @@ static void dwc_otg_hcd_free(dwc_otg_hcd_t * dwc_otg_hcd) - DWC_FREE(dwc_otg_hcd); - } - --int init_hcd_usecs(dwc_otg_hcd_t *_hcd); -- - int dwc_otg_hcd_init(dwc_otg_hcd_t * hcd, dwc_otg_core_if_t * core_if) - { - struct device *dev = dwc_otg_hcd_to_dev(hcd); -@@ -1429,6 +1427,7 @@ static void assign_and_init_hc(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh) - - /** - * fiq_fsm_transaction_suitable() - Test a QH for compatibility with the FIQ -+ * @hcd: Pointer to the dwc_otg_hcd struct - * @qh: pointer to the endpoint's queue head - * - * Transaction start/end control flow is grafted onto the existing dwc_otg -@@ -1438,8 +1437,14 @@ static void assign_and_init_hc(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh) - * Returns: 0 for unsuitable, 1 implies the FIQ can be enabled for this transaction. - */ - --int fiq_fsm_transaction_suitable(dwc_otg_qh_t *qh) -+int fiq_fsm_transaction_suitable(dwc_otg_hcd_t *hcd, dwc_otg_qh_t *qh) - { -+ /* There is little benefit in using the FIQ to perform transfers if -+ * the root port is not in high-speed mode. -+ */ -+ if (hcd->flags.b.port_speed != DWC_HPRT0_PRTSPD_HIGH_SPEED) -+ return 0; -+ - if (qh->do_split) { - switch (qh->ep_type) { - case UE_CONTROL: -@@ -2218,7 +2223,7 @@ static void process_periodic_channels(dwc_otg_hcd_t * hcd) - continue; - } - -- if (fiq_fsm_enable && fiq_fsm_transaction_suitable(qh)) { -+ if (fiq_fsm_enable && fiq_fsm_transaction_suitable(hcd, qh)) { - if (qh->do_split) - fiq_fsm_queue_split_transaction(hcd, qh); - else -@@ -2355,7 +2360,7 @@ static void process_non_periodic_channels(dwc_otg_hcd_t * hcd) - qh = DWC_LIST_ENTRY(hcd->non_periodic_qh_ptr, dwc_otg_qh_t, - qh_list_entry); - -- if(fiq_fsm_enable && fiq_fsm_transaction_suitable(qh)) { -+ if(fiq_fsm_enable && fiq_fsm_transaction_suitable(hcd, qh)) { - fiq_fsm_queue_split_transaction(hcd, qh); - } else { - status = queue_transaction(hcd, qh->channel, -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd.h b/drivers/usb/host/dwc_otg/dwc_otg_hcd.h -index 7f7e9eaffd6a3c3d898855562fbec11289f77f53..5ed8dccf03959a610849aa6c8946ca745dbae207 100644 ---- a/drivers/usb/host/dwc_otg/dwc_otg_hcd.h -+++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd.h -@@ -410,7 +410,8 @@ struct dwc_otg_hcd { - unsigned port_suspend_change:1; - unsigned port_over_current_change:1; - unsigned port_l1_change:1; -- unsigned reserved:26; -+ unsigned port_speed:2; -+ unsigned reserved:24; - } b; - } flags; - -@@ -629,7 +630,7 @@ int dwc_otg_hcd_allocate_port(dwc_otg_hcd_t * hcd, dwc_otg_qh_t *qh); - void dwc_otg_hcd_release_port(dwc_otg_hcd_t * dwc_otg_hcd, dwc_otg_qh_t *qh); - - extern int fiq_fsm_queue_transaction(dwc_otg_hcd_t *hcd, dwc_otg_qh_t *qh); --extern int fiq_fsm_transaction_suitable(dwc_otg_qh_t *qh); -+extern int fiq_fsm_transaction_suitable(dwc_otg_hcd_t *hcd, dwc_otg_qh_t *qh); - extern void dwc_otg_cleanup_fiq_channel(dwc_otg_hcd_t *hcd, uint32_t num); - - /** @} */ -@@ -823,6 +824,8 @@ static inline uint16_t dwc_micro_frame_num(uint16_t frame) - return frame & 0x7; - } - -+extern void init_hcd_usecs(dwc_otg_hcd_t *_hcd); -+ - void dwc_otg_hcd_save_data_toggle(dwc_hc_t * hc, - dwc_otg_hc_regs_t * hc_regs, - dwc_otg_qtd_t * qtd); -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 a4355afc77b68718fdaba6c5d4be257dadc75036..c8f52709a7d24974c0a38dcf1708f91073e96b0e 100644 ---- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c -+++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c -@@ -515,6 +515,10 @@ int32_t dwc_otg_hcd_handle_port_intr(dwc_otg_hcd_t * dwc_otg_hcd) - dwc_otg_host_if_t *host_if = - dwc_otg_hcd->core_if->host_if; - -+ dwc_otg_hcd->flags.b.port_speed = hprt0.b.prtspd; -+ if (microframe_schedule) -+ init_hcd_usecs(dwc_otg_hcd); -+ - /* Every time when port enables calculate - * HFIR.FrInterval - */ -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c -index 85a6d431ca54b47dc10573aa72d1ad69d06f2e36..4b1dd9de99e9e08b2e006fb5f8a7ef92f20c2553 100644 ---- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c -+++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c -@@ -408,13 +408,17 @@ const unsigned short max_uframe_usecs[]={ 100, 100, 100, 100, 100, 100, 30, 0 }; - /* - * called from dwc_otg_hcd.c:dwc_otg_hcd_init - */ --int init_hcd_usecs(dwc_otg_hcd_t *_hcd) -+void init_hcd_usecs(dwc_otg_hcd_t *_hcd) - { - int i; -- for (i=0; i<8; i++) { -- _hcd->frame_usecs[i] = max_uframe_usecs[i]; -+ if (_hcd->flags.b.port_speed == DWC_HPRT0_PRTSPD_FULL_SPEED) { -+ _hcd->frame_usecs[0] = 900; -+ for (i = 1; i < 8; i++) -+ _hcd->frame_usecs[i] = 0; -+ } else { -+ for (i = 0; i < 8; i++) -+ _hcd->frame_usecs[i] = max_uframe_usecs[i]; - } -- return 0; - } - - static int find_single_uframe(dwc_otg_hcd_t * _hcd, dwc_otg_qh_t * _qh) -@@ -541,8 +545,9 @@ static int find_uframe(dwc_otg_hcd_t * _hcd, dwc_otg_qh_t * _qh) - int ret; - ret = -1; - -- if (_qh->speed == USB_SPEED_HIGH) { -- /* if this is a hs transaction we need a full frame */ -+ if (_qh->speed == USB_SPEED_HIGH || -+ _hcd->flags.b.port_speed == DWC_HPRT0_PRTSPD_FULL_SPEED) { -+ /* if this is a hs transaction we need a full frame - or account for FS usecs */ - ret = find_single_uframe(_hcd, _qh); - } else { - /* if this is a fs transaction we may need a sequence of frames */ -@@ -627,7 +632,7 @@ static int schedule_periodic(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh) - if (status) { - DWC_INFO("%s: Insufficient periodic bandwidth for " - "periodic transfer.\n", __func__); -- return status; -+ return -DWC_E_NO_SPACE; - } - status = check_max_xfer_size(hcd, qh); - if (status) { - -From e27e57d26b058a622d916e2530edf6d4c5360cb4 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Fri, 19 May 2017 16:07:23 +0100 -Subject: [PATCH 164/201] serial: 8250: Add CAP_MINI, set for bcm2835aux - -commit d087e7a991f1f61ee2c07db1be7c5cc2aa373f5d upstream. - -The AUX/mini-UART in the BCM2835 family of procesors is a cut-down -8250 clone. In particular it is lacking support for the following -features: CSTOPB PARENB PARODD CMSPAR CS5 CS6 - -Add a new capability (UART_CAP_MINI) that exposes the restrictions to -the user of the termios API by turning off the unsupported features in -the request. - -N.B. It is almost possible to automatically discover the missing -features by reading back the LCR register, but the CSIZE bits don't -cooperate (contrary to the documentation, both bits are significant, -but CS5 and CS6 are mapped to CS7) and the code is much longer. - -See: https://github.com/raspberrypi/linux/issues/1561 - -Signed-off-by: Phil Elwell -Acked-by: Eric Anholt -Signed-off-by: Greg Kroah-Hartman ---- - drivers/tty/serial/8250/8250.h | 3 +++ - drivers/tty/serial/8250/8250_bcm2835aux.c | 2 +- - drivers/tty/serial/8250/8250_port.c | 6 ++++++ - 3 files changed, 10 insertions(+), 1 deletion(-) - -diff --git a/drivers/tty/serial/8250/8250.h b/drivers/tty/serial/8250/8250.h -index ce8d4ffcc425b045377305f176aa8fa85af0068f..b2bdc35f74955fe134606ad9103811d227de8abf 100644 ---- a/drivers/tty/serial/8250/8250.h -+++ b/drivers/tty/serial/8250/8250.h -@@ -81,6 +81,9 @@ struct serial8250_config { - #define UART_CAP_HFIFO (1 << 14) /* UART has a "hidden" FIFO */ - #define UART_CAP_RPM (1 << 15) /* Runtime PM is active while idle */ - #define UART_CAP_IRDA (1 << 16) /* UART supports IrDA line discipline */ -+#define UART_CAP_MINI (1 << 17) /* Mini UART on BCM283X family lacks: -+ * STOP PARITY EPAR SPAR WLEN5 WLEN6 -+ */ - - #define UART_BUG_QUOT (1 << 0) /* UART has buggy quot LSB */ - #define UART_BUG_TXEN (1 << 1) /* UART has buggy TX IIR status */ -diff --git a/drivers/tty/serial/8250/8250_bcm2835aux.c b/drivers/tty/serial/8250/8250_bcm2835aux.c -index e10f1244409b344b850ffbbd4af5757a66c875f1..a23c7da42ea81342efc26fb35a92a69d535b7cd0 100644 ---- a/drivers/tty/serial/8250/8250_bcm2835aux.c -+++ b/drivers/tty/serial/8250/8250_bcm2835aux.c -@@ -39,7 +39,7 @@ static int bcm2835aux_serial_probe(struct platform_device *pdev) - - /* initialize data */ - spin_lock_init(&data->uart.port.lock); -- data->uart.capabilities = UART_CAP_FIFO; -+ data->uart.capabilities = UART_CAP_FIFO | UART_CAP_MINI; - data->uart.port.dev = &pdev->dev; - data->uart.port.regshift = 2; - data->uart.port.type = PORT_16550; -diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c -index 579706d36f5c77382cc289d55c2e6290143d6b1d..27e4a15fbe009e45270b5eaf3698bcfd0baaa1e3 100644 ---- a/drivers/tty/serial/8250/8250_port.c -+++ b/drivers/tty/serial/8250/8250_port.c -@@ -2585,6 +2585,12 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios, - unsigned long flags; - unsigned int baud, quot, frac = 0; - -+ if (up->capabilities & UART_CAP_MINI) { -+ termios->c_cflag &= ~(CSTOPB | PARENB | PARODD | CMSPAR); -+ if ((termios->c_cflag & CSIZE) == CS5 || -+ (termios->c_cflag & CSIZE) == CS6) -+ termios->c_cflag = (termios->c_cflag & ~CSIZE) | CS7; -+ } - cval = serial8250_compute_lcr(up, termios->c_cflag); - - baud = serial8250_get_baud_rate(port, termios, old); - -From 5ed43a750f4dd57c53b956caa24b8d1f63fbdb8e Mon Sep 17 00:00:00 2001 -From: P33M -Date: Fri, 26 May 2017 12:50:31 +0100 -Subject: [PATCH 165/201] dwc_otg: fiq_fsm: Make isochronous compatibility - checks work properly - -Get rid of the spammy printk and local pointer mangling. -Also, there is a nominal benefit for using fiq_fsm for isochronous -transfers in FS mode (~1.1k IRQs per second vs 2.1k IRQs per second) -so remove the root port speed check. ---- - drivers/usb/host/dwc_otg/dwc_otg_hcd.c | 24 ++++++------------------ - 1 file changed, 6 insertions(+), 18 deletions(-) - -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c -index 38bf5fc792d32352f9e208e0e90f968599b9bc31..71834cf365e67d7ad995bba7869216c4091c3a74 100644 ---- a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c -+++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c -@@ -1439,12 +1439,6 @@ static void assign_and_init_hc(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh) - - int fiq_fsm_transaction_suitable(dwc_otg_hcd_t *hcd, dwc_otg_qh_t *qh) - { -- /* There is little benefit in using the FIQ to perform transfers if -- * the root port is not in high-speed mode. -- */ -- if (hcd->flags.b.port_speed != DWC_HPRT0_PRTSPD_HIGH_SPEED) -- return 0; -- - if (qh->do_split) { - switch (qh->ep_type) { - case UE_CONTROL: -@@ -1462,28 +1456,22 @@ int fiq_fsm_transaction_suitable(dwc_otg_hcd_t *hcd, dwc_otg_qh_t *qh) - } - } else if (qh->ep_type == UE_ISOCHRONOUS) { - if (fiq_fsm_mask & (1 << 2)) { -- /* HS ISOCH support. We test for compatibility: -+ /* ISOCH support. We test for compatibility: - * - DWORD aligned buffers - * - Must be at least 2 transfers (otherwise pointless to use the FIQ) - * If yes, then the fsm enqueue function will handle the state machine setup. - */ - dwc_otg_qtd_t *qtd = DWC_CIRCLEQ_FIRST(&qh->qtd_list); - dwc_otg_hcd_urb_t *urb = qtd->urb; -- struct dwc_otg_hcd_iso_packet_desc (*iso_descs)[0] = &urb->iso_descs; -- int nr_iso_frames = urb->packet_count; -+ dwc_dma_t ptr; - int i; -- uint32_t ptr; - -- if (nr_iso_frames < 2) -+ if (urb->packet_count < 2) - return 0; -- for (i = 0; i < nr_iso_frames; i++) { -- ptr = urb->dma + iso_descs[i]->offset; -- if (ptr & 0x3) { -- printk_ratelimited("%s: Non-Dword aligned isochronous frame offset." -- " Cannot queue FIQ-accelerated transfer to device %d endpoint %d\n", -- __FUNCTION__, qh->channel->dev_addr, qh->channel->ep_num); -+ for (i = 0; i < urb->packet_count; i++) { -+ ptr = urb->dma + urb->iso_descs[i].offset; -+ if (ptr & 0x3) - return 0; -- } - } - return 1; - } - -From 258feb9498c98b56e5077a0b46180acfff242341 Mon Sep 17 00:00:00 2001 +From eb7c240dc101bc8fdd76e59ad5957b89c1d14a8b Mon Sep 17 00:00:00 2001 From: popcornmix -Date: Mon, 12 Jun 2017 13:05:43 +0100 -Subject: [PATCH 166/201] config: Add CONFIG_CAN_GS_USB +Date: Thu, 18 May 2017 11:40:43 +0100 +Subject: [PATCH 128/134] config: Add FB_TFT_ST7789V module --- arch/arm/configs/bcm2709_defconfig | 1 + @@ -135854,1616 +132433,34 @@ Subject: [PATCH 166/201] config: Add CONFIG_CAN_GS_USB 2 files changed, 2 insertions(+) diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig -index 12157f209bc0a503c1bc3f04224784451c03f964..b59062ce3d980c8b2612722c9d1b7ccc2dab4c7d 100644 +index ef4f52539bc903ce1e3543d3104adac7dbf36a8a..13b653b438bd5c087b1744c5633a930bd0a2abee 100644 --- a/arch/arm/configs/bcm2709_defconfig +++ b/arch/arm/configs/bcm2709_defconfig -@@ -359,6 +359,7 @@ CONFIG_CAN=m - 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 +@@ -1140,6 +1140,7 @@ CONFIG_FB_TFT_SSD1306=m + CONFIG_FB_TFT_SSD1331=m + CONFIG_FB_TFT_SSD1351=m + CONFIG_FB_TFT_ST7735R=m ++CONFIG_FB_TFT_ST7789V=m + CONFIG_FB_TFT_TINYLCD=m + CONFIG_FB_TFT_TLS8204=m + CONFIG_FB_TFT_UC1701=m diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index 35dc0b5084256f2ae755703edc3eb67cab0759ec..42163e2c0b5d5666d49793ac4e074d22cc59c286 100644 +index 17952377907afac28fd982ca2f9102067a062d6e..ef7bfc431c43eec6deb7c52e8cdac31794ccccbe 100644 --- a/arch/arm/configs/bcmrpi_defconfig +++ b/arch/arm/configs/bcmrpi_defconfig -@@ -355,6 +355,7 @@ CONFIG_CAN=m - 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 - -From 44354e08ba5546f1af30ff5f2cbfaebd4e1d68fd Mon Sep 17 00:00:00 2001 -From: P33M -Date: Mon, 12 Jun 2017 16:10:03 +0100 -Subject: [PATCH 167/201] dwc_otg: add module parameter int_ep_interval_min - -Add a module parameter (defaulting to ignored) that clamps the polling rate -of high-speed Interrupt endpoints to a minimum microframe interval. - -The parameter is modifiable at runtime as it is used when activating new -endpoints (such as on device connect). ---- - drivers/usb/host/dwc_otg/dwc_otg_driver.c | 6 +++++- - drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c | 25 ++++++++++++------------- - 2 files changed, 17 insertions(+), 14 deletions(-) - -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_driver.c b/drivers/usb/host/dwc_otg/dwc_otg_driver.c -index cb060a7179a3eec791506ed2779b553cad9841b0..95943e07528276b26b51ea2d57a1f433f280aaef 100644 ---- a/drivers/usb/host/dwc_otg/dwc_otg_driver.c -+++ b/drivers/usb/host/dwc_otg/dwc_otg_driver.c -@@ -249,6 +249,7 @@ uint16_t nak_holdoff = 8; - - unsigned short fiq_fsm_mask = 0x0F; - -+unsigned short int_ep_interval_min = 0; - /** - * This function shows the Driver Version. - */ -@@ -1398,7 +1399,10 @@ MODULE_PARM_DESC(fiq_fsm_mask, "Bitmask of transactions to perform in the FIQ.\n - "Bit 1 : Periodic split transactions\n" - "Bit 2 : High-speed multi-transfer isochronous\n" - "All other bits should be set 0."); -- -+module_param(int_ep_interval_min, ushort, 0644); -+MODULE_PARM_DESC(int_ep_interval_min, "Clamp high-speed Interrupt endpoints to a minimum polling interval.\n" -+ "0..1 = Use endpoint default\n" -+ "2..n = Minimum interval n microframes. Use powers of 2.\n"); - - /** @page "Module Parameters" - * -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c -index 4b1dd9de99e9e08b2e006fb5f8a7ef92f20c2553..fe8e8f841f03660c2ad49ab8e66193bec62558d3 100644 ---- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c -+++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_queue.c -@@ -43,6 +43,7 @@ - #include "dwc_otg_regs.h" - - extern bool microframe_schedule; -+extern unsigned short int_ep_interval_min; - - /** - * Free each QTD in the QH's QTD-list then free the QH. QH should already be -@@ -218,21 +219,19 @@ void qh_init(dwc_otg_hcd_t * hcd, dwc_otg_qh_t * qh, dwc_otg_hcd_urb_t * urb) - SCHEDULE_SLOP); - qh->interval = urb->interval; - --#if 0 -- /* Increase interrupt polling rate for debugging. */ -- if (qh->ep_type == UE_INTERRUPT) { -- qh->interval = 8; -- } --#endif - hprt.d32 = DWC_READ_REG32(hcd->core_if->host_if->hprt0); -- if ((hprt.b.prtspd == DWC_HPRT0_PRTSPD_HIGH_SPEED) && -- ((dev_speed == USB_SPEED_LOW) || -- (dev_speed == USB_SPEED_FULL))) { -- qh->interval *= 8; -- qh->sched_frame |= 0x7; -- qh->start_split_frame = qh->sched_frame; -+ if (hprt.b.prtspd == DWC_HPRT0_PRTSPD_HIGH_SPEED) { -+ if (dev_speed == USB_SPEED_LOW || -+ dev_speed == USB_SPEED_FULL) { -+ qh->interval *= 8; -+ qh->sched_frame |= 0x7; -+ qh->start_split_frame = qh->sched_frame; -+ } else if (int_ep_interval_min >= 2 && -+ qh->interval < int_ep_interval_min && -+ qh->ep_type == UE_INTERRUPT) { -+ qh->interval = int_ep_interval_min; -+ } - } -- - } - - DWC_DEBUGPL(DBG_HCD, "DWC OTG HCD QH Initialized\n"); - -From 357dbda1ae2bf389b8eb823ad0feff918e820a1a Mon Sep 17 00:00:00 2001 -From: P33M -Date: Tue, 20 Jun 2017 13:44:01 +0100 -Subject: [PATCH 168/201] dwc_otg: fiq_fsm: Add non-periodic TT exclusivity - constraints - -Certain hub types do not discriminate between pipe direction (IN or OUT) -when considering non-periodic transfers. Therefore these hubs get confused -if multiple transfers are issued in different directions with the same -device address and endpoint number. - -Constrain queuing non-periodic split transactions so they are performed -serially in such cases. - -Related: https://github.com/raspberrypi/linux/issues/2024 ---- - drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c | 32 ++++++++++++++++++ - drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.h | 2 ++ - drivers/usb/host/dwc_otg/dwc_otg_hcd.c | 53 ++++++++++++++++++++++++++++-- - 3 files changed, 85 insertions(+), 2 deletions(-) - -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c b/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c -index 208252645c09d1d17bf07673989f91b7f4b3ef7a..0163e9cf620ba58df36a872b82cea92734baada6 100644 ---- a/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c -+++ b/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.c -@@ -191,6 +191,32 @@ static void notrace fiq_fsm_setup_csplit(struct fiq_state *st, int n) - mb(); - } - -+/** -+ * fiq_fsm_restart_np_pending() - Restart a single non-periodic contended transfer -+ * @st: Pointer to the channel's state -+ * @num_channels: Total number of host channels -+ * @orig_channel: Channel index of completed transfer -+ * -+ * In the case where an IN and OUT transfer are simultaneously scheduled to the -+ * same device/EP, inadequate hub implementations will misbehave. Once the first -+ * transfer is complete, a pending non-periodic split can then be issued. -+ */ -+static void notrace fiq_fsm_restart_np_pending(struct fiq_state *st, int num_channels, int orig_channel) -+{ -+ int i; -+ int dev_addr = st->channel[orig_channel].hcchar_copy.b.devaddr; -+ int ep_num = st->channel[orig_channel].hcchar_copy.b.epnum; -+ for (i = 0; i < num_channels; i++) { -+ if (st->channel[i].fsm == FIQ_NP_SSPLIT_PENDING && -+ st->channel[i].hcchar_copy.b.devaddr == dev_addr && -+ st->channel[i].hcchar_copy.b.epnum == ep_num) { -+ st->channel[i].fsm = FIQ_NP_SSPLIT_STARTED; -+ fiq_fsm_restart_channel(st, i, 0); -+ break; -+ } -+ } -+} -+ - static inline int notrace fiq_get_xfer_len(struct fiq_state *st, int n) - { - /* The xfersize register is a bit wonky. For IN transfers, it decrements by the packet size. */ -@@ -870,6 +896,9 @@ static int notrace noinline fiq_fsm_do_hcintr(struct fiq_state *state, int num_c - st->fsm = FIQ_NP_SPLIT_HS_ABORTED; - } - } -+ if (st->fsm != FIQ_NP_IN_CSPLIT_RETRY) { -+ fiq_fsm_restart_np_pending(state, num_channels, n); -+ } - break; - - case FIQ_NP_OUT_CSPLIT_RETRY: -@@ -919,6 +948,9 @@ static int notrace noinline fiq_fsm_do_hcintr(struct fiq_state *state, int num_c - st->fsm = FIQ_NP_SPLIT_HS_ABORTED; - } - } -+ if (st->fsm != FIQ_NP_OUT_CSPLIT_RETRY) { -+ fiq_fsm_restart_np_pending(state, num_channels, n); -+ } - break; - - /* Periodic split states (except isoc out) */ -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.h b/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.h -index 0a1ddf3f89f45ca75b8880722fbc22cbdc9f4a2f..ed088f34f210e9a337ab9b80fff0cf9e9b0241ea 100644 ---- a/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.h -+++ b/drivers/usb/host/dwc_otg/dwc_otg_fiq_fsm.h -@@ -178,6 +178,8 @@ enum fiq_fsm_state { - /* Nonperiodic state groups */ - FIQ_NP_SSPLIT_STARTED = 1, - FIQ_NP_SSPLIT_RETRY = 2, -+ /* TT contention - working around hub bugs */ -+ FIQ_NP_SSPLIT_PENDING = 33, - FIQ_NP_OUT_CSPLIT_RETRY = 3, - FIQ_NP_IN_CSPLIT_RETRY = 4, - FIQ_NP_SPLIT_DONE = 5, -diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c -index 71834cf365e67d7ad995bba7869216c4091c3a74..7710370b30363e3170bf9bf522597c5f41dfb908 100644 ---- a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c -+++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c -@@ -1572,6 +1572,45 @@ int fiq_fsm_setup_periodic_dma(dwc_otg_hcd_t *hcd, struct fiq_channel_state *st, - } - } - -+/** -+ * fiq_fsm_np_tt_contended() - Avoid performing contended non-periodic transfers -+ * @hcd: Pointer to the dwc_otg_hcd struct -+ * @qh: Pointer to the endpoint's queue head -+ * -+ * Certain hub chips don't differentiate between IN and OUT non-periodic pipes -+ * with the same endpoint number. If transfers get completed out of order -+ * (disregarding the direction token) then the hub can lock up -+ * or return erroneous responses. -+ * -+ * Returns 1 if initiating the transfer would cause contention, 0 otherwise. -+ */ -+int fiq_fsm_np_tt_contended(dwc_otg_hcd_t *hcd, dwc_otg_qh_t *qh) -+{ -+ int i; -+ struct fiq_channel_state *st; -+ int dev_addr = qh->channel->dev_addr; -+ int ep_num = qh->channel->ep_num; -+ for (i = 0; i < hcd->core_if->core_params->host_channels; i++) { -+ if (i == qh->channel->hc_num) -+ continue; -+ st = &hcd->fiq_state->channel[i]; -+ switch (st->fsm) { -+ case FIQ_NP_SSPLIT_STARTED: -+ case FIQ_NP_SSPLIT_RETRY: -+ case FIQ_NP_SSPLIT_PENDING: -+ case FIQ_NP_OUT_CSPLIT_RETRY: -+ case FIQ_NP_IN_CSPLIT_RETRY: -+ if (st->hcchar_copy.b.devaddr == dev_addr && -+ st->hcchar_copy.b.epnum == ep_num) -+ return 1; -+ break; -+ default: -+ break; -+ } -+ } -+ return 0; -+} -+ - /* - * Pushing a periodic request into the queue near the EOF1 point - * in a microframe causes erroneous behaviour (frmovrun) interrupt. -@@ -1894,7 +1933,12 @@ int fiq_fsm_queue_split_transaction(dwc_otg_hcd_t *hcd, dwc_otg_qh_t *qh) - switch (hc->ep_type) { - case UE_CONTROL: - case UE_BULK: -- st->fsm = FIQ_NP_SSPLIT_STARTED; -+ if (fiq_fsm_np_tt_contended(hcd, qh)) { -+ st->fsm = FIQ_NP_SSPLIT_PENDING; -+ start_immediate = 0; -+ } else { -+ st->fsm = FIQ_NP_SSPLIT_STARTED; -+ } - break; - case UE_ISOCHRONOUS: - if (hc->ep_is_in) { -@@ -1918,7 +1962,12 @@ int fiq_fsm_queue_split_transaction(dwc_otg_hcd_t *hcd, dwc_otg_qh_t *qh) - break; - case UE_INTERRUPT: - if (fiq_fsm_mask & 0x8) { -- st->fsm = FIQ_NP_SSPLIT_STARTED; -+ if (fiq_fsm_np_tt_contended(hcd, qh)) { -+ st->fsm = FIQ_NP_SSPLIT_PENDING; -+ start_immediate = 0; -+ } else { -+ st->fsm = FIQ_NP_SSPLIT_STARTED; -+ } - } else if (start_immediate) { - st->fsm = FIQ_PER_SSPLIT_STARTED; - } else { - -From f0648b6fe4d0c922842bd895433b13dfc3e97bcd Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Wed, 21 Jun 2017 17:19:04 +0100 -Subject: [PATCH 169/201] serial: 8250: Fix THRE flag usage for CAP_MINI - -The BCM2835 MINI UART has non-standard THRE semantics. Conventionally -the bit means that the FIFO is empty (although there may still be a -byte in the transmit register), but on 2835 it indicates that the FIFO -is not empty. This causes interrupts after every byte is transmitted, -with the FIFO providing some interrupt latency tolerance. - -A consequence of this difference is that the usual strategy of writing -multiple bytes into the TX FIFO after checking THRE once is unsafe. -In the worst case of 7 bytes in the FIFO, writing 8 bytes loses all -but the first since by then the FIFO is full. - -There is an HFIFO ("Hidden FIFO") bit which is almost what is needed, -but it only adds more bytes while both THRE and TEMT are set, i.e. -when the TX side is completely idle. This is unnecessarily pessimistic. - -Add a new special case, predicated on CAP_MINI, that loops until THRE -is no longer set. With this change, the FIFO fills quickly but -subsequent writes are paced by the transmission rate. - -See: https://github.com/raspberrypi/linux/issues/1855 - -Signed-off-by: Phil Elwell ---- - drivers/tty/serial/8250/8250_port.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c -index 27e4a15fbe009e45270b5eaf3698bcfd0baaa1e3..75fcdfdf86df13564247885ade1fd9f04b0039eb 100644 ---- a/drivers/tty/serial/8250/8250_port.c -+++ b/drivers/tty/serial/8250/8250_port.c -@@ -1764,6 +1764,10 @@ void serial8250_tx_chars(struct uart_8250_port *up) - if ((up->capabilities & UART_CAP_HFIFO) && - (serial_in(up, UART_LSR) & BOTH_EMPTY) != BOTH_EMPTY) - break; -+ /* The BCM2835 MINI UART THRE bit is really a not-full bit. */ -+ if ((up->capabilities & UART_CAP_MINI) && -+ !(serial_in(up, UART_LSR) & UART_LSR_THRE)) -+ break; - } while (--count > 0); - - if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) - -From 1901bc3636ce5b89e3b275480c4fe0b0aeaa79ad Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Fri, 26 May 2017 13:03:41 +0100 -Subject: [PATCH 170/201] BCM270X_DT: Add midi-uart1 overlay - -Add a scaler to the ttyS0 clock so that requesting 38400 baud results -in an approximately 31250 baud signal. This is analagous to -midi-uart0, except for ttyS0, which may be useful on Pi3 and also -may avoid an issue with ttyAMA0 failing to synchronise to an active -data stream. - -See: https://www.raspberrypi.org/forums/viewtopic.php?f=107&t=183860 - -Signed-off-by: Phil Elwell ---- - arch/arm/boot/dts/overlays/Makefile | 1 + - arch/arm/boot/dts/overlays/README | 7 ++++ - arch/arm/boot/dts/overlays/midi-uart1-overlay.dts | 43 +++++++++++++++++++++++ - 3 files changed, 51 insertions(+) - create mode 100644 arch/arm/boot/dts/overlays/midi-uart1-overlay.dts - -diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile -index e2f66a55dc5afe13d690c2c17827054ac94b7168..e0ff5793f124fce73732e175bfca424f0a97b632 100644 ---- a/arch/arm/boot/dts/overlays/Makefile -+++ b/arch/arm/boot/dts/overlays/Makefile -@@ -56,6 +56,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ - mcp2515-can1.dtbo \ - mcp3008.dtbo \ - midi-uart0.dtbo \ -+ midi-uart1.dtbo \ - mmc.dtbo \ - mz61581.dtbo \ - pi3-act-led.dtbo \ -diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README -index e2a803e5180cf78d67b6723cfd2f6d3b2b54e53b..ec9e7b1941678796facf625b3770c20ed0b15b25 100644 ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -864,6 +864,13 @@ Load: dtoverlay=midi-uart0 - Params: - - -+Name: midi-uart1 -+Info: Configures UART1 (ttyS0) so that a requested 38.4kbaud actually gets -+ 31.25kbaud, the frequency required for MIDI -+Load: dtoverlay=midi-uart1 -+Params: -+ -+ - Name: mmc - Info: Selects the bcm2835-mmc SD/MMC driver, optionally with overclock - Load: dtoverlay=mmc,= -diff --git a/arch/arm/boot/dts/overlays/midi-uart1-overlay.dts b/arch/arm/boot/dts/overlays/midi-uart1-overlay.dts -new file mode 100644 -index 0000000000000000000000000000000000000000..e0bc410acbff3a7a175dd5d53b3ab0d0802e8239 ---- /dev/null -+++ b/arch/arm/boot/dts/overlays/midi-uart1-overlay.dts -@@ -0,0 +1,43 @@ -+/dts-v1/; -+/plugin/; -+ -+#include -+ -+/* -+ * Fake a higher clock rate to get a larger divisor, and thereby a lower -+ * baudrate. The real clock is 48MHz, which we scale so that requesting -+ * 38.4kHz results in an actual 31.25kHz. -+ * -+ * 48000000*38400/31250 = 58982400 -+ */ -+ -+/{ -+ compatible = "brcm,bcm2835"; -+ -+ fragment@0 { -+ target-path = "/clocks"; -+ __overlay__ { -+ midi_clk: clock@5 { -+ compatible = "fixed-factor-clock"; -+ #clock-cells = <0>; -+ clocks = <&aux BCM2835_AUX_CLOCK_UART>; -+ clock-mult = <38400>; -+ clock-div = <31250>; -+ }; -+ }; -+ }; -+ -+ fragment@1 { -+ target = <&uart1>; -+ __overlay__ { -+ clocks = <&midi_clk>; -+ }; -+ }; -+ -+ fragment@2 { -+ target = <&aux>; -+ __overlay__ { -+ clock-output-names = "aux_uart", "aux_spi1", "aux_spi2"; -+ }; -+ }; -+}; - -From 509ab2651cd17d211643fa2b94e9fd24f688b0ac Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Sat, 20 May 2017 22:10:14 +0100 -Subject: [PATCH 171/201] overlays: README: remove vestigial SDIO parameters - -Signed-off-by: Phil Elwell ---- - arch/arm/boot/dts/overlays/README | 24 ++---------------------- - 1 file changed, 2 insertions(+), 22 deletions(-) - -diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README -index ec9e7b1941678796facf625b3770c20ed0b15b25..499cd1920fd373702cfbc9f6e0fcaebca8a47cfc 100644 ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -1203,19 +1203,9 @@ Name: sdio - Info: Selects the bcm2835-sdhost SD/MMC driver, optionally with overclock, - and enables SDIO via GPIOs 22-27. - Load: dtoverlay=sdio,= --Params: overclock_50 SD Clock (in MHz) to use when the MMC framework -- requests 50MHz -- -- sdio_overclock SDIO Clock (in MHz) to use when the MMC -+Params: sdio_overclock SDIO Clock (in MHz) to use when the MMC - framework requests 50MHz - -- force_pio Disable DMA support (default off) -- -- pio_limit Number of blocks above which to use DMA -- (default 1) -- -- debug Enable debug output (default off) -- - poll_once Disable SDIO-device polling every second - (default on: polling once at boot-time) - -@@ -1226,19 +1216,9 @@ Name: sdio-1bit - Info: Selects the bcm2835-sdhost SD/MMC driver, optionally with overclock, - and enables 1-bit SDIO via GPIOs 22-25. - Load: dtoverlay=sdio-1bit,= --Params: overclock_50 SD Clock (in MHz) to use when the MMC framework -- requests 50MHz -- -- sdio_overclock SDIO Clock (in MHz) to use when the MMC -+Params: sdio_overclock SDIO Clock (in MHz) to use when the MMC - framework requests 50MHz - -- force_pio Disable DMA support (default off) -- -- pio_limit Number of blocks above which to use DMA -- (default 1) -- -- debug Enable debug output (default off) -- - poll_once Disable SDIO-device polling every second - (default on: polling once at boot-time) - - -From ff8eb5db8fe34b633f86f6c33314e88dc5837231 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Tue, 27 Jun 2017 15:07:14 +0100 -Subject: [PATCH 172/201] SQUASH: mmc: Apply ERASE_BROKEN quirks correctly - -Squash with: mmc: Add MMC_QUIRK_ERASE_BROKEN for some cards - -Signed-off-by: Phil Elwell ---- - drivers/mmc/core/quirks.h | 9 +++------ - 1 file changed, 3 insertions(+), 6 deletions(-) - -diff --git a/drivers/mmc/core/quirks.h b/drivers/mmc/core/quirks.h -index 05c8d7381fff5ae88531129d9a5ddd554bddb43e..c9d5d644688c1509d7febcff0322fbaba0a842d6 100644 ---- a/drivers/mmc/core/quirks.h -+++ b/drivers/mmc/core/quirks.h -@@ -94,12 +94,9 @@ static const struct mmc_fixup mmc_blk_fixups[] = { - * On some Kingston SD cards, multiple erases of less than 64 - * sectors can cause corruption. - */ -- MMC_FIXUP("SD16G", 0x41, 0x3432, add_quirk_mmc, -- MMC_QUIRK_ERASE_BROKEN), -- MMC_FIXUP("SD32G", 0x41, 0x3432, add_quirk_mmc, -- MMC_QUIRK_ERASE_BROKEN), -- MMC_FIXUP("SD64G", 0x41, 0x3432, add_quirk_mmc, -- MMC_QUIRK_ERASE_BROKEN), -+ MMC_FIXUP("SD16G", 0x41, 0x3432, add_quirk, MMC_QUIRK_ERASE_BROKEN), -+ MMC_FIXUP("SD32G", 0x41, 0x3432, add_quirk, MMC_QUIRK_ERASE_BROKEN), -+ MMC_FIXUP("SD64G", 0x41, 0x3432, add_quirk, MMC_QUIRK_ERASE_BROKEN), - - END_FIXUP - }; - -From 00b2ccad16bcc8f431ad46c8081a8ba0f3797b46 Mon Sep 17 00:00:00 2001 -From: Matthias Reichl -Date: Sun, 7 May 2017 11:34:26 +0200 -Subject: [PATCH 173/201] 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 -the driver is limited to 2-channel operations only TDM setups -with exactly 2 active slots are supported. - -Logical TDM slot numbering follows the usual convention: - -For I2S-like modes, with a 50% duty-cycle frame clock, -slots 0, 2, ... are transmitted in the first half of a frame, -slots 1, 3, ... are transmitted in the second half. - -For DSP modes slot numbering is ascending: 0, 1, 2, 3, ... - -Channel position calculation has been refactored to use -TDM info and moved out of hw_params. - -set_tdm_slot, set_bclk_ratio and hw_params now check more -strictly if the configuration is valid. Illegal configurations -like odd number of slots in I2S mode, data lengths exceeding -slot width or frame sizes larger than the hardware limit of -1024 are rejected. Also hw_params now properly checks for -errors from clk_set_rate. - -Allowed PCM formats are already guarded by stream constraints, -thus the formats check in hw_params has been removed and -data_length is now retrieved via params_width(). - -Also standard functions like snd_soc_params_to_bclk are now -being used instead of manual calculations to make the code -more readable. - -Special care has been taken to ensure that set_bclk_ratio works -as before. The bclk ratio is mapped to a 2-channel TDM config -with a slot width of half the ratio. In order to support odd ratios, -which can't be expressed via a TDM config, the ratio (frame length) -is stored and used by hw_params. - -Signed-off-by: Matthias Reichl ---- - sound/soc/bcm/bcm2835-i2s.c | 243 ++++++++++++++++++++++++++++++++++---------- - 1 file changed, 190 insertions(+), 53 deletions(-) - -diff --git a/sound/soc/bcm/bcm2835-i2s.c b/sound/soc/bcm/bcm2835-i2s.c -index 56df7d8a43d0aac055a91b0d24aca8e1b4e308e4..dcacf7f83c9371df539a788ea33fedcf97d64690 100644 ---- a/sound/soc/bcm/bcm2835-i2s.c -+++ b/sound/soc/bcm/bcm2835-i2s.c -@@ -31,6 +31,7 @@ - * General Public License for more details. - */ - -+#include - #include - #include - #include -@@ -99,6 +100,8 @@ - #define BCM2835_I2S_CHWID(v) (v) - #define BCM2835_I2S_CH1(v) ((v) << 16) - #define BCM2835_I2S_CH2(v) (v) -+#define BCM2835_I2S_CH1_POS(v) BCM2835_I2S_CH1(BCM2835_I2S_CHPOS(v)) -+#define BCM2835_I2S_CH2_POS(v) BCM2835_I2S_CH2(BCM2835_I2S_CHPOS(v)) - - #define BCM2835_I2S_TX_PANIC(v) ((v) << 24) - #define BCM2835_I2S_RX_PANIC(v) ((v) << 16) -@@ -110,12 +113,19 @@ - #define BCM2835_I2S_INT_RXR BIT(1) - #define BCM2835_I2S_INT_TXW BIT(0) - -+/* Frame length register is 10 bit, maximum length 1024 */ -+#define BCM2835_I2S_MAX_FRAME_LENGTH 1024 -+ - /* General device struct */ - struct bcm2835_i2s_dev { - struct device *dev; - struct snd_dmaengine_dai_dma_data dma_data[2]; - unsigned int fmt; -- unsigned int bclk_ratio; -+ unsigned int tdm_slots; -+ unsigned int rx_mask; -+ unsigned int tx_mask; -+ unsigned int slot_width; -+ unsigned int frame_length; - - struct regmap *i2s_regmap; - struct clk *clk; -@@ -225,19 +235,117 @@ static int bcm2835_i2s_set_dai_bclk_ratio(struct snd_soc_dai *dai, - unsigned int ratio) - { - struct bcm2835_i2s_dev *dev = snd_soc_dai_get_drvdata(dai); -- dev->bclk_ratio = ratio; -+ -+ if (!ratio) { -+ dev->tdm_slots = 0; -+ return 0; -+ } -+ -+ if (ratio > BCM2835_I2S_MAX_FRAME_LENGTH) -+ return -EINVAL; -+ -+ dev->tdm_slots = 2; -+ dev->rx_mask = 0x03; -+ dev->tx_mask = 0x03; -+ dev->slot_width = ratio / 2; -+ dev->frame_length = ratio; -+ -+ return 0; -+} -+ -+static int bcm2835_i2s_set_dai_tdm_slot(struct snd_soc_dai *dai, -+ unsigned int tx_mask, unsigned int rx_mask, -+ int slots, int width) -+{ -+ struct bcm2835_i2s_dev *dev = snd_soc_dai_get_drvdata(dai); -+ -+ if (slots) { -+ if (slots < 0 || width < 0) -+ return -EINVAL; -+ -+ /* Limit masks to available slots */ -+ rx_mask &= GENMASK(slots - 1, 0); -+ tx_mask &= GENMASK(slots - 1, 0); -+ -+ /* -+ * The driver is limited to 2-channel setups. -+ * Check that exactly 2 bits are set in the masks. -+ */ -+ if (hweight_long((unsigned long) rx_mask) != 2 -+ || hweight_long((unsigned long) tx_mask) != 2) -+ return -EINVAL; -+ -+ if (slots * width > BCM2835_I2S_MAX_FRAME_LENGTH) -+ return -EINVAL; -+ } -+ -+ dev->tdm_slots = slots; -+ -+ dev->rx_mask = rx_mask; -+ dev->tx_mask = tx_mask; -+ dev->slot_width = width; -+ dev->frame_length = slots * width; -+ - return 0; - } - -+/* -+ * Convert logical slot number into physical slot number. -+ * -+ * If odd_offset is 0 sequential number is identical to logical number. -+ * This is used for DSP modes with slot numbering 0 1 2 3 ... -+ * -+ * Otherwise odd_offset defines the physical offset for odd numbered -+ * slots. This is used for I2S and left/right justified modes to -+ * translate from logical slot numbers 0 1 2 3 ... into physical slot -+ * numbers 0 2 ... 3 4 ... -+ */ -+static int bcm2835_i2s_convert_slot(unsigned int slot, unsigned int odd_offset) -+{ -+ if (!odd_offset) -+ return slot; -+ -+ if (slot & 1) -+ return (slot >> 1) + odd_offset; -+ -+ return slot >> 1; -+} -+ -+/* -+ * Calculate channel position from mask and slot width. -+ * -+ * Mask must contain exactly 2 set bits. -+ * Lowest set bit is channel 1 position, highest set bit channel 2. -+ * The constant offset is added to both channel positions. -+ * -+ * If odd_offset is > 0 slot positions are translated to -+ * I2S-style TDM slot numbering ( 0 2 ... 3 4 ...) with odd -+ * logical slot numbers starting at physical slot odd_offset. -+ */ -+static void bcm2835_i2s_calc_channel_pos( -+ unsigned int *ch1_pos, unsigned int *ch2_pos, -+ unsigned int mask, unsigned int width, -+ unsigned int bit_offset, unsigned int odd_offset) -+{ -+ *ch1_pos = bcm2835_i2s_convert_slot((ffs(mask) - 1), odd_offset) -+ * width + bit_offset; -+ *ch2_pos = bcm2835_i2s_convert_slot((fls(mask) - 1), odd_offset) -+ * width + bit_offset; -+} -+ - static int bcm2835_i2s_hw_params(struct snd_pcm_substream *substream, - struct snd_pcm_hw_params *params, - struct snd_soc_dai *dai) - { - struct bcm2835_i2s_dev *dev = snd_soc_dai_get_drvdata(dai); -- unsigned int sampling_rate = params_rate(params); -- unsigned int data_length, data_delay, bclk_ratio; -- unsigned int ch1pos, ch2pos, mode, format; -+ unsigned int data_length, data_delay, framesync_length; -+ unsigned int slots, slot_width, odd_slot_offset; -+ int frame_length, bclk_rate; -+ unsigned int rx_mask, tx_mask; -+ unsigned int rx_ch1_pos, rx_ch2_pos, tx_ch1_pos, tx_ch2_pos; -+ unsigned int mode, format; - uint32_t csreg; -+ int ret = 0; - - /* - * If a stream is already enabled, -@@ -248,39 +356,44 @@ static int bcm2835_i2s_hw_params(struct snd_pcm_substream *substream, - if (csreg & (BCM2835_I2S_TXON | BCM2835_I2S_RXON)) - return 0; - -- /* -- * Adjust the data length according to the format. -- * We prefill the half frame length with an integer -- * divider of 2400 as explained at the clock settings. -- * Maybe it is overwritten there, if the Integer mode -- * does not apply. -- */ -- switch (params_format(params)) { -- case SNDRV_PCM_FORMAT_S16_LE: -- data_length = 16; -- break; -- case SNDRV_PCM_FORMAT_S24_LE: -- data_length = 24; -- break; -- case SNDRV_PCM_FORMAT_S32_LE: -- data_length = 32; -- break; -- default: -- return -EINVAL; -+ data_length = params_width(params); -+ data_delay = 0; -+ odd_slot_offset = 0; -+ mode = 0; -+ -+ if (dev->tdm_slots) { -+ slots = dev->tdm_slots; -+ slot_width = dev->slot_width; -+ frame_length = dev->frame_length; -+ rx_mask = dev->rx_mask; -+ tx_mask = dev->tx_mask; -+ bclk_rate = dev->frame_length * params_rate(params); -+ } else { -+ slots = 2; -+ slot_width = params_width(params); -+ rx_mask = 0x03; -+ tx_mask = 0x03; -+ -+ frame_length = snd_soc_params_to_frame_size(params); -+ if (frame_length < 0) -+ return frame_length; -+ -+ bclk_rate = snd_soc_params_to_bclk(params); -+ if (bclk_rate < 0) -+ return bclk_rate; - } - -- /* If bclk_ratio already set, use that one. */ -- if (dev->bclk_ratio) -- bclk_ratio = dev->bclk_ratio; -- else -- /* otherwise calculate a fitting block ratio */ -- bclk_ratio = 2 * data_length; -+ /* Check if data fits into slots */ -+ if (data_length > slot_width) -+ return -EINVAL; - - /* Clock should only be set up here if CPU is clock master */ - switch (dev->fmt & SND_SOC_DAIFMT_MASTER_MASK) { - case SND_SOC_DAIFMT_CBS_CFS: - case SND_SOC_DAIFMT_CBS_CFM: -- clk_set_rate(dev->clk, sampling_rate * bclk_ratio); -+ ret = clk_set_rate(dev->clk, bclk_rate); -+ if (ret) -+ return ret; - break; - default: - break; -@@ -294,9 +407,26 @@ static int bcm2835_i2s_hw_params(struct snd_pcm_substream *substream, - - format |= BCM2835_I2S_CHWID((data_length-8)&0xf); - -+ /* CH2 format is the same as for CH1 */ -+ format = BCM2835_I2S_CH1(format) | BCM2835_I2S_CH2(format); -+ - switch (dev->fmt & SND_SOC_DAIFMT_FORMAT_MASK) { - case SND_SOC_DAIFMT_I2S: -+ /* I2S mode needs an even number of slots */ -+ if (slots & 1) -+ return -EINVAL; -+ -+ /* -+ * Use I2S-style logical slot numbering: even slots -+ * are in first half of frame, odd slots in second half. -+ */ -+ odd_slot_offset = slots >> 1; -+ -+ /* MSB starts one cycle after frame start */ - data_delay = 1; -+ -+ /* Setup frame sync signal for 50% duty cycle */ -+ framesync_length = frame_length / 2; - break; - default: - /* -@@ -307,19 +437,10 @@ static int bcm2835_i2s_hw_params(struct snd_pcm_substream *substream, - return -EINVAL; - } - -- ch1pos = data_delay; -- ch2pos = bclk_ratio / 2 + data_delay; -- -- switch (params_channels(params)) { -- case 2: -- case 8: -- format = BCM2835_I2S_CH1(format) | BCM2835_I2S_CH2(format); -- format |= BCM2835_I2S_CH1(BCM2835_I2S_CHPOS(ch1pos)); -- format |= BCM2835_I2S_CH2(BCM2835_I2S_CHPOS(ch2pos)); -- break; -- default: -- return -EINVAL; -- } -+ bcm2835_i2s_calc_channel_pos(&rx_ch1_pos, &rx_ch2_pos, -+ rx_mask, slot_width, data_delay, odd_slot_offset); -+ bcm2835_i2s_calc_channel_pos(&tx_ch1_pos, &tx_ch2_pos, -+ tx_mask, slot_width, data_delay, odd_slot_offset); - - /* - * Set format for both streams. -@@ -327,11 +448,16 @@ static int bcm2835_i2s_hw_params(struct snd_pcm_substream *substream, - * (and therefore word length) anyway, - * so the format will be the same. - */ -- regmap_write(dev->i2s_regmap, BCM2835_I2S_RXC_A_REG, format); -- regmap_write(dev->i2s_regmap, BCM2835_I2S_TXC_A_REG, format); -+ regmap_write(dev->i2s_regmap, BCM2835_I2S_RXC_A_REG, -+ format -+ | BCM2835_I2S_CH1_POS(rx_ch1_pos) -+ | BCM2835_I2S_CH2_POS(rx_ch2_pos)); -+ regmap_write(dev->i2s_regmap, BCM2835_I2S_TXC_A_REG, -+ format -+ | BCM2835_I2S_CH1_POS(tx_ch1_pos) -+ | BCM2835_I2S_CH2_POS(tx_ch2_pos)); - - /* Setup the I2S mode */ -- mode = 0; - - if (data_length <= 16) { - /* -@@ -343,8 +469,8 @@ static int bcm2835_i2s_hw_params(struct snd_pcm_substream *substream, - mode |= BCM2835_I2S_FTXP | BCM2835_I2S_FRXP; - } - -- mode |= BCM2835_I2S_FLEN(bclk_ratio - 1); -- mode |= BCM2835_I2S_FSLEN(bclk_ratio / 2); -+ mode |= BCM2835_I2S_FLEN(frame_length - 1); -+ mode |= BCM2835_I2S_FSLEN(framesync_length); - - /* Master or slave? */ - switch (dev->fmt & SND_SOC_DAIFMT_MASTER_MASK) { -@@ -424,7 +550,20 @@ static int bcm2835_i2s_hw_params(struct snd_pcm_substream *substream, - /* Clear FIFOs */ - bcm2835_i2s_clear_fifos(dev, true, true); - -- return 0; -+ dev_dbg(dev->dev, -+ "slots: %d width: %d rx mask: 0x%02x tx_mask: 0x%02x\n", -+ slots, slot_width, rx_mask, tx_mask); -+ -+ dev_dbg(dev->dev, "frame len: %d sync len: %d data len: %d\n", -+ frame_length, framesync_length, data_length); -+ -+ dev_dbg(dev->dev, "rx pos: %d,%d tx pos: %d,%d\n", -+ rx_ch1_pos, rx_ch2_pos, tx_ch1_pos, tx_ch2_pos); -+ -+ dev_dbg(dev->dev, "sampling rate: %d bclk rate: %d\n", -+ params_rate(params), bclk_rate); -+ -+ return ret; - } - - static int bcm2835_i2s_prepare(struct snd_pcm_substream *substream, -@@ -560,6 +699,7 @@ static const struct snd_soc_dai_ops bcm2835_i2s_dai_ops = { - .hw_params = bcm2835_i2s_hw_params, - .set_fmt = bcm2835_i2s_set_dai_fmt, - .set_bclk_ratio = bcm2835_i2s_set_dai_bclk_ratio, -+ .set_tdm_slot = bcm2835_i2s_set_dai_tdm_slot, - }; - - static int bcm2835_i2s_dai_probe(struct snd_soc_dai *dai) -@@ -700,9 +840,6 @@ static int bcm2835_i2s_probe(struct platform_device *pdev) - dev->dma_data[SNDRV_PCM_STREAM_CAPTURE].flags = - SND_DMAENGINE_PCM_DAI_FLAG_PACK; - -- /* BCLK ratio - use default */ -- dev->bclk_ratio = 0; -- - /* Store the pdev */ - dev->dev = &pdev->dev; - dev_set_drvdata(&pdev->dev, dev); - -From 9727ae73a76c71518c9a9c75a1c8ba6303336e63 Mon Sep 17 00:00:00 2001 -From: Matthias Reichl -Date: Sun, 7 May 2017 15:30:50 +0200 -Subject: [PATCH 174/201] ASoC: bcm2835: Support left/right justified and DSP - modes - -DSP modes and left/right justified modes can be supported -on bcm2835 by configuring the frame sync polarity and -frame sync length registers and by adjusting the -channel data position registers. - -Clock and frame sync polarity handling in hw_params has -been refactored to make the interaction between logical -rising/falling edge frame start and physical configuration -(changed by normal/inverted polarity modes) clearer. - -Modes where the first active data bit is transmitted immediately -after frame start (eg DSP mode B with slot 0 active) -only work reliable if bcm2835 is configured as frame master. -In frame slave mode channel swap (or shift, this isn't quite -clear yet) can occur. - -Currently the driver only warns if an unstable configuration -is detected but doensn't prevent using them. - -Signed-off-by: Matthias Reichl ---- - sound/soc/bcm/bcm2835-i2s.c | 152 +++++++++++++++++++++++++++++--------------- - 1 file changed, 99 insertions(+), 53 deletions(-) - -diff --git a/sound/soc/bcm/bcm2835-i2s.c b/sound/soc/bcm/bcm2835-i2s.c -index dcacf7f83c9371df539a788ea33fedcf97d64690..3a706fda4f39e42efbe12f19d87af9b100a348a5 100644 ---- a/sound/soc/bcm/bcm2835-i2s.c -+++ b/sound/soc/bcm/bcm2835-i2s.c -@@ -344,6 +344,9 @@ static int bcm2835_i2s_hw_params(struct snd_pcm_substream *substream, - unsigned int rx_mask, tx_mask; - unsigned int rx_ch1_pos, rx_ch2_pos, tx_ch1_pos, tx_ch2_pos; - unsigned int mode, format; -+ bool bit_clock_master = false; -+ bool frame_sync_master = false; -+ bool frame_start_falling_edge = false; - uint32_t csreg; - int ret = 0; - -@@ -387,16 +390,39 @@ static int bcm2835_i2s_hw_params(struct snd_pcm_substream *substream, - if (data_length > slot_width) - return -EINVAL; - -- /* Clock should only be set up here if CPU is clock master */ -+ /* Check if CPU is bit clock master */ - switch (dev->fmt & SND_SOC_DAIFMT_MASTER_MASK) { - case SND_SOC_DAIFMT_CBS_CFS: - case SND_SOC_DAIFMT_CBS_CFM: -- ret = clk_set_rate(dev->clk, bclk_rate); -- if (ret) -- return ret; -+ bit_clock_master = true; -+ break; -+ case SND_SOC_DAIFMT_CBM_CFS: -+ case SND_SOC_DAIFMT_CBM_CFM: -+ bit_clock_master = false; - break; - default: -+ return -EINVAL; -+ } -+ -+ /* Check if CPU is frame sync master */ -+ switch (dev->fmt & SND_SOC_DAIFMT_MASTER_MASK) { -+ case SND_SOC_DAIFMT_CBS_CFS: -+ case SND_SOC_DAIFMT_CBM_CFS: -+ frame_sync_master = true; -+ break; -+ case SND_SOC_DAIFMT_CBS_CFM: -+ case SND_SOC_DAIFMT_CBM_CFM: -+ frame_sync_master = false; - break; -+ default: -+ return -EINVAL; -+ } -+ -+ /* Clock should only be set up here if CPU is clock master */ -+ if (bit_clock_master) { -+ ret = clk_set_rate(dev->clk, bclk_rate); -+ if (ret) -+ return ret; - } - - /* Setup the frame format */ -@@ -427,13 +453,41 @@ static int bcm2835_i2s_hw_params(struct snd_pcm_substream *substream, - - /* Setup frame sync signal for 50% duty cycle */ - framesync_length = frame_length / 2; -+ frame_start_falling_edge = true; -+ break; -+ case SND_SOC_DAIFMT_LEFT_J: -+ if (slots & 1) -+ return -EINVAL; -+ -+ odd_slot_offset = slots >> 1; -+ data_delay = 0; -+ framesync_length = frame_length / 2; -+ frame_start_falling_edge = false; -+ break; -+ case SND_SOC_DAIFMT_RIGHT_J: -+ if (slots & 1) -+ return -EINVAL; -+ -+ /* Odd frame lengths aren't supported */ -+ if (frame_length & 1) -+ return -EINVAL; -+ -+ odd_slot_offset = slots >> 1; -+ data_delay = slot_width - data_length; -+ framesync_length = frame_length / 2; -+ frame_start_falling_edge = false; -+ break; -+ case SND_SOC_DAIFMT_DSP_A: -+ data_delay = 1; -+ framesync_length = 1; -+ frame_start_falling_edge = false; -+ break; -+ case SND_SOC_DAIFMT_DSP_B: -+ data_delay = 0; -+ framesync_length = 1; -+ frame_start_falling_edge = false; - break; - default: -- /* -- * TODO -- * Others are possible but are not implemented at the moment. -- */ -- dev_err(dev->dev, "%s:bad format\n", __func__); - return -EINVAL; - } - -@@ -443,6 +497,15 @@ static int bcm2835_i2s_hw_params(struct snd_pcm_substream *substream, - tx_mask, slot_width, data_delay, odd_slot_offset); - - /* -+ * Transmitting data immediately after frame start, eg -+ * in left-justified or DSP mode A, only works stable -+ * if bcm2835 is the frame clock master. -+ */ -+ if ((!rx_ch1_pos || !tx_ch1_pos) && !frame_sync_master) -+ dev_warn(dev->dev, -+ "Unstable slave config detected, L/R may be swapped"); -+ -+ /* - * Set format for both streams. - * We cannot set another frame length - * (and therefore word length) anyway, -@@ -472,62 +535,38 @@ static int bcm2835_i2s_hw_params(struct snd_pcm_substream *substream, - mode |= BCM2835_I2S_FLEN(frame_length - 1); - mode |= BCM2835_I2S_FSLEN(framesync_length); - -- /* Master or slave? */ -- switch (dev->fmt & SND_SOC_DAIFMT_MASTER_MASK) { -- case SND_SOC_DAIFMT_CBS_CFS: -- /* CPU is master */ -- break; -- case SND_SOC_DAIFMT_CBM_CFS: -- /* -- * CODEC is bit clock master -- * CPU is frame master -- */ -+ /* CLKM selects bcm2835 clock slave mode */ -+ if (!bit_clock_master) - mode |= BCM2835_I2S_CLKM; -- break; -- case SND_SOC_DAIFMT_CBS_CFM: -- /* -- * CODEC is frame master -- * CPU is bit clock master -- */ -+ -+ /* FSM selects bcm2835 frame sync slave mode */ -+ if (!frame_sync_master) - mode |= BCM2835_I2S_FSM; -+ -+ /* CLKI selects normal clocking mode, sampling on rising edge */ -+ switch (dev->fmt & SND_SOC_DAIFMT_INV_MASK) { -+ case SND_SOC_DAIFMT_NB_NF: -+ case SND_SOC_DAIFMT_NB_IF: -+ mode |= BCM2835_I2S_CLKI; - break; -- case SND_SOC_DAIFMT_CBM_CFM: -- /* CODEC is master */ -- mode |= BCM2835_I2S_CLKM; -- mode |= BCM2835_I2S_FSM; -+ case SND_SOC_DAIFMT_IB_NF: -+ case SND_SOC_DAIFMT_IB_IF: - break; - default: -- dev_err(dev->dev, "%s:bad master\n", __func__); - return -EINVAL; - } - -- /* -- * Invert clocks? -- * -- * The BCM approach seems to be inverted to the classical I2S approach. -- */ -+ /* FSI selects frame start on falling edge */ - switch (dev->fmt & SND_SOC_DAIFMT_INV_MASK) { - case SND_SOC_DAIFMT_NB_NF: -- /* None. Therefore, both for BCM */ -- mode |= BCM2835_I2S_CLKI; -- mode |= BCM2835_I2S_FSI; -- break; -- case SND_SOC_DAIFMT_IB_IF: -- /* Both. Therefore, none for BCM */ -+ case SND_SOC_DAIFMT_IB_NF: -+ if (frame_start_falling_edge) -+ mode |= BCM2835_I2S_FSI; - break; - case SND_SOC_DAIFMT_NB_IF: -- /* -- * Invert only frame sync. Therefore, -- * invert only bit clock for BCM -- */ -- mode |= BCM2835_I2S_CLKI; -- break; -- case SND_SOC_DAIFMT_IB_NF: -- /* -- * Invert only bit clock. Therefore, -- * invert only frame sync for BCM -- */ -- mode |= BCM2835_I2S_FSI; -+ case SND_SOC_DAIFMT_IB_IF: -+ if (!frame_start_falling_edge) -+ mode |= BCM2835_I2S_FSI; - break; - default: - return -EINVAL; -@@ -563,6 +602,13 @@ static int bcm2835_i2s_hw_params(struct snd_pcm_substream *substream, - dev_dbg(dev->dev, "sampling rate: %d bclk rate: %d\n", - params_rate(params), bclk_rate); - -+ dev_dbg(dev->dev, "CLKM: %d CLKI: %d FSM: %d FSI: %d frame start: %s edge\n", -+ !!(mode & BCM2835_I2S_CLKM), -+ !!(mode & BCM2835_I2S_CLKI), -+ !!(mode & BCM2835_I2S_FSM), -+ !!(mode & BCM2835_I2S_FSI), -+ (mode & BCM2835_I2S_FSI) ? "falling" : "rising"); -+ - return ret; - } - - -From cf8f3f15c57849d72e4ee38066158384eb50f228 Mon Sep 17 00:00:00 2001 -From: Matthias Reichl -Date: Sun, 7 May 2017 16:19:54 +0200 -Subject: [PATCH 175/201] ASoC: bcm2835: Support additional samplerates up to - 384kHz - -Sample rates are only restricted by the capabilities of the -clock driver, so use SNDRV_PCM_RATE_CONTINUOUS instead of -SNDRV_PCM_RATE_8000_192000. - -Tests (eg with pcm5122) have shown that bcm2835 works fine -in 384kHz/32bit stereo mode, so change the maximum allowed -rate from 192kHz to 384kHz. - -Signed-off-by: Matthias Reichl ---- - sound/soc/bcm/bcm2835-i2s.c | 8 ++++++-- - 1 file changed, 6 insertions(+), 2 deletions(-) - -diff --git a/sound/soc/bcm/bcm2835-i2s.c b/sound/soc/bcm/bcm2835-i2s.c -index 3a706fda4f39e42efbe12f19d87af9b100a348a5..43f5715a0d5dda851731ecf7ff27e76c48fb6e57 100644 ---- a/sound/soc/bcm/bcm2835-i2s.c -+++ b/sound/soc/bcm/bcm2835-i2s.c -@@ -765,7 +765,9 @@ static struct snd_soc_dai_driver bcm2835_i2s_dai = { - .playback = { - .channels_min = 2, - .channels_max = 2, -- .rates = SNDRV_PCM_RATE_8000_192000, -+ .rates = SNDRV_PCM_RATE_CONTINUOUS, -+ .rate_min = 8000, -+ .rate_max = 384000, - .formats = SNDRV_PCM_FMTBIT_S16_LE - | SNDRV_PCM_FMTBIT_S24_LE - | SNDRV_PCM_FMTBIT_S32_LE -@@ -773,7 +775,9 @@ static struct snd_soc_dai_driver bcm2835_i2s_dai = { - .capture = { - .channels_min = 2, - .channels_max = 2, -- .rates = SNDRV_PCM_RATE_8000_192000, -+ .rates = SNDRV_PCM_RATE_CONTINUOUS, -+ .rate_min = 8000, -+ .rate_max = 384000, - .formats = SNDRV_PCM_FMTBIT_S16_LE - | SNDRV_PCM_FMTBIT_S24_LE - | SNDRV_PCM_FMTBIT_S32_LE - -From ff48bac53c023d770f89dd8e222f47aff4784497 Mon Sep 17 00:00:00 2001 -From: Matthias Reichl -Date: Sun, 7 May 2017 16:24:57 +0200 -Subject: [PATCH 176/201] 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. - -Channel and rate symmetry are already enforced by constraints -but samplebits had been missed. - -As hw_params doesn't check for symmetry constraints by itself -and just returns success if a stream is running this led to -situations where asymmetric configurations were seeming to -succeed but of course didn't work because the hardware wasn't -configured at all. - -Fix this by adding the missing samplerate symmetry constraint. - -Signed-off-by: Matthias Reichl ---- - sound/soc/bcm/bcm2835-i2s.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/sound/soc/bcm/bcm2835-i2s.c b/sound/soc/bcm/bcm2835-i2s.c -index 43f5715a0d5dda851731ecf7ff27e76c48fb6e57..2e449d7173fcecbcd647f90a26bd58b6c421bcde 100644 ---- a/sound/soc/bcm/bcm2835-i2s.c -+++ b/sound/soc/bcm/bcm2835-i2s.c -@@ -783,7 +783,8 @@ static struct snd_soc_dai_driver bcm2835_i2s_dai = { - | SNDRV_PCM_FMTBIT_S32_LE - }, - .ops = &bcm2835_i2s_dai_ops, -- .symmetric_rates = 1 -+ .symmetric_rates = 1, -+ .symmetric_samplebits = 1, - }; - - static bool bcm2835_i2s_volatile_reg(struct device *dev, unsigned int reg) - -From e318701073f63aaa3693472bf7feed115d945fc1 Mon Sep 17 00:00:00 2001 -From: Matt Flax -Date: Tue, 4 Apr 2017 19:20:59 +1000 -Subject: [PATCH 177/201] Audioinjector : make the octo and pi sound cards have - different driver names - -This patch gives the audioinjector octo and pi soundcards different driver -names. This allows both the be loaded without clashing. ---- - sound/soc/bcm/audioinjector-octo-soundcard.c | 2 +- - sound/soc/bcm/audioinjector-pi-soundcard.c | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/sound/soc/bcm/audioinjector-octo-soundcard.c b/sound/soc/bcm/audioinjector-octo-soundcard.c -index dcf403ab37639ba79e38278d7e4b1ade452c292a..49115c8e20ce1a2ba5a99feb8983a1cafb052ca2 100644 ---- a/sound/soc/bcm/audioinjector-octo-soundcard.c -+++ b/sound/soc/bcm/audioinjector-octo-soundcard.c -@@ -324,7 +324,7 @@ MODULE_DEVICE_TABLE(of, audioinjector_octo_of_match); - - static struct platform_driver audioinjector_octo_driver = { - .driver = { -- .name = "audioinjector-audio", -+ .name = "audioinjector-octo", - .owner = THIS_MODULE, - .of_match_table = audioinjector_octo_of_match, - }, -diff --git a/sound/soc/bcm/audioinjector-pi-soundcard.c b/sound/soc/bcm/audioinjector-pi-soundcard.c -index ef54e0f07ea03f59e9957b5d98f3e7fdc998e469..491906bbf446826e55dd843f28e4860f48e908b8 100644 ---- a/sound/soc/bcm/audioinjector-pi-soundcard.c -+++ b/sound/soc/bcm/audioinjector-pi-soundcard.c -@@ -177,7 +177,7 @@ MODULE_DEVICE_TABLE(of, audioinjector_pi_soundcard_of_match); - - static struct platform_driver audioinjector_pi_soundcard_driver = { - .driver = { -- .name = "audioinjector-audio", -+ .name = "audioinjector-stereo", - .owner = THIS_MODULE, - .of_match_table = audioinjector_pi_soundcard_of_match, - }, - -From 69d40441ff93c9cc088525aa5aec20b9d49ee447 Mon Sep 17 00:00:00 2001 -From: Matt Flax -Date: Tue, 4 Apr 2017 19:23:04 +1000 -Subject: [PATCH 178/201] Audioinjector octo : Make the playback and capture - symmetric - -This patch ensures that the sample rate and channel count of the audioinjector -octo sound card are symmetric. ---- - sound/soc/bcm/audioinjector-octo-soundcard.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/sound/soc/bcm/audioinjector-octo-soundcard.c b/sound/soc/bcm/audioinjector-octo-soundcard.c -index 49115c8e20ce1a2ba5a99feb8983a1cafb052ca2..5e79f4eff93a21ed3495c77a90f73525695cb3d5 100644 ---- a/sound/soc/bcm/audioinjector-octo-soundcard.c -+++ b/sound/soc/bcm/audioinjector-octo-soundcard.c -@@ -204,6 +204,8 @@ static struct snd_soc_dai_link audioinjector_octo_dai[] = { - .codec_dai_name = "cs42448", - .ops = &audioinjector_octo_ops, - .init = audioinjector_octo_dai_init, -+ .symmetric_rates = 1, -+ .symmetric_channels = 1, - }, - }; - - -From edfeab6e5e0829ba68e530eb8049faf801fad7a0 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Sun, 23 Apr 2017 19:36:53 +0100 -Subject: [PATCH 179/201] BCM270X_DT: Add bme280 and bmp180 to i2c-sensor - overlay - -Signed-off-by: Phil Elwell ---- - arch/arm/boot/dts/overlays/README | 11 +++++++++-- - arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts | 15 +++++++++++++++ - 2 files changed, 24 insertions(+), 2 deletions(-) - -diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README -index 499cd1920fd373702cfbc9f6e0fcaebca8a47cfc..d32a31cbf4a4382ddfc1b38018ef3ff0ff445145 100644 ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -652,9 +652,16 @@ Name: i2c-sensor - Info: Adds support for a number of I2C barometric pressure and temperature - sensors on i2c_arm - Load: dtoverlay=i2c-sensor,= --Params: bmp085 Select the Bosch sensortronic BMP085 -+Params: addr Set the address for the BME280 and BMP280 (0x76 -+ or 0x77 - default 0x76) - -- bmp280 Select the Bosch sensortronic BMP280 -+ bme280 Select the Bosch Sensortronic BME280 -+ -+ bmp085 Select the Bosch Sensortronic BMP085 -+ -+ bmp180 Select the Bosch Sensortronic BMP180 -+ -+ bmp280 Select the Bosch Sensortronic BMP280 - - lm75 Select the Maxim LM75 temperature sensor - -diff --git a/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts b/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts -index 606b2d5012abf2e85712be631c42ea40a0b512c5..e23e34b32a0a8927c14203d7384e800878627347 100644 ---- a/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts -+++ b/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts -@@ -12,6 +12,12 @@ - #size-cells = <0>; - status = "okay"; - -+ bme280: bme280@76 { -+ compatible = "bosch,bme280"; -+ reg = <0x76>; -+ status = "disable"; -+ }; -+ - bmp085: bmp085@77 { - compatible = "bosch,bmp085"; - reg = <0x77>; -@@ -19,6 +25,12 @@ - status = "disable"; - }; - -+ bmp180: bmp180@77 { -+ compatible = "bosch,bmp180"; -+ reg = <0x77>; -+ status = "disable"; -+ }; -+ - bmp280: bmp280@76 { - compatible = "bosch,bmp280"; - reg = <0x76>; -@@ -40,7 +52,10 @@ - }; - - __overrides__ { -+ addr = <&bme280>,"reg:0", <&bmp280>,"reg:0"; -+ bme280 = <&bme280>,"status"; - bmp085 = <&bmp085>,"status"; -+ bmp180 = <&bmp180>,"status"; - bmp280 = <&bmp280>,"status"; - lm75 = <&lm75>,"status"; - lm75addr = <&lm75>,"reg:0"; - -From 820cb0286894002c632240c6f8932c2e4836ee02 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Sun, 23 Apr 2017 19:38:06 +0100 -Subject: [PATCH 180/201] config: Add CONFIG_BMP280 (and CONFIG_BMP280_I2C) - -Signed-off-by: Phil Elwell ---- - arch/arm/configs/bcm2709_defconfig | 5 +++-- - arch/arm/configs/bcmrpi_defconfig | 5 +++-- - 2 files changed, 6 insertions(+), 4 deletions(-) - -diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig -index b59062ce3d980c8b2612722c9d1b7ccc2dab4c7d..e87018cc9aa7d431914dc38d3d3615fa09b81b7e 100644 ---- a/arch/arm/configs/bcm2709_defconfig -+++ b/arch/arm/configs/bcm2709_defconfig -@@ -867,6 +867,7 @@ CONFIG_SND_USB_CAIAQ_INPUT=y - CONFIG_SND_USB_6FIRE=m - CONFIG_SND_SOC=m - CONFIG_SND_BCM2835_SOC_I2S=m -+CONFIG_SND_BCM2708_SOC_GOOGLEVOICEHAT_SOUNDCARD=m - CONFIG_SND_BCM2708_SOC_HIFIBERRY_DAC=m - CONFIG_SND_BCM2708_SOC_HIFIBERRY_DACPLUS=m - CONFIG_SND_BCM2708_SOC_HIFIBERRY_DIGI=m -@@ -880,16 +881,15 @@ CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m - CONFIG_SND_BCM2708_SOC_IQAUDIO_DIGI=m - CONFIG_SND_BCM2708_SOC_RASPIDAC3=m - CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m --CONFIG_SND_BCM2708_SOC_GOOGLEVOICEHAT_SOUNDCARD=m - CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m - CONFIG_SND_AUDIOINJECTOR_OCTO_SOUNDCARD=m - CONFIG_SND_DIGIDAC1_SOUNDCARD=m - CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO=m - CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO_V2=m --CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC=m - CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC=m - CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS=m - CONFIG_SND_BCM2708_SOC_FE_PI_AUDIO=m -+CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC=m - CONFIG_SND_PISOUND=m - CONFIG_SND_SOC_ADAU1701=m - CONFIG_SND_SOC_ADAU7002=m -@@ -1169,6 +1169,7 @@ CONFIG_MCP320X=m - CONFIG_MCP3422=m - CONFIG_DHT11=m - CONFIG_HTU21=m -+CONFIG_BMP280=m - CONFIG_PWM_BCM2835=m - CONFIG_PWM_PCA9685=m - CONFIG_RASPBERRYPI_FIRMWARE=y -diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index 42163e2c0b5d5666d49793ac4e074d22cc59c286..00a1a4e43ddd9ffe6a119b5a89ecd28f4eac7f6f 100644 ---- a/arch/arm/configs/bcmrpi_defconfig -+++ b/arch/arm/configs/bcmrpi_defconfig -@@ -861,6 +861,7 @@ CONFIG_SND_USB_CAIAQ_INPUT=y - CONFIG_SND_USB_6FIRE=m - CONFIG_SND_SOC=m - CONFIG_SND_BCM2835_SOC_I2S=m -+CONFIG_SND_BCM2708_SOC_GOOGLEVOICEHAT_SOUNDCARD=m - CONFIG_SND_BCM2708_SOC_HIFIBERRY_DAC=m - CONFIG_SND_BCM2708_SOC_HIFIBERRY_DACPLUS=m - CONFIG_SND_BCM2708_SOC_HIFIBERRY_DIGI=m -@@ -874,16 +875,15 @@ CONFIG_SND_BCM2708_SOC_IQAUDIO_DAC=m - CONFIG_SND_BCM2708_SOC_IQAUDIO_DIGI=m - CONFIG_SND_BCM2708_SOC_RASPIDAC3=m - CONFIG_SND_BCM2708_SOC_ADAU1977_ADC=m --CONFIG_SND_BCM2708_SOC_GOOGLEVOICEHAT_SOUNDCARD=m - CONFIG_SND_AUDIOINJECTOR_PI_SOUNDCARD=m - CONFIG_SND_AUDIOINJECTOR_OCTO_SOUNDCARD=m - CONFIG_SND_DIGIDAC1_SOUNDCARD=m - CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO=m - CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO_V2=m --CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC=m - CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC=m - CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS=m - CONFIG_SND_BCM2708_SOC_FE_PI_AUDIO=m -+CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC=m - CONFIG_SND_PISOUND=m - CONFIG_SND_SOC_ADAU1701=m - CONFIG_SND_SOC_ADAU7002=m -@@ -1176,6 +1176,7 @@ CONFIG_MCP320X=m - CONFIG_MCP3422=m - CONFIG_DHT11=m - CONFIG_HTU21=m -+CONFIG_BMP280=m - CONFIG_PWM_BCM2835=m - CONFIG_PWM_PCA9685=m - CONFIG_RASPBERRYPI_FIRMWARE=y - -From cb46efcfc41e7add97c9aaad427e131992ce86f5 Mon Sep 17 00:00:00 2001 -From: Scott Ellis -Date: Tue, 25 Apr 2017 10:46:09 -0400 -Subject: [PATCH 181/201] config: Enable TI TMP102 temp sensor module - -Signed-off-by: Scott Ellis ---- - 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 e87018cc9aa7d431914dc38d3d3615fa09b81b7e..c22f2f31ad07a7887c06660f21ebfb1eddf0a8fd 100644 ---- a/arch/arm/configs/bcm2709_defconfig -+++ b/arch/arm/configs/bcm2709_defconfig -@@ -656,6 +656,7 @@ CONFIG_SENSORS_SHT21=m - CONFIG_SENSORS_SHTC1=m - CONFIG_SENSORS_ADS1015=m - CONFIG_SENSORS_INA2XX=m -+CONFIG_SENSORS_TMP102=m - CONFIG_THERMAL=y - CONFIG_THERMAL_BCM2835=y - CONFIG_WATCHDOG=y -diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index 00a1a4e43ddd9ffe6a119b5a89ecd28f4eac7f6f..388d0bd8ce36c2028813e7080421f34ab7d7958c 100644 ---- a/arch/arm/configs/bcmrpi_defconfig -+++ b/arch/arm/configs/bcmrpi_defconfig -@@ -650,6 +650,7 @@ CONFIG_SENSORS_SHT21=m - CONFIG_SENSORS_SHTC1=m - CONFIG_SENSORS_ADS1015=m - CONFIG_SENSORS_INA2XX=m -+CONFIG_SENSORS_TMP102=m - CONFIG_THERMAL=y - CONFIG_THERMAL_BCM2835=y - CONFIG_WATCHDOG=y - -From 79d5926d829264a083ce80d73db9cdeabba5fb32 Mon Sep 17 00:00:00 2001 -From: Scott Ellis -Date: Tue, 25 Apr 2017 13:05:42 -0400 -Subject: [PATCH 182/201] BCM270X_DT: Add tmp102 to i2c sensor overlay - -Signed-off-by: Scott Ellis ---- - arch/arm/boot/dts/overlays/README | 9 +++++++-- - arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts | 11 +++++++++-- - 2 files changed, 16 insertions(+), 4 deletions(-) - -diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README -index d32a31cbf4a4382ddfc1b38018ef3ff0ff445145..4171208933e675a5a3a7e17f8b15447f30a11887 100644 ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -652,16 +652,18 @@ 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 and BMP280 (0x76 -- or 0x77 - default 0x76) -+Params: addr Set the address for the BME280, BMP280 or -+ TMP102 - - bme280 Select the Bosch Sensortronic BME280 -+ Valid addresses 0x76-0x77, default 0x76 - - bmp085 Select the Bosch Sensortronic BMP085 - - bmp180 Select the Bosch Sensortronic BMP180 - - bmp280 Select the Bosch Sensortronic BMP280 -+ Valid addresses 0x76-0x77, default 0x76 - - lm75 Select the Maxim LM75 temperature sensor - -@@ -671,6 +673,9 @@ Params: addr Set the address for the BME280 and BMP280 (0x76 - si7020 Select the Silicon Labs Si7013/20/21 humidity/ - temperature sensor - -+ tmp102 Select the Texas Instruments TMP102 temp sensor -+ Valid addresses 0x48-0x4b, default 0x48 -+ - - 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 e23e34b32a0a8927c14203d7384e800878627347..e86a13f92c3f75c14fa4425cdfb081d6795ff76a 100644 ---- a/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts -+++ b/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts -@@ -1,4 +1,4 @@ --// Definitions for I2C based sensors using the Industrial IO interface. -+// Definitions for I2C based sensors using the Industrial IO or HWMON interface. - /dts-v1/; - /plugin/; - -@@ -48,11 +48,17 @@ - reg = <0x40>; - status = "disable"; - }; -+ -+ tmp102: tmp102@48 { -+ compatible = "ti,tmp102"; -+ reg = <0x48>; -+ status = "disable"; -+ }; - }; - }; - - __overrides__ { -- addr = <&bme280>,"reg:0", <&bmp280>,"reg:0"; -+ addr = <&bme280>,"reg:0", <&bmp280>,"reg:0", <&tmp102>,"reg:0"; - bme280 = <&bme280>,"status"; - bmp085 = <&bmp085>,"status"; - bmp180 = <&bmp180>,"status"; -@@ -60,5 +66,6 @@ - lm75 = <&lm75>,"status"; - lm75addr = <&lm75>,"reg:0"; - si7020 = <&si7020>,"status"; -+ tmp102 = <&tmp102>,"status"; - }; - }; - -From 54b3f3553f0bb114d9bae119c1c7f7ea13924c93 Mon Sep 17 00:00:00 2001 +@@ -1148,6 +1148,7 @@ CONFIG_FB_TFT_SSD1306=m + CONFIG_FB_TFT_SSD1331=m + CONFIG_FB_TFT_SSD1351=m + CONFIG_FB_TFT_ST7735R=m ++CONFIG_FB_TFT_ST7789V=m + CONFIG_FB_TFT_TINYLCD=m + CONFIG_FB_TFT_TLS8204=m + CONFIG_FB_TFT_UC1701=m + +From 1ae29fb7999bcb07609c20d7ee3f287764c56340 Mon Sep 17 00:00:00 2001 From: Phil Elwell Date: Mon, 8 May 2017 16:30:18 +0100 -Subject: [PATCH 183/201] ARM: dts: bcm283x: Reserve first page for firmware +Subject: [PATCH 129/134] ARM: dts: bcm283x: Reserve first page for firmware The Raspberry Pi startup stub files for multi-core BCM27XX processors make the secondary CPUs spin until the corresponding mailbox is @@ -137483,7 +132480,7 @@ Signed-off-by: Phil Elwell 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/arm/boot/dts/bcm2710-rpi-3-b.dts b/arch/arm/boot/dts/bcm2710-rpi-3-b.dts -index 9f001bccb8261563dcddd8dec94b056b55308c6d..eb2d072c77d1791e1182a93f09f694ebb67d85a3 100644 +index 634add7ab8bc0aa5501508c97050b101aa0e94f4..a239a2d05968af6d87bc69b3472782f4c596853c 100644 --- a/arch/arm/boot/dts/bcm2710-rpi-3-b.dts +++ b/arch/arm/boot/dts/bcm2710-rpi-3-b.dts @@ -1,9 +1,5 @@ @@ -137497,7 +132494,7 @@ index 9f001bccb8261563dcddd8dec94b056b55308c6d..eb2d072c77d1791e1182a93f09f694eb #include "bcm283x-rpi-smsc9514.dtsi" diff --git a/arch/arm/boot/dts/bcm283x.dtsi b/arch/arm/boot/dts/bcm283x.dtsi -index ca47b23ffbcd06063e0fb7072dc8a843b20256e3..4a13ada772daa457792316ceb455a6028acda292 100644 +index dae54df8dfc945962cf6f0680159e8d369142ab0..3fde8a3d24c2dea123c6c741f16b86771ca88cc4 100644 --- a/arch/arm/boot/dts/bcm283x.dtsi +++ b/arch/arm/boot/dts/bcm283x.dtsi @@ -3,6 +3,8 @@ @@ -137510,288 +132507,83 @@ index ca47b23ffbcd06063e0fb7072dc8a843b20256e3..4a13ada772daa457792316ceb455a602 * bcm2835 and bcm2836 implementations, leaving the CPU configuration to * bcm2835.dtsi and bcm2836.dtsi. -From 4a4ff7d009287656ea58c4eb6832c0c5e7e87cc2 Mon Sep 17 00:00:00 2001 +From 347a76682f6f9d2b607982eb205577c6ce38f2f6 Mon Sep 17 00:00:00 2001 From: Phil Elwell -Date: Mon, 8 May 2017 16:43:40 +0100 -Subject: [PATCH 184/201] irq_bcm2836: Send event when onlining sleeping cores +Date: Thu, 18 May 2017 15:36:46 +0100 +Subject: [PATCH 130/134] staging: bcm2835-audio: Fix memory corruption -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 -be started. The wfe instruction causes a core to wait until an event -or interrupt arrives before continuing to the next instruction. -The sev instruction sends a wakeup event to the other cores, so call -it from bcm2836_smp_boot_secondary, the function that wakes up the -waiting cores during booting. +I'm all for fixing memory leaks, but freeing a block while it is still +being used is a recipe for hard-to-debug kernel exeptions. -It is harmless to use this patch without the corresponding change -adding wfe to the ARMv7/ARMv8-32 stubs, but if the stubs are updated -and this patch is not applied then the other cores will sleep forever. - -See: https://github.com/raspberrypi/linux/issues/1989 +1) There is already a vchi method for freeing the instance, so use it. +2) Only call it on error, and then only before initted is false. Signed-off-by: Phil Elwell +Fixes: 0adbfd4694c2 ("staging: bcm2835-audio: fix memory leak in bcm2835_audio_open_connection()") --- - drivers/irqchip/irq-bcm2836.c | 3 +++ - 1 file changed, 3 insertions(+) + drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/drivers/irqchip/irq-bcm2836.c b/drivers/irqchip/irq-bcm2836.c -index 9a7ee04ee0d9b7aa734cf3159ed59c19a338de0d..014f13f89eb896f5cfc75ed9891787d0490baa4b 100644 ---- a/drivers/irqchip/irq-bcm2836.c -+++ b/drivers/irqchip/irq-bcm2836.c -@@ -248,6 +248,9 @@ static int __init bcm2836_smp_boot_secondary(unsigned int cpu, - writel(secondary_startup_phys, - intc.base + LOCAL_MAILBOX3_SET0 + 16 * cpu); +diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c +index 5f3d8f2339e34834d11edfa8de1d5819e3e32b4f..89f96f3c02805f4114ec9b488e18d00e1f348239 100644 +--- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c ++++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c +@@ -409,6 +409,7 @@ static int bcm2835_audio_open_connection(struct bcm2835_alsa_stream *alsa_stream + LOG_ERR("%s: failed to connect VCHI instance (ret=%d)\n", + __func__, ret); -+ dsb(sy); /* Ensure write has completed before waking the other CPUs */ -+ sev(); -+ - return 0; ++ vchi_disconnect(vchi_instance); + ret = -EIO; + goto err_free_mem; + } +@@ -431,7 +432,6 @@ static int bcm2835_audio_open_connection(struct bcm2835_alsa_stream *alsa_stream + LOG_DBG(" success !\n"); + ret = 0; + err_free_mem: +- kfree(vchi_instance); + + return ret; } - -From 5798e6276cc9c0cd3de041eb68bb6ec847311f26 Mon Sep 17 00:00:00 2001 -From: Ahmet Inan -Date: Mon, 15 May 2017 17:10:53 +0200 -Subject: [PATCH 185/201] overlays: Add Goodix overlay - -Add support for I2C connected Goodix gt9271 multiple touch controller using -GPIOs 4 and 17 (pins 7 and 11 on GPIO header) for interrupt and reset. - -Signed-off-by: Ahmet Inan ---- - arch/arm/boot/dts/overlays/Makefile | 1 + - arch/arm/boot/dts/overlays/README | 8 +++++ - arch/arm/boot/dts/overlays/goodix-overlay.dts | 46 +++++++++++++++++++++++++++ - 3 files changed, 55 insertions(+) - create mode 100644 arch/arm/boot/dts/overlays/goodix-overlay.dts - -diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile -index e0ff5793f124fce73732e175bfca424f0a97b632..ddf431837b619f99beb8df45a2714c112e02273c 100644 ---- a/arch/arm/boot/dts/overlays/Makefile -+++ b/arch/arm/boot/dts/overlays/Makefile -@@ -25,6 +25,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ - enc28j60.dtbo \ - enc28j60-spi2.dtbo \ - fe-pi-audio.dtbo \ -+ goodix.dtbo \ - googlevoicehat-soundcard.dtbo \ - gpio-ir.dtbo \ - gpio-poweroff.dtbo \ -diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README -index 4171208933e675a5a3a7e17f8b15447f30a11887..dc391ac88f738c9a711b01a87561c94733745457 100644 ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -459,6 +459,14 @@ Load: dtoverlay=fe-pi-audio - Params: - - -+Name: goodix -+Info: Enables I2C connected Goodix gt9271 multiple touch controller using -+ GPIOs 4 and 17 (pins 7 and 11 on GPIO header) for interrupt and reset. -+Load: dtoverlay=goodix,= -+Params: interrupt GPIO used for interrupt (default 4) -+ reset GPIO used for reset (default 17) -+ -+ - Name: googlevoicehat-soundcard - Info: Configures the Google voiceHAT soundcard - Load: dtoverlay=googlevoicehat-soundcard -diff --git a/arch/arm/boot/dts/overlays/goodix-overlay.dts b/arch/arm/boot/dts/overlays/goodix-overlay.dts -new file mode 100644 -index 0000000000000000000000000000000000000000..084f74042ed6379ebd9281374d5391a7e23a431e ---- /dev/null -+++ b/arch/arm/boot/dts/overlays/goodix-overlay.dts -@@ -0,0 +1,46 @@ -+// Device tree overlay for I2C connected Goodix gt9271 multiple touch controller -+/dts-v1/; -+/plugin/; -+ -+/ { -+ compatible = "brcm,bcm2708"; -+ -+ fragment@0 { -+ target = <&gpio>; -+ __overlay__ { -+ goodix_pins: goodix_pins { -+ brcm,pins = <4 17>; // interrupt and reset -+ brcm,function = <0 0>; // in -+ brcm,pull = <2 2>; // pull-up -+ }; -+ }; -+ }; -+ -+ fragment@1 { -+ target = <&i2c1>; -+ __overlay__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ -+ gt9271: gt9271@14 { -+ compatible = "goodix,gt9271"; -+ reg = <0x14>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&goodix_pins>; -+ interrupt-parent = <&gpio>; -+ interrupts = <4 2>; // high-to-low edge triggered -+ irq-gpios = <&gpio 4 0>; // Pin7 on GPIO header -+ reset-gpios = <&gpio 17 0>; // Pin11 on GPIO header -+ }; -+ }; -+ }; -+ -+ __overrides__ { -+ interrupt = <&goodix_pins>,"brcm,pins:0", -+ <>9271>,"interrupts:0", -+ <>9271>,"irq-gpios:4"; -+ reset = <&goodix_pins>,"brcm,pins:4", -+ <>9271>,"reset-gpios:4"; -+ }; -+}; - -From 200dcaa18f2ccf2b68d48f8d1c4a24326f2bad8f Mon Sep 17 00:00:00 2001 -From: chenzhiwo -Date: Wed, 17 May 2017 16:34:57 +0800 -Subject: [PATCH 186/201] Add device tree overlay for GPIO connected rotary - encoder. See Documentation/input/rotary-encoder.txt for more information. - ---- - arch/arm/boot/dts/overlays/Makefile | 1 + - arch/arm/boot/dts/overlays/README | 9 +++++ - .../boot/dts/overlays/rotary-encoder-overlay.dts | 43 ++++++++++++++++++++++ - 3 files changed, 53 insertions(+) - create mode 100644 arch/arm/boot/dts/overlays/rotary-encoder-overlay.dts - -diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile -index ddf431837b619f99beb8df45a2714c112e02273c..6853e3575f001522a402e7eb31933d32fbac581d 100644 ---- a/arch/arm/boot/dts/overlays/Makefile -+++ b/arch/arm/boot/dts/overlays/Makefile -@@ -76,6 +76,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ - pwm-2chan.dtbo \ - qca7000.dtbo \ - raspidac3.dtbo \ -+ rotary-encoder.dtbo \ - rpi-backlight.dtbo \ - rpi-cirrus-wm5102.dtbo \ - rpi-dac.dtbo \ -diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README -index dc391ac88f738c9a711b01a87561c94733745457..f7e11387e535ce2dba8272798a023963315685b6 100644 ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -1122,6 +1122,15 @@ Load: dtoverlay=raspidac3 - Params: - - -+Name: rotary-encoder -+Info: Overlay for GPIO connected rotary encoder. -+Load: dtoverlay=rotary-encoder,= -+Params: rotary0_pin_a GPIO connected to rotary encoder channel A -+ (default 4). -+ rotary0_pin_b GPIO connected to rotary encoder channel B -+ (default 17). -+ -+ - Name: rpi-backlight - Info: Raspberry Pi official display backlight driver - Load: dtoverlay=rpi-backlight -diff --git a/arch/arm/boot/dts/overlays/rotary-encoder-overlay.dts b/arch/arm/boot/dts/overlays/rotary-encoder-overlay.dts -new file mode 100644 -index 0000000000000000000000000000000000000000..c0c6bccff60cc15d9a9bf59d2c7cba41eb9c1cdc ---- /dev/null -+++ b/arch/arm/boot/dts/overlays/rotary-encoder-overlay.dts -@@ -0,0 +1,43 @@ -+// Device tree overlay for GPIO connected rotary encoder. -+/dts-v1/; -+/plugin/; -+ -+/ { -+ compatible = "brcm,bcm2708"; -+ -+ fragment@0 { -+ target = <&gpio>; -+ __overlay__ { -+ rotary0_pins: rotary0_pins { -+ brcm,pins = <4 17>; /* gpio 4 17 */ -+ brcm,function = <0 0>; /* input */ -+ brcm,pull = <2 2>; /* pull-up */ -+ }; -+ -+ }; -+ }; -+ -+ fragment@1 { -+ target-path = "/"; -+ __overlay__ { -+ rotary0: rotary@0 { -+ compatible = "rotary-encoder"; -+ status = "okay"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&rotary0_pins>; -+ gpios = <&gpio 4 0>, <&gpio 17 0>; -+ linux,axis = <0>; /* REL_X */ -+ rotary-encoder,encoding = "gray"; -+ rotary-encoder,relative-axis; -+ }; -+ }; -+ -+ }; -+ -+ __overrides__ { -+ rotary0_pin_a = <&rotary0>,"gpios:4", -+ <&rotary0_pins>,"brcm,pins:0"; -+ rotary0_pin_b = <&rotary0>,"gpios:16", -+ <&rotary0_pins>,"brcm,pins:4"; -+ }; -+}; - -From 4b0e229bd0e811801ae7d1e61bc2564ecd49ad4f Mon Sep 17 00:00:00 2001 -From: Liviu Dudau -Date: Wed, 1 Mar 2017 12:26:28 +0000 -Subject: [PATCH 187/201] ASoC: TLV320AIC23: Unquote NULL from control name - -commit a03faba972cb0f9b3a46d8054e674d5492e06c38 upstream. - -Without this I am getting the following messages at boot on my Trimslice: - tlv320aic23-codec 2-001a: Control not supported for path LLINEIN -> [NULL] -> Line Input - tlv320aic23-codec 2-001a: ASoC: no dapm match for LLINEIN --> NULL --> Line Input - tlv320aic23-codec 2-001a: ASoC: Failed to add route LLINEIN -> NULL -> Line Input - tlv320aic23-codec 2-001a: Control not supported for path RLINEIN -> [NULL] -> Line Input - tlv320aic23-codec 2-001a: ASoC: no dapm match for RLINEIN --> NULL --> Line Input - tlv320aic23-codec 2-001a: ASoC: Failed to add route RLINEIN -> NULL -> Line Input - tlv320aic23-codec 2-001a: Control not supported for path MICIN -> [NULL] -> Mic Input - tlv320aic23-codec 2-001a: ASoC: no dapm match for MICIN --> NULL --> Mic Input - tlv320aic23-codec 2-001a: ASoC: Failed to add route MICIN -> NULL -> Mic Input - tegra-snd-trimslice sound: tlv320aic23-hifi <-> 70002800.i2s mapping ok - -Signed-off-by: Liviu Dudau -Signed-off-by: Mark Brown ---- - sound/soc/codecs/tlv320aic23.c | 7 +++---- - 1 file changed, 3 insertions(+), 4 deletions(-) - -diff --git a/sound/soc/codecs/tlv320aic23.c b/sound/soc/codecs/tlv320aic23.c -index 410cae0f2060474313872d6b9110bf05d3368e43..628a8eeaab689eb85b6d3dba54ec5a98aefe6da0 100644 ---- a/sound/soc/codecs/tlv320aic23.c -+++ b/sound/soc/codecs/tlv320aic23.c -@@ -174,10 +174,9 @@ static const struct snd_soc_dapm_route tlv320aic23_intercon[] = { - {"ROUT", NULL, "Output Mixer"}, - - /* Inputs */ -- {"Line Input", "NULL", "LLINEIN"}, -- {"Line Input", "NULL", "RLINEIN"}, -- -- {"Mic Input", "NULL", "MICIN"}, -+ {"Line Input", NULL, "LLINEIN"}, -+ {"Line Input", NULL, "RLINEIN"}, -+ {"Mic Input", NULL, "MICIN"}, - - /* input mux */ - {"Capture Source", "Line", "Line Input"}, - -From b6c524e731cf6d5f833b7de63d1be52b18a05bc7 Mon Sep 17 00:00:00 2001 +From c841a92f697a659fe8a78c5b8548382de3e703e9 Mon Sep 17 00:00:00 2001 From: popcornmix -Date: Mon, 22 May 2017 15:28:27 +0100 -Subject: [PATCH 188/201] config: Add CONFIG_IPV6_ROUTE_INFO +Date: Mon, 15 May 2017 16:40:05 +0100 +Subject: [PATCH 131/134] config: Add CONFIG_TOUCHSCREEN_GOODIX + +--- + arch/arm/configs/bcm2709_defconfig | 1 + + arch/arm/configs/bcmrpi_defconfig | 1 - + 2 files changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig +index 13b653b438bd5c087b1744c5633a930bd0a2abee..42ee45748f6a6c0f841c8b350a79e21dbf704002 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -566,6 +566,7 @@ CONFIG_INPUT_TOUCHSCREEN=y + CONFIG_TOUCHSCREEN_ADS7846=m + CONFIG_TOUCHSCREEN_EGALAX=m + CONFIG_TOUCHSCREEN_EDT_FT5X06=m ++CONFIG_TOUCHSCREEN_GOODIX=m + CONFIG_TOUCHSCREEN_RPI_FT5406=m + CONFIG_TOUCHSCREEN_USB_COMPOSITE=m + CONFIG_TOUCHSCREEN_STMPE=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index ef7bfc431c43eec6deb7c52e8cdac31794ccccbe..573cbd71ca0990b7a7e48fa3bbc98eec2d3d776f 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -561,7 +561,6 @@ CONFIG_JOYSTICK_RPISENSE=m + CONFIG_INPUT_TOUCHSCREEN=y + CONFIG_TOUCHSCREEN_ADS7846=m + CONFIG_TOUCHSCREEN_EGALAX=m +-CONFIG_TOUCHSCREEN_EDT_FT5X06=m + CONFIG_TOUCHSCREEN_GOODIX=m + CONFIG_TOUCHSCREEN_RPI_FT5406=m + CONFIG_TOUCHSCREEN_USB_COMPOSITE=m + +From 637d33d715b013eab3fd385a793cffd0c3f17a40 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 16 May 2017 15:58:00 +0100 +Subject: [PATCH 132/134] config: Add CONFIG_TOUCHSCREEN_EDT_FT5X06 --- arch/arm/configs/bcm2709_defconfig | 1 + @@ -137799,7 +132591,77 @@ Subject: [PATCH 188/201] config: Add CONFIG_IPV6_ROUTE_INFO 2 files changed, 2 insertions(+) diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig -index c22f2f31ad07a7887c06660f21ebfb1eddf0a8fd..ca97073ef5a0aa3dd0c48f313e82abf4f00ba8dd 100644 +index 42ee45748f6a6c0f841c8b350a79e21dbf704002..1fb167c8c475a84b232faac792a53a298c0a1c7d 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -567,6 +567,7 @@ CONFIG_TOUCHSCREEN_ADS7846=m + CONFIG_TOUCHSCREEN_EGALAX=m + CONFIG_TOUCHSCREEN_EDT_FT5X06=m + CONFIG_TOUCHSCREEN_GOODIX=m ++CONFIG_TOUCHSCREEN_EDT_FT5X06=m + CONFIG_TOUCHSCREEN_RPI_FT5406=m + CONFIG_TOUCHSCREEN_USB_COMPOSITE=m + CONFIG_TOUCHSCREEN_STMPE=m +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 573cbd71ca0990b7a7e48fa3bbc98eec2d3d776f..6c4d62cdea7e4ed642e265861c6f1c1a964e331c 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -562,6 +562,7 @@ CONFIG_INPUT_TOUCHSCREEN=y + CONFIG_TOUCHSCREEN_ADS7846=m + CONFIG_TOUCHSCREEN_EGALAX=m + CONFIG_TOUCHSCREEN_GOODIX=m ++CONFIG_TOUCHSCREEN_EDT_FT5X06=m + CONFIG_TOUCHSCREEN_RPI_FT5406=m + CONFIG_TOUCHSCREEN_USB_COMPOSITE=m + CONFIG_TOUCHSCREEN_STMPE=m + +From f087e354642b53ed764a0a3d39241cab3d2fbb8b Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Mon, 22 May 2017 13:35:28 +0100 +Subject: [PATCH 133/134] config: Add CONFIG_IPV6_SIT_6RD + +--- + 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 1fb167c8c475a84b232faac792a53a298c0a1c7d..396024805e978d4da448c59efba01f0b747dc65e 100644 +--- a/arch/arm/configs/bcm2709_defconfig ++++ b/arch/arm/configs/bcm2709_defconfig +@@ -105,6 +105,7 @@ CONFIG_IPV6_ROUTER_PREF=y + CONFIG_INET6_AH=m + CONFIG_INET6_ESP=m + CONFIG_INET6_IPCOMP=m ++CONFIG_IPV6_SIT_6RD=y + CONFIG_IPV6_TUNNEL=m + CONFIG_IPV6_MULTIPLE_TABLES=y + CONFIG_IPV6_SUBTREES=y +diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig +index 6c4d62cdea7e4ed642e265861c6f1c1a964e331c..676dfebfbab8f1cba521bc032b8d21371c38abfa 100644 +--- a/arch/arm/configs/bcmrpi_defconfig ++++ b/arch/arm/configs/bcmrpi_defconfig +@@ -101,6 +101,7 @@ CONFIG_IPV6_ROUTER_PREF=y + CONFIG_INET6_AH=m + CONFIG_INET6_ESP=m + CONFIG_INET6_IPCOMP=m ++CONFIG_IPV6_SIT_6RD=y + CONFIG_IPV6_TUNNEL=m + CONFIG_IPV6_MULTIPLE_TABLES=y + CONFIG_IPV6_SUBTREES=y + +From 6eb651c59852a50342ace0bf671fdb01f3ca92df Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Mon, 22 May 2017 15:28:27 +0100 +Subject: [PATCH 134/134] config: Add CONFIG_IPV6_ROUTE_INFO + +--- + 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 396024805e978d4da448c59efba01f0b747dc65e..aacd9619f45cd0924f0b80a7d035ae03273d93ce 100644 --- a/arch/arm/configs/bcm2709_defconfig +++ b/arch/arm/configs/bcm2709_defconfig @@ -102,6 +102,7 @@ CONFIG_TCP_CONG_ADVANCED=y @@ -137811,7 +132673,7 @@ index c22f2f31ad07a7887c06660f21ebfb1eddf0a8fd..ca97073ef5a0aa3dd0c48f313e82abf4 CONFIG_INET6_ESP=m CONFIG_INET6_IPCOMP=m diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index 388d0bd8ce36c2028813e7080421f34ab7d7958c..125654dbad226b506db0a9c901a972bfce101264 100644 +index 676dfebfbab8f1cba521bc032b8d21371c38abfa..4ae560370a972b9c56e8af38a537b1dbebd5488a 100644 --- a/arch/arm/configs/bcmrpi_defconfig +++ b/arch/arm/configs/bcmrpi_defconfig @@ -98,6 +98,7 @@ CONFIG_TCP_CONG_ADVANCED=y @@ -137822,2040 +132684,3 @@ index 388d0bd8ce36c2028813e7080421f34ab7d7958c..125654dbad226b506db0a9c901a972bf CONFIG_INET6_AH=m CONFIG_INET6_ESP=m CONFIG_INET6_IPCOMP=m - -From f4a657e46e7278eeef61fc0dbf9f7b06cbce4cc6 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Mon, 22 May 2017 13:35:28 +0100 -Subject: [PATCH 189/201] config: Add CONFIG_IPV6_SIT_6RD - ---- - 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 ca97073ef5a0aa3dd0c48f313e82abf4f00ba8dd..b8feb7d9735586cffdbad0252e236c26181b5366 100644 ---- a/arch/arm/configs/bcm2709_defconfig -+++ b/arch/arm/configs/bcm2709_defconfig -@@ -106,6 +106,7 @@ CONFIG_IPV6_ROUTE_INFO=y - CONFIG_INET6_AH=m - CONFIG_INET6_ESP=m - CONFIG_INET6_IPCOMP=m -+CONFIG_IPV6_SIT_6RD=y - CONFIG_IPV6_TUNNEL=m - CONFIG_IPV6_MULTIPLE_TABLES=y - CONFIG_IPV6_SUBTREES=y -diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index 125654dbad226b506db0a9c901a972bfce101264..354221833db0cb960058e214f03c35dc3442ffdb 100644 ---- a/arch/arm/configs/bcmrpi_defconfig -+++ b/arch/arm/configs/bcmrpi_defconfig -@@ -102,6 +102,7 @@ CONFIG_IPV6_ROUTE_INFO=y - CONFIG_INET6_AH=m - CONFIG_INET6_ESP=m - CONFIG_INET6_IPCOMP=m -+CONFIG_IPV6_SIT_6RD=y - CONFIG_IPV6_TUNNEL=m - CONFIG_IPV6_MULTIPLE_TABLES=y - CONFIG_IPV6_SUBTREES=y - -From 0b158a12c02b8eda8d754389b0d7fb85e99d5535 Mon Sep 17 00:00:00 2001 -From: Anton Onishchenko -Date: Tue, 23 May 2017 18:55:46 +0300 -Subject: [PATCH 190/201] mpu6050 device tree overlay (#2031) - -Add overlay and config options for InvenSense MPU6050 6-axis motion -detector. ---- - arch/arm/boot/dts/overlays/Makefile | 1 + - arch/arm/boot/dts/overlays/README | 6 ++++++ - arch/arm/boot/dts/overlays/mpu6050-overlay.dts | 28 ++++++++++++++++++++++++++ - arch/arm/configs/bcm2709_defconfig | 3 +-- - arch/arm/configs/bcmrpi_defconfig | 3 +-- - 5 files changed, 37 insertions(+), 4 deletions(-) - create mode 100644 arch/arm/boot/dts/overlays/mpu6050-overlay.dts - -diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile -index 6853e3575f001522a402e7eb31933d32fbac581d..c95b37f0a4c72160421f44819c5f29246d3352f9 100644 ---- a/arch/arm/boot/dts/overlays/Makefile -+++ b/arch/arm/boot/dts/overlays/Makefile -@@ -59,6 +59,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ - midi-uart0.dtbo \ - midi-uart1.dtbo \ - mmc.dtbo \ -+ mpu6050.dtbo \ - mz61581.dtbo \ - pi3-act-led.dtbo \ - pi3-disable-bt.dtbo \ -diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README -index f7e11387e535ce2dba8272798a023963315685b6..d560490c2661c3396d37315bbb9b2d9e93b5ac15 100644 ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -898,6 +898,12 @@ Params: overclock_50 Clock (in MHz) to use when the MMC framework - requests 50MHz - - -+Name: mpu6050 -+Info: Overlay for i2c connected mpu6050 imu -+Load: dtoverlay=mpu6050,= -+Params: interrupt GPIO pin for interrupt (default 4) -+ -+ - Name: mz61581 - Info: MZ61581 display by Tontec - Load: dtoverlay=mz61581,= -diff --git a/arch/arm/boot/dts/overlays/mpu6050-overlay.dts b/arch/arm/boot/dts/overlays/mpu6050-overlay.dts -new file mode 100644 -index 0000000000000000000000000000000000000000..06037969c3abba270b3cad45875342f3c730506e ---- /dev/null -+++ b/arch/arm/boot/dts/overlays/mpu6050-overlay.dts -@@ -0,0 +1,28 @@ -+// Definitions for MPU6050 -+/dts-v1/; -+/plugin/; -+ -+/ { -+ compatible = "brcm,bcm2708"; -+ -+ fragment@0 { -+ target = <&i2c1>; -+ __overlay__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ clock-frequency = <400000>; -+ -+ mpu6050: mpu6050@68 { -+ compatible = "invensense,mpu6050"; -+ reg = <0x68>; -+ interrupt-parent = <&gpio>; -+ interrupts = <4 1>; -+ }; -+ }; -+ }; -+ -+ __overrides__ { -+ interrupt = <&mpu6050>,"interrupts:0"; -+ }; -+}; -diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig -index b8feb7d9735586cffdbad0252e236c26181b5366..3b09a959efe8094067839af1d32e88886fc7fa07 100644 ---- a/arch/arm/configs/bcm2709_defconfig -+++ b/arch/arm/configs/bcm2709_defconfig -@@ -1165,13 +1165,12 @@ CONFIG_RASPBERRYPI_POWER=y - CONFIG_EXTCON=m - CONFIG_EXTCON_ARIZONA=m - CONFIG_IIO=m --CONFIG_IIO_BUFFER=y - CONFIG_IIO_BUFFER_CB=m --CONFIG_IIO_KFIFO_BUF=m - CONFIG_MCP320X=m - CONFIG_MCP3422=m - CONFIG_DHT11=m - CONFIG_HTU21=m -+CONFIG_INV_MPU6050_I2C=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 354221833db0cb960058e214f03c35dc3442ffdb..58e5c4b87131f3c369e303866276b0633a3e3a08 100644 ---- a/arch/arm/configs/bcmrpi_defconfig -+++ b/arch/arm/configs/bcmrpi_defconfig -@@ -1172,13 +1172,12 @@ CONFIG_RASPBERRYPI_POWER=y - CONFIG_EXTCON=m - CONFIG_EXTCON_ARIZONA=m - CONFIG_IIO=m --CONFIG_IIO_BUFFER=y - CONFIG_IIO_BUFFER_CB=m --CONFIG_IIO_KFIFO_BUF=m - CONFIG_MCP320X=m - CONFIG_MCP3422=m - CONFIG_DHT11=m - CONFIG_HTU21=m -+CONFIG_INV_MPU6050_I2C=m - CONFIG_BMP280=m - CONFIG_PWM_BCM2835=m - CONFIG_PWM_PCA9685=m - -From 799f0dea47039f38e5b3a8c77fe9574a0e585e46 Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Wed, 31 May 2017 09:33:55 +0100 -Subject: [PATCH 191/201] config: Adding SENSOR_JC42 - -The jc42 module supports a number of I2C-based temperature -sensor modules. - -[ DM_RAID0 config lost because now selected by DM_RAID ] - -See: https://github.com/raspberrypi/linux/issues/2046 - -Signed-off-by: Phil Elwell ---- - arch/arm/configs/bcm2709_defconfig | 2 +- - arch/arm/configs/bcmrpi_defconfig | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig -index 3b09a959efe8094067839af1d32e88886fc7fa07..2de0087789d282dd1931a56d8f50843da0ba0955 100644 ---- a/arch/arm/configs/bcm2709_defconfig -+++ b/arch/arm/configs/bcm2709_defconfig -@@ -437,7 +437,6 @@ CONFIG_ISCSI_TCP=m - CONFIG_ISCSI_BOOT_SYSFS=m - CONFIG_MD=y - CONFIG_MD_LINEAR=m --CONFIG_MD_RAID0=m - CONFIG_BLK_DEV_DM=m - CONFIG_DM_CRYPT=m - CONFIG_DM_SNAPSHOT=m -@@ -653,6 +652,7 @@ CONFIG_POWER_RESET=y - CONFIG_POWER_RESET_GPIO=y - CONFIG_BATTERY_DS2760=m - CONFIG_HWMON=m -+CONFIG_SENSORS_JC42=m - CONFIG_SENSORS_LM75=m - CONFIG_SENSORS_SHT21=m - CONFIG_SENSORS_SHTC1=m -diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index 58e5c4b87131f3c369e303866276b0633a3e3a08..9e3b9db7662f4a382ed35d91a19f11501361ef55 100644 ---- a/arch/arm/configs/bcmrpi_defconfig -+++ b/arch/arm/configs/bcmrpi_defconfig -@@ -433,7 +433,6 @@ CONFIG_ISCSI_TCP=m - CONFIG_ISCSI_BOOT_SYSFS=m - CONFIG_MD=y - CONFIG_MD_LINEAR=m --CONFIG_MD_RAID0=m - CONFIG_BLK_DEV_DM=m - CONFIG_DM_CRYPT=m - CONFIG_DM_SNAPSHOT=m -@@ -647,6 +646,7 @@ CONFIG_POWER_RESET=y - CONFIG_POWER_RESET_GPIO=y - CONFIG_BATTERY_DS2760=m - CONFIG_HWMON=m -+CONFIG_SENSORS_JC42=m - CONFIG_SENSORS_LM75=m - CONFIG_SENSORS_SHT21=m - CONFIG_SENSORS_SHTC1=m - -From 7c5121892dbe564dd8665c73e5155797a6a4043f Mon Sep 17 00:00:00 2001 -From: Phil Elwell -Date: Wed, 31 May 2017 15:27:39 +0100 -Subject: [PATCH 192/201] BCM270X_DT: Improve i2c-sensor and i2c-rtc overlay - -Use the "__dormant__" feature to permit multiple instances of each -overlay, which is more useful now that changing the "reg" property -also changes the node address. Although the overlay grows slightly, -when applied only the requested node is included. - -Usage does not change, except that the "lm75addr" parameter of the -i2c-sensor overlay has been deprecated in favour of the generic -"addr" parameter. - -Signed-off-by: Phil Elwell ---- - arch/arm/boot/dts/overlays/README | 8 +- - arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts | 127 ++++++++++++++++++---- - arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts | 87 ++++++++++++--- - 3 files changed, 179 insertions(+), 43 deletions(-) - -diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README -index d560490c2661c3396d37315bbb9b2d9e93b5ac15..ce8706a8aa88c36b0dee95c56ee58b4a524b8b43 100644 ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -660,8 +660,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 or -- TMP102 -+Params: addr Set the address for the BME280, BMP280, TMP102 -+ or LM75 - - bme280 Select the Bosch Sensortronic BME280 - Valid addresses 0x76-0x77, default 0x76 -@@ -674,9 +674,9 @@ Params: addr Set the address for the BME280, BMP280 or - Valid addresses 0x76-0x77, default 0x76 - - lm75 Select the Maxim LM75 temperature sensor -+ Valid addresses 0x48-0x4f, default 0x4f - -- lm75addr Choose the address for the LM75 (0x48-0x4f - -- default 0x4f) -+ lm75addr Deprecated - use addr parameter instead - - si7020 Select the Silicon Labs Si7013/20/21 humidity/ - temperature sensor -diff --git a/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts b/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts -index 1efcf0b712c9c5c19210545002ac1f0931db58f5..6140f172a86b8731782f938f76cb5dac9f28b662 100644 ---- a/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts -+++ b/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts -@@ -7,7 +7,7 @@ - - fragment@0 { - target = <&i2c_arm>; -- __overlay__ { -+ __dormant__ { - #address-cells = <1>; - #size-cells = <0>; - status = "okay"; -@@ -17,61 +17,142 @@ - reg = <0x69>; - abracon,tc-diode = "standard"; - abracon,tc-resistor = <0>; -- status = "disable"; -+ status = "okay"; - }; -+ }; -+ }; -+ -+ fragment@1 { -+ target = <&i2c_arm>; -+ __dormant__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ - ds1307: ds1307@68 { - compatible = "maxim,ds1307"; - reg = <0x68>; -- status = "disable"; -+ status = "okay"; - }; -+ }; -+ }; -+ -+ fragment@2 { -+ target = <&i2c_arm>; -+ __dormant__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ - ds1339: ds1339@68 { - compatible = "dallas,ds1339"; - trickle-resistor-ohms = <0>; - reg = <0x68>; -- status = "disable"; -+ status = "okay"; - }; -+ }; -+ }; -+ -+ fragment@3 { -+ target = <&i2c_arm>; -+ __dormant__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ -+ ds3231: ds3231@68 { -+ compatible = "maxim,ds3231"; -+ reg = <0x68>; -+ status = "okay"; -+ }; -+ }; -+ }; -+ -+ fragment@4 { -+ target = <&i2c_arm>; -+ __dormant__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ - mcp7940x: mcp7940x@6f { - compatible = "microchip,mcp7940x"; - reg = <0x6f>; -- status = "disable"; -+ status = "okay"; - }; -+ }; -+ }; -+ -+ fragment@5 { -+ target = <&i2c_arm>; -+ __dormant__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ - mcp7941x: mcp7941x@6f { - compatible = "microchip,mcp7941x"; - reg = <0x6f>; -- status = "disable"; -- }; -- ds3231: ds3231@68 { -- compatible = "maxim,ds3231"; -- reg = <0x68>; -- status = "disable"; -+ status = "okay"; - }; -+ }; -+ }; -+ -+ fragment@6 { -+ target = <&i2c_arm>; -+ __dormant__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ - pcf2127: pcf2127@51 { - compatible = "nxp,pcf2127"; - reg = <0x51>; -- status = "disable"; -+ status = "okay"; - }; -+ }; -+ }; -+ -+ fragment@7 { -+ target = <&i2c_arm>; -+ __dormant__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ - pcf8523: pcf8523@68 { - compatible = "nxp,pcf8523"; - reg = <0x68>; -- status = "disable"; -+ status = "okay"; - }; -+ }; -+ }; -+ -+ fragment@8 { -+ target = <&i2c_arm>; -+ __dormant__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ - pcf8563: pcf8563@51 { - compatible = "nxp,pcf8563"; - reg = <0x51>; -- status = "disable"; -+ status = "okay"; - }; - }; - }; -+ - __overrides__ { -- abx80x = <&abx80x>,"status"; -- ds1307 = <&ds1307>,"status"; -- ds1339 = <&ds1339>,"status"; -- ds3231 = <&ds3231>,"status"; -- mcp7940x = <&mcp7940x>,"status"; -- mcp7941x = <&mcp7941x>,"status"; -- pcf2127 = <&pcf2127>,"status"; -- pcf8523 = <&pcf8523>,"status"; -- pcf8563 = <&pcf8563>,"status"; -+ abx80x = <0>,"+0"; -+ ds1307 = <0>,"+1"; -+ ds1339 = <0>,"+2"; -+ ds3231 = <0>,"+3"; -+ mcp7940x = <0>,"+4"; -+ mcp7941x = <0>,"+5"; -+ pcf2127 = <0>,"+6"; -+ pcf8523 = <0>,"+7"; -+ pcf8563 = <0>,"+8"; - trickle-diode-type = <&abx80x>,"abracon,tc-diode"; - trickle-resistor-ohms = <&ds1339>,"trickle-resistor-ohms:0", - <&abx80x>,"abracon,tc-resistor"; -diff --git a/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts b/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts -index e86a13f92c3f75c14fa4425cdfb081d6795ff76a..d2f0008addfadac8f6ed774a6e4f3f97871c0d61 100644 ---- a/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts -+++ b/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts -@@ -7,7 +7,7 @@ - - fragment@0 { - target = <&i2c_arm>; -- __overlay__ { -+ __dormant__ { - #address-cells = <1>; - #size-cells = <0>; - status = "okay"; -@@ -15,57 +15,112 @@ - bme280: bme280@76 { - compatible = "bosch,bme280"; - reg = <0x76>; -- status = "disable"; -+ status = "okay"; - }; -+ }; -+ }; -+ -+ fragment@1 { -+ target = <&i2c_arm>; -+ __dormant__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; - - bmp085: bmp085@77 { - compatible = "bosch,bmp085"; - reg = <0x77>; - default-oversampling = <3>; -- status = "disable"; -+ status = "okay"; - }; -+ }; -+ }; -+ -+ fragment@2 { -+ target = <&i2c_arm>; -+ __dormant__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; - - bmp180: bmp180@77 { - compatible = "bosch,bmp180"; - reg = <0x77>; -- status = "disable"; -+ status = "okay"; - }; -+ }; -+ }; -+ -+ fragment@3 { -+ target = <&i2c_arm>; -+ __dormant__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; - - bmp280: bmp280@76 { - compatible = "bosch,bmp280"; - reg = <0x76>; -- status = "disable"; -+ status = "okay"; - }; -+ }; -+ }; -+ -+ fragment@4 { -+ target = <&i2c_arm>; -+ __dormant__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; - - lm75: lm75@4f { - compatible = "lm75"; - reg = <0x4f>; -- status = "disable"; -+ status = "okay"; - }; -+ }; -+ }; -+ -+ fragment@5 { -+ target = <&i2c_arm>; -+ __dormant__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; - - si7020: si7020@40 { - compatible = "si7020"; - reg = <0x40>; -- status = "disable"; -+ status = "okay"; - }; -+ }; -+ }; -+ -+ fragment@6 { -+ target = <&i2c_arm>; -+ __dormant__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; - - tmp102: tmp102@48 { - compatible = "ti,tmp102"; - reg = <0x48>; -- status = "disable"; -+ status = "okay"; - }; - }; - }; - - __overrides__ { -- addr = <&bme280>,"reg:0", <&bmp280>,"reg:0", <&tmp102>,"reg:0"; -- bme280 = <&bme280>,"status"; -- bmp085 = <&bmp085>,"status"; -- bmp180 = <&bmp180>,"status"; -- bmp280 = <&bmp280>,"status"; -- lm75 = <&lm75>,"status"; -+ addr = <&bme280>,"reg:0", <&bmp280>,"reg:0", <&tmp102>,"reg:0", -+ <&lm75>,"reg:0"; -+ bme280 = <0>,"+0"; -+ bmp085 = <0>,"+1"; -+ bmp180 = <0>,"+2"; -+ bmp280 = <0>,"+3"; -+ lm75 = <0>,"+4"; - lm75addr = <&lm75>,"reg:0"; -- si7020 = <&si7020>,"status"; -- tmp102 = <&tmp102>,"status"; -+ si7020 = <0>,"+5"; -+ tmp102 = <0>,"+6"; - }; - }; - -From 5de239fe5f5edbc6c3a49c75288d1e3f07e0b5e9 Mon Sep 17 00:00:00 2001 -From: Stefan Tatschner -Date: Mon, 29 May 2017 21:46:16 +0200 -Subject: [PATCH 193/201] Add device tree config for htu21 - -See: https://github.com/raspberrypi/linux/pull/2041 - -Signed-off-by: Phil Elwell ---- - arch/arm/boot/dts/overlays/README | 2 ++ - arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts | 26 ++++++++++++++++++----- - 2 files changed, 23 insertions(+), 5 deletions(-) - -diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README -index ce8706a8aa88c36b0dee95c56ee58b4a524b8b43..bce02c82f3438995e5a74080876391f758bfe27b 100644 ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -673,6 +673,8 @@ Params: addr Set the address for the BME280, BMP280, TMP102 - bmp280 Select the Bosch Sensortronic BMP280 - Valid addresses 0x76-0x77, default 0x76 - -+ htu21 Select the HTU21 temperature and humidity sensor -+ - lm75 Select the Maxim LM75 temperature sensor - Valid addresses 0x48-0x4f, default 0x4f - -diff --git a/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts b/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts -index d2f0008addfadac8f6ed774a6e4f3f97871c0d61..17c27e3b666a7a83619471b50c63bb93836653c5 100644 ---- a/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts -+++ b/arch/arm/boot/dts/overlays/i2c-sensor-overlay.dts -@@ -73,6 +73,21 @@ - #size-cells = <0>; - status = "okay"; - -+ htu21: htu21@40 { -+ compatible = "htu21"; -+ reg = <0x40>; -+ status = "okay"; -+ }; -+ }; -+ }; -+ -+ fragment@5 { -+ target = <&i2c_arm>; -+ __dormant__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ - lm75: lm75@4f { - compatible = "lm75"; - reg = <0x4f>; -@@ -81,7 +96,7 @@ - }; - }; - -- fragment@5 { -+ fragment@6 { - target = <&i2c_arm>; - __dormant__ { - #address-cells = <1>; -@@ -96,7 +111,7 @@ - }; - }; - -- fragment@6 { -+ fragment@7 { - target = <&i2c_arm>; - __dormant__ { - #address-cells = <1>; -@@ -118,9 +133,10 @@ - bmp085 = <0>,"+1"; - bmp180 = <0>,"+2"; - bmp280 = <0>,"+3"; -- lm75 = <0>,"+4"; -+ htu21 = <0>,"+4"; -+ lm75 = <0>,"+5"; - lm75addr = <&lm75>,"reg:0"; -- si7020 = <0>,"+5"; -- tmp102 = <0>,"+6"; -+ si7020 = <0>,"+6"; -+ tmp102 = <0>,"+7"; - }; - }; - -From a830ee22fbeb3149cee20c620598f08643de915d Mon Sep 17 00:00:00 2001 -From: sandeepal -Date: Fri, 2 Jun 2017 18:59:46 +0530 -Subject: [PATCH 194/201] Allo Digione Driver (#2048) - -Driver for the Allo Digione soundcard ---- - arch/arm/boot/dts/overlays/Makefile | 1 + - arch/arm/boot/dts/overlays/README | 6 + - .../arm/boot/dts/overlays/allo-digione-overlay.dts | 44 ++++ - arch/arm/configs/bcm2709_defconfig | 1 + - arch/arm/configs/bcmrpi_defconfig | 1 + - sound/soc/bcm/Kconfig | 6 + - sound/soc/bcm/Makefile | 2 + - sound/soc/bcm/allo-digione.c | 268 +++++++++++++++++++++ - 8 files changed, 329 insertions(+) - create mode 100644 arch/arm/boot/dts/overlays/allo-digione-overlay.dts - create mode 100644 sound/soc/bcm/allo-digione.c - -diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile -index c95b37f0a4c72160421f44819c5f29246d3352f9..eca81982c0f19988abd05165fc62a80d26f539cb 100644 ---- a/arch/arm/boot/dts/overlays/Makefile -+++ b/arch/arm/boot/dts/overlays/Makefile -@@ -8,6 +8,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ - ads7846.dtbo \ - akkordion-iqdacplus.dtbo \ - allo-boss-dac-pcm512x-audio.dtbo \ -+ allo-digione.dtbo \ - allo-piano-dac-pcm512x-audio.dtbo \ - allo-piano-dac-plus-pcm512x-audio.dtbo \ - at86rf233.dtbo \ -diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README -index bce02c82f3438995e5a74080876391f758bfe27b..19df6883be4277240283d5f63f27e34a22a2eec5 100644 ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -287,6 +287,12 @@ Params: 24db_digital_gain Allow gain to be applied via the PCM512x codec - slave" - - -+Name: allo-digione -+Info: Configures the Allo Digione audio card -+Load: dtoverlay=allo-digione -+Params: -+ -+ - Name: allo-piano-dac-pcm512x-audio - Info: Configures the Allo Piano DAC (2.0/2.1) audio cards. - (NB. This initial support is for 2.0 channel audio ONLY! ie. stereo. -diff --git a/arch/arm/boot/dts/overlays/allo-digione-overlay.dts b/arch/arm/boot/dts/overlays/allo-digione-overlay.dts -new file mode 100644 -index 0000000000000000000000000000000000000000..101277a11a24e9b3eb441c44c3f19c61836fe77c ---- /dev/null -+++ b/arch/arm/boot/dts/overlays/allo-digione-overlay.dts -@@ -0,0 +1,44 @@ -+// Definitions for Allo DigiOne -+/dts-v1/; -+/plugin/; -+ -+/ { -+ compatible = "brcm,bcm2708"; -+ -+ fragment@0 { -+ target = <&i2s>; -+ __overlay__ { -+ status = "okay"; -+ }; -+ }; -+ -+ fragment@1 { -+ target = <&i2c1>; -+ __overlay__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ -+ wm8804@3b { -+ #sound-dai-cells = <0>; -+ compatible = "wlf,wm8804"; -+ reg = <0x3b>; -+ PVDD-supply = <&vdd_3v3_reg>; -+ DVDD-supply = <&vdd_3v3_reg>; -+ status = "okay"; -+ wlf,reset-gpio = <&gpio 17 0>; -+ }; -+ }; -+ }; -+ -+ fragment@2 { -+ target = <&sound>; -+ __overlay__ { -+ compatible = "allo,allo-digione"; -+ i2s-controller = <&i2s>; -+ status = "okay"; -+ clock44-gpio = <&gpio 5 0>; -+ clock48-gpio = <&gpio 6 0>; -+ }; -+ }; -+}; -diff --git a/arch/arm/configs/bcm2709_defconfig b/arch/arm/configs/bcm2709_defconfig -index 2de0087789d282dd1931a56d8f50843da0ba0955..7434a6ddd94b121f6ffd9cf518d16b9fda5422b1 100644 ---- a/arch/arm/configs/bcm2709_defconfig -+++ b/arch/arm/configs/bcm2709_defconfig -@@ -893,6 +893,7 @@ CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC=m - CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS=m - CONFIG_SND_BCM2708_SOC_FE_PI_AUDIO=m - CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC=m -+CONFIG_SND_BCM2708_SOC_ALLO_DIGIONE=m - CONFIG_SND_PISOUND=m - CONFIG_SND_SOC_ADAU1701=m - CONFIG_SND_SOC_ADAU7002=m -diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index 9e3b9db7662f4a382ed35d91a19f11501361ef55..f13f9fb0a19424bebe5f3c662c92789ca41be509 100644 ---- a/arch/arm/configs/bcmrpi_defconfig -+++ b/arch/arm/configs/bcmrpi_defconfig -@@ -887,6 +887,7 @@ CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC=m - CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS=m - CONFIG_SND_BCM2708_SOC_FE_PI_AUDIO=m - CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC=m -+CONFIG_SND_BCM2708_SOC_ALLO_DIGIONE=m - CONFIG_SND_PISOUND=m - CONFIG_SND_SOC_ADAU1701=m - CONFIG_SND_SOC_ADAU7002=m -diff --git a/sound/soc/bcm/Kconfig b/sound/soc/bcm/Kconfig -index c472f67b6167fecbdc099c1ceaa96b10555e8039..e6ba276dc0058f61259793ef586e0d3beb1b23ec 100644 ---- a/sound/soc/bcm/Kconfig -+++ b/sound/soc/bcm/Kconfig -@@ -183,6 +183,12 @@ config SND_BCM2708_SOC_ALLO_BOSS_DAC - help - Say Y or M if you want to add support for Allo Boss DAC. - -+config SND_BCM2708_SOC_ALLO_DIGIONE -+ tristate "Support for Allo DigiOne" -+ depends on SND_BCM2708_SOC_I2S || SND_BCM2835_SOC_I2S -+ select SND_SOC_PCM512x_I2C -+ help -+ Say Y or M if you want to add support for Allo DigiOne. - - config SND_PISOUND - tristate "Support for Blokas Labs pisound" -diff --git a/sound/soc/bcm/Makefile b/sound/soc/bcm/Makefile -index 72e1620fa4038035804cf3b2a09c6b12e7ae0fe1..53ea8229d7ac2065176983385dd7ba85ee3915ea 100644 ---- a/sound/soc/bcm/Makefile -+++ b/sound/soc/bcm/Makefile -@@ -34,6 +34,7 @@ snd-soc-dionaudio-loco-v2-objs := dionaudio_loco-v2.o - snd-soc-allo-boss-dac-objs := allo-boss-dac.o - snd-soc-allo-piano-dac-objs := allo-piano-dac.o - snd-soc-allo-piano-dac-plus-objs := allo-piano-dac-plus.o -+snd-soc-allo-digione-objs := allo-digione.o - snd-soc-pisound-objs := pisound.o - snd-soc-fe-pi-audio-objs := fe-pi-audio.o - -@@ -60,5 +61,6 @@ obj-$(CONFIG_SND_BCM2708_SOC_DIONAUDIO_LOCO_V2) += snd-soc-dionaudio-loco-v2.o - obj-$(CONFIG_SND_BCM2708_SOC_ALLO_BOSS_DAC) += snd-soc-allo-boss-dac.o - obj-$(CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC) += snd-soc-allo-piano-dac.o - obj-$(CONFIG_SND_BCM2708_SOC_ALLO_PIANO_DAC_PLUS) += snd-soc-allo-piano-dac-plus.o -+obj-$(CONFIG_SND_BCM2708_SOC_ALLO_DIGIONE) += snd-soc-allo-digione.o - obj-$(CONFIG_SND_PISOUND) += snd-soc-pisound.o - obj-$(CONFIG_SND_BCM2708_SOC_FE_PI_AUDIO) += snd-soc-fe-pi-audio.o -diff --git a/sound/soc/bcm/allo-digione.c b/sound/soc/bcm/allo-digione.c -new file mode 100644 -index 0000000000000000000000000000000000000000..e3664e44c699d0102120ecf99e8b780a4505ebad ---- /dev/null -+++ b/sound/soc/bcm/allo-digione.c -@@ -0,0 +1,268 @@ -+/* -+ * ASoC Driver for Allo DigiOne -+ * -+ * Author: Baswaraj -+ * Copyright 2017 -+ * based on code by Daniel Matuschek -+ * based on code by Florian Meier -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License -+ * version 2 as published by the Free Software Foundation. -+ * -+ * This program is distributed in the hope that it will be useful, but -+ * WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * General Public License for more details. -+ */ -+ -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "../codecs/wm8804.h" -+ -+static short int auto_shutdown_output = 0; -+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"); -+ -+#define CLK_44EN_RATE 22579200UL -+#define CLK_48EN_RATE 24576000UL -+ -+static struct gpio_desc *snd_allo_clk44gpio; -+static struct gpio_desc *snd_allo_clk48gpio; -+ -+static int samplerate = 44100; -+ -+static uint32_t snd_allo_digione_enable_clock(int sample_rate) -+{ -+ switch (sample_rate) { -+ case 11025: -+ case 22050: -+ case 44100: -+ case 88200: -+ case 176400: -+ gpiod_set_value_cansleep(snd_allo_clk44gpio, 1); -+ gpiod_set_value_cansleep(snd_allo_clk48gpio, 0); -+ return CLK_44EN_RATE; -+ default: -+ gpiod_set_value_cansleep(snd_allo_clk48gpio, 1); -+ gpiod_set_value_cansleep(snd_allo_clk44gpio, 0); -+ return CLK_48EN_RATE; -+ } -+} -+ -+ -+static int snd_allo_digione_init(struct snd_soc_pcm_runtime *rtd) -+{ -+ struct snd_soc_codec *codec = rtd->codec; -+ -+ /* enable TX output */ -+ snd_soc_update_bits(codec, WM8804_PWRDN, 0x4, 0x0); -+ -+ return 0; -+} -+ -+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; -+} -+ -+static void snd_allo_digione_shutdown(struct snd_pcm_substream *substream) -+{ -+ /* turn off output */ -+ if (auto_shutdown_output) { -+ /* 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); -+ } -+} -+ -+static int snd_allo_digione_hw_params(struct snd_pcm_substream *substream, -+ struct snd_pcm_hw_params *params) -+{ -+ struct snd_soc_pcm_runtime *rtd = substream->private_data; -+ struct snd_soc_dai *codec_dai = rtd->codec_dai; -+ struct snd_soc_codec *codec = rtd->codec; -+ struct snd_soc_dai *cpu_dai = rtd->cpu_dai; -+ -+ int sysclk = 27000000; /* This is fixed on this board */ -+ -+ long mclk_freq = 0; -+ int mclk_div = 1; -+ int sampling_freq = 1; -+ -+ 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; -+ } -+ -+ 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); -+ } -+ -+ snd_soc_dai_set_clkdiv(codec_dai, WM8804_MCLK_DIV, mclk_div); -+ snd_soc_dai_set_pll(codec_dai, 0, 0, sysclk, mclk_freq); -+ -+ ret = snd_soc_dai_set_sysclk(codec_dai, WM8804_TX_CLKSRC_PLL, -+ sysclk, SND_SOC_CLOCK_OUT); -+ -+ if (ret < 0) { -+ dev_err(codec->dev, -+ "Failed to set WM8804 SYSCLK: %d\n", ret); -+ return ret; -+ } -+ -+ /* Enable TX output */ -+ snd_soc_update_bits(codec, WM8804_PWRDN, 0x4, 0x0); -+ -+ /* Power on */ -+ snd_soc_update_bits(codec, WM8804_PWRDN, 0x9, 0); -+ -+ /* set sampling frequency status bits */ -+ snd_soc_update_bits(codec, WM8804_SPDTX4, 0x0f, sampling_freq); -+ -+ return snd_soc_dai_set_bclk_ratio(cpu_dai, 64); -+} -+ -+/* 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, -+}; -+ -+static struct snd_soc_dai_link snd_allo_digione_dai[] = { -+{ -+ .name = "Allo DigiOne", -+ .stream_name = "Allo DigiOne HiFi", -+ .cpu_dai_name = "bcm2708-i2s.0", -+ .codec_dai_name = "wm8804-spdif", -+ .platform_name = "bcm2708-i2s.0", -+ .codec_name = "wm8804.1-003b", -+ .dai_fmt = SND_SOC_DAIFMT_I2S | -+ SND_SOC_DAIFMT_NB_NF | -+ SND_SOC_DAIFMT_CBM_CFM, -+ .ops = &snd_allo_digione_ops, -+ .init = snd_allo_digione_init, -+}, -+}; -+ -+/* audio machine driver */ -+static struct snd_soc_card snd_allo_digione = { -+ .name = "snd_allo_digione", -+ .driver_name = "AlloDigiOne", -+ .owner = THIS_MODULE, -+ .dai_link = snd_allo_digione_dai, -+ .num_links = ARRAY_SIZE(snd_allo_digione_dai), -+}; -+ -+static int snd_allo_digione_probe(struct platform_device *pdev) -+{ -+ int ret = 0; -+ -+ 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"); -+ } -+ -+ ret = snd_soc_register_card(&snd_allo_digione); -+ if (ret && ret != -EPROBE_DEFER) -+ dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", -+ ret); -+ -+ return ret; -+} -+ -+static int snd_allo_digione_remove(struct platform_device *pdev) -+{ -+ return snd_soc_unregister_card(&snd_allo_digione); -+} -+ -+static const struct of_device_id snd_allo_digione_of_match[] = { -+ { .compatible = "allo,allo-digione", }, -+ {}, -+}; -+MODULE_DEVICE_TABLE(of, snd_allo_digione_of_match); -+ -+static struct platform_driver snd_allo_digione_driver = { -+ .driver = { -+ .name = "snd-allo-digione", -+ .owner = THIS_MODULE, -+ .of_match_table = snd_allo_digione_of_match, -+ }, -+ .probe = snd_allo_digione_probe, -+ .remove = snd_allo_digione_remove, -+}; -+ -+module_platform_driver(snd_allo_digione_driver); -+ -+MODULE_AUTHOR("Baswaraj "); -+MODULE_DESCRIPTION("ASoC Driver for Allo DigiOne"); -+MODULE_LICENSE("GPL v2"); - -From 50e41e07167712f786828ba61b6c7a159601f415 Mon Sep 17 00:00:00 2001 -From: Andrei Gherzan -Date: Mon, 5 Jun 2017 16:40:38 +0100 -Subject: [PATCH 195/201] dma-bcm2708: Fix module compilation of - CONFIG_DMA_BCM2708 - -bcm2708-dmaengine.c defines functions like bcm_dma_start which are -defined as well in dma-bcm2708.h as inline versions when -CONFIG_DMA_BCM2708 is not defined. This works fine when -CONFIG_DMA_BCM2708 is built in, but when it is selected as module build -fails with redefinition errors because in the build system when -CONFIG_DMA_BCM2708 is selected as module, the macro becomes -CONFIG_DMA_BCM2708_MODULE. - -This patch makes the header use CONFIG_DMA_BCM2708_MODULE too when -available. - -Fixes https://github.com/raspberrypi/linux/issues/2056 - -Signed-off-by: Andrei Gherzan ---- - include/linux/platform_data/dma-bcm2708.h | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/include/linux/platform_data/dma-bcm2708.h b/include/linux/platform_data/dma-bcm2708.h -index c5bfff2765be4606077e6c8af73040ec13ee8974..6ca874d332a8bc666b1c9576ac51f479b98de14d 100644 ---- a/include/linux/platform_data/dma-bcm2708.h -+++ b/include/linux/platform_data/dma-bcm2708.h -@@ -75,7 +75,7 @@ struct bcm2708_dma_cb { - struct scatterlist; - struct platform_device; - --#ifdef CONFIG_DMA_BCM2708 -+#if defined(CONFIG_DMA_BCM2708) || defined(CONFIG_DMA_BCM2708_MODULE) - - int bcm_sg_suitable_for_dma(struct scatterlist *sg_ptr, int sg_len); - void bcm_dma_start(void __iomem *dma_chan_base, dma_addr_t control_block); -@@ -138,6 +138,6 @@ static inline int bcm_dmaman_remove(struct platform_device *pdev) - return 0; - } - --#endif /* CONFIG_DMA_BCM2708 */ -+#endif /* CONFIG_DMA_BCM2708 || CONFIG_DMA_BCM2708_MODULE */ - - #endif /* _PLAT_BCM2708_DMA_H */ - -From 9869c9b6f926ef440ed2538d2c6df41ac1740833 Mon Sep 17 00:00:00 2001 -From: popcornmix -Date: Tue, 20 Jun 2017 17:51:47 +0100 -Subject: [PATCH 196/201] bcm2835-cpufreq: Change licence to GPLv2 - -Signed-off-by: Eben Upton -Signed-off-by: Dom Cobley ---- - drivers/cpufreq/bcm2835-cpufreq.c | 36 ++++++++++++++---------------------- - 1 file changed, 14 insertions(+), 22 deletions(-) - -diff --git a/drivers/cpufreq/bcm2835-cpufreq.c b/drivers/cpufreq/bcm2835-cpufreq.c -index 414fbdc10dfbfc6e4bb47870a7af3fd5780f9c9a..99345969b0e4d651fd9033d67de2febb13fc0892 100644 ---- a/drivers/cpufreq/bcm2835-cpufreq.c -+++ b/drivers/cpufreq/bcm2835-cpufreq.c -@@ -1,25 +1,17 @@ --/***************************************************************************** --* Copyright 2011 Broadcom Corporation. All rights reserved. --* --* Unless you and Broadcom execute a separate written software license --* agreement governing use of this software, this software is licensed to you --* under the terms of the GNU General Public License version 2, available at --* http://www.broadcom.com/licenses/GPLv2.php (the "GPL"). --* --* Notwithstanding the above, under no circumstances may you combine this --* software in any way with any other Broadcom software provided under a --* license other than the GPL, without Broadcom's express prior written --* consent. --*****************************************************************************/ -- --/***************************************************************************** --* FILENAME: bcm2835-cpufreq.h --* DESCRIPTION: This driver dynamically manages the CPU Frequency of the ARM --* processor. Messages are sent to Videocore either setting or requesting the --* frequency of the ARM in order to match an appropiate frequency to the current --* usage of the processor. The policy which selects the frequency to use is --* defined in the kernel .config file, but can be changed during runtime. --*****************************************************************************/ -+/* -+ * Copyright 2011 Broadcom Corporation. -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License -+ * as published by the Free Software Foundation; version 2 -+ * of the License. -+ * -+ * This driver dynamically manages the CPU Frequency of the ARM -+ * processor. Messages are sent to Videocore either setting or requesting the -+ * frequency of the ARM in order to match an appropiate frequency to the current -+ * usage of the processor. The policy which selects the frequency to use is -+ * defined in the kernel .config file, but can be changed during runtime. -+ */ - - /* ---------- INCLUDES ---------- */ - #include - -From 8e583f8cfe98442c144733ea0d03839060598eec Mon Sep 17 00:00:00 2001 -From: Eric Anholt -Date: Wed, 21 Jun 2017 09:03:51 -0700 -Subject: [PATCH 197/201] bcm2708: Drop CMA alignment from FKMS mode as well. - -I dropped it from KMS mode in d88274d88ed81de1ade8e18e4c0ed91792ec82ea -and should have done both of them at that time. - -Signed-off-by: Eric Anholt ---- - arch/arm/boot/dts/overlays/vc4-fkms-v3d-overlay.dts | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/arch/arm/boot/dts/overlays/vc4-fkms-v3d-overlay.dts b/arch/arm/boot/dts/overlays/vc4-fkms-v3d-overlay.dts -index 95a595a35cb4fbb707bf4b18161f6a46860aa4ae..36fbf6c8c2e612a6dc5aa02d77cc8173098c16ca 100644 ---- a/arch/arm/boot/dts/overlays/vc4-fkms-v3d-overlay.dts -+++ b/arch/arm/boot/dts/overlays/vc4-fkms-v3d-overlay.dts -@@ -11,35 +11,35 @@ - fragment@0 { - target-path = "/chosen"; - __overlay__ { -- bootargs = "cma=256M@256M"; -+ bootargs = "cma=256M"; - }; - }; - - fragment@1 { - target-path = "/chosen"; - __dormant__ { -- bootargs = "cma=192M@256M"; -+ bootargs = "cma=192M"; - }; - }; - - fragment@2 { - target-path = "/chosen"; - __dormant__ { -- bootargs = "cma=128M@128M"; -+ bootargs = "cma=128M"; - }; - }; - - fragment@3 { - target-path = "/chosen"; - __dormant__ { -- bootargs = "cma=96M@128M"; -+ bootargs = "cma=96M"; - }; - }; - - fragment@4 { - target-path = "/chosen"; - __dormant__ { -- bootargs = "cma=64M@64M"; -+ bootargs = "cma=64M"; - }; - }; - - -From 6eea32d9e00ceed15a9242f0c3b64d8ee46714bd Mon Sep 17 00:00:00 2001 -From: Steve Conner -Date: Thu, 29 Jun 2017 15:56:19 +0100 -Subject: [PATCH 198/201] New i2c-rtc-gpio device overlay (#2092) - -Created new i2c-rtc-gpio device overlay by combining i2c-rtc and i2c-gpio. Tested with PCF2127 on CM3. ---- - arch/arm/boot/dts/overlays/Makefile | 1 + - arch/arm/boot/dts/overlays/README | 41 +++++ - .../arm/boot/dts/overlays/i2c-rtc-gpio-overlay.dts | 183 +++++++++++++++++++++ - 3 files changed, 225 insertions(+) - create mode 100644 arch/arm/boot/dts/overlays/i2c-rtc-gpio-overlay.dts - -diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile -index eca81982c0f19988abd05165fc62a80d26f539cb..8a3131f5a4bc90d4a597b416416953e8e49d41ec 100644 ---- a/arch/arm/boot/dts/overlays/Makefile -+++ b/arch/arm/boot/dts/overlays/Makefile -@@ -42,6 +42,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ - i2c-mux.dtbo \ - i2c-pwm-pca9685a.dtbo \ - i2c-rtc.dtbo \ -+ i2c-rtc-gpio.dtbo \ - i2c-sensor.dtbo \ - i2c0-bcm2708.dtbo \ - i2c1-bcm2708.dtbo \ -diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README -index 19df6883be4277240283d5f63f27e34a22a2eec5..a69e3a0d8dce1633598dd3cd8e00cad9509eee03 100644 ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -662,6 +662,47 @@ Params: abx80x Select one of the ABx80x family: - source - - -+Name: i2c-rtc-gpio -+Info: Adds support for a number of I2C Real Time Clock devices -+ using the software i2c controller -+Load: dtoverlay=i2c-rtc-gpio,= -+Params: abx80x Select one of the ABx80x family: -+ AB0801, AB0803, AB0804, AB0805, -+ AB1801, AB1803, AB1804, AB1805 -+ -+ ds1307 Select the DS1307 device -+ -+ ds1339 Select the DS1339 device -+ -+ ds3231 Select the DS3231 device -+ -+ mcp7940x Select the MCP7940x device -+ -+ mcp7941x Select the MCP7941x device -+ -+ pcf2127 Select the PCF2127 device -+ -+ pcf8523 Select the PCF8523 device -+ -+ pcf8563 Select the PCF8563 device -+ -+ trickle-diode-type Diode type for trickle charge - "standard" or -+ "schottky" (ABx80x only) -+ -+ trickle-resistor-ohms Resistor value for trickle charge (DS1339, -+ ABx80x) -+ -+ wakeup-source Specify that the RTC can be used as a wakeup -+ source -+ -+ i2c_gpio_sda GPIO used for I2C data (default "23") -+ -+ i2c_gpio_scl GPIO used for I2C clock (default "24") -+ -+ i2c_gpio_delay_us Clock delay in microseconds -+ (default "2" = ~100kHz) -+ -+ - Name: i2c-sensor - Info: Adds support for a number of I2C barometric pressure and temperature - sensors on i2c_arm -diff --git a/arch/arm/boot/dts/overlays/i2c-rtc-gpio-overlay.dts b/arch/arm/boot/dts/overlays/i2c-rtc-gpio-overlay.dts -new file mode 100644 -index 0000000000000000000000000000000000000000..8415e6081428fba9a47682964174fc023cfd2b0c ---- /dev/null -+++ b/arch/arm/boot/dts/overlays/i2c-rtc-gpio-overlay.dts -@@ -0,0 +1,183 @@ -+// Definitions for several I2C based Real Time Clocks -+// Available through i2c-gpio -+/dts-v1/; -+/plugin/; -+ -+/ { -+ compatible = "brcm,bcm2708"; -+ -+ fragment@0 { -+ target-path = "/"; -+ __overlay__ { -+ i2c_gpio: i2c-gpio-rtc@0 { -+ compatible = "i2c-gpio"; -+ gpios = <&gpio 23 0 /* sda */ -+ &gpio 24 0 /* scl */ -+ >; -+ i2c-gpio,delay-us = <2>; /* ~100 kHz */ -+ #address-cells = <1>; -+ #size-cells = <0>; -+ }; -+ }; -+ }; -+ -+ fragment@1 { -+ target = <&i2c_gpio>; -+ __dormant__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ -+ abx80x: abx80x@69 { -+ compatible = "abracon,abx80x"; -+ reg = <0x69>; -+ abracon,tc-diode = "standard"; -+ abracon,tc-resistor = <0>; -+ status = "okay"; -+ }; -+ }; -+ }; -+ -+ fragment@2 { -+ target = <&i2c_gpio>; -+ __dormant__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ -+ ds1307: ds1307@68 { -+ compatible = "maxim,ds1307"; -+ reg = <0x68>; -+ status = "okay"; -+ }; -+ }; -+ }; -+ -+ fragment@3 { -+ target = <&i2c_gpio>; -+ __dormant__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ -+ ds1339: ds1339@68 { -+ compatible = "dallas,ds1339"; -+ trickle-resistor-ohms = <0>; -+ reg = <0x68>; -+ status = "okay"; -+ }; -+ }; -+ }; -+ -+ fragment@4 { -+ target = <&i2c_gpio>; -+ __dormant__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ -+ ds3231: ds3231@68 { -+ compatible = "maxim,ds3231"; -+ reg = <0x68>; -+ status = "okay"; -+ }; -+ }; -+ }; -+ -+ fragment@5 { -+ target = <&i2c_gpio>; -+ __dormant__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ -+ mcp7940x: mcp7940x@6f { -+ compatible = "microchip,mcp7940x"; -+ reg = <0x6f>; -+ status = "okay"; -+ }; -+ }; -+ }; -+ -+ fragment@6 { -+ target = <&i2c_gpio>; -+ __dormant__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ -+ mcp7941x: mcp7941x@6f { -+ compatible = "microchip,mcp7941x"; -+ reg = <0x6f>; -+ status = "okay"; -+ }; -+ }; -+ }; -+ -+ fragment@7 { -+ target = <&i2c_gpio>; -+ __dormant__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ -+ pcf2127: pcf2127@51 { -+ compatible = "nxp,pcf2127"; -+ reg = <0x51>; -+ status = "okay"; -+ }; -+ }; -+ }; -+ -+ fragment@8 { -+ target = <&i2c_gpio>; -+ __dormant__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ -+ pcf8523: pcf8523@68 { -+ compatible = "nxp,pcf8523"; -+ reg = <0x68>; -+ status = "okay"; -+ }; -+ }; -+ }; -+ -+ fragment@9 { -+ target = <&i2c_gpio>; -+ __dormant__ { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "okay"; -+ -+ pcf8563: pcf8563@51 { -+ compatible = "nxp,pcf8563"; -+ reg = <0x51>; -+ status = "okay"; -+ }; -+ }; -+ }; -+ -+ __overrides__ { -+ abx80x = <0>,"+1"; -+ ds1307 = <0>,"+2"; -+ ds1339 = <0>,"+3"; -+ ds3231 = <0>,"+4"; -+ mcp7940x = <0>,"+5"; -+ mcp7941x = <0>,"+6"; -+ pcf2127 = <0>,"+7"; -+ pcf8523 = <0>,"+8"; -+ pcf8563 = <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?"; -+ i2c_gpio_sda = <&i2c_gpio>,"gpios:4"; -+ i2c_gpio_scl = <&i2c_gpio>,"gpios:16"; -+ i2c_gpio_delay_us = <&i2c_gpio>,"i2c-gpio,delay-us:0"; -+ }; -+}; - -From 7352f78031df6631f8b51db7701781fce220d91d Mon Sep 17 00:00:00 2001 -From: Allo -Date: Mon, 3 Jul 2017 15:45:20 +0530 -Subject: [PATCH 199/201] PianoPlus: Dual Mono & Dual Stereo features added - (#2069) - ---- - sound/soc/bcm/allo-piano-dac-plus.c | 160 +++++++++++++++++++++++++++++++----- - 1 file changed, 141 insertions(+), 19 deletions(-) - -diff --git a/sound/soc/bcm/allo-piano-dac-plus.c b/sound/soc/bcm/allo-piano-dac-plus.c -index 56e43f98846b41e487b3089813f7edc3c08517eb..d4e99e3c6a383d92fb0cf9e8c1cd1e7657358d49 100644 ---- a/sound/soc/bcm/allo-piano-dac-plus.c -+++ b/sound/soc/bcm/allo-piano-dac-plus.c -@@ -36,6 +36,7 @@ struct dsp_code { - - struct glb_pool { - struct mutex lock; -+ unsigned int dual_mode; - unsigned int set_lowpass; - unsigned int set_mode; - unsigned int set_rate; -@@ -47,8 +48,8 @@ bool glb_mclk; - - static struct gpio_desc *mute_gpio[2]; - -- - static const char * const allo_piano_mode_texts[] = { -+ "None", - "2.0", - "2.1", - "2.2", -@@ -57,6 +58,15 @@ static const char * const allo_piano_mode_texts[] = { - static const SOC_ENUM_SINGLE_DECL(allo_piano_mode_enum, - 0, 0, allo_piano_mode_texts); - -+static const char * const allo_piano_dual_mode_texts[] = { -+ "None", -+ "Dual-Mono", -+ "Dual-Stereo", -+}; -+ -+static const SOC_ENUM_SINGLE_DECL(allo_piano_dual_mode_enum, -+ 0, 0, allo_piano_dual_mode_texts); -+ - static const char * const allo_piano_dsp_low_pass_texts[] = { - "60", - "70", -@@ -82,10 +92,10 @@ static int __snd_allo_piano_dsp_program(struct snd_soc_pcm_runtime *rtd, - unsigned int mode, unsigned int rate, unsigned int lowpass) - { - const struct firmware *fw; -- char firmware_name[60]; -- int ret = 0, dac = 0; - struct snd_soc_card *card = rtd->card; - struct glb_pool *glb_ptr = card->drvdata; -+ char firmware_name[60]; -+ int ret = 0, dac = 0; - - if (rate <= 46000) - rate = 44100; -@@ -100,26 +110,35 @@ static int __snd_allo_piano_dsp_program(struct snd_soc_pcm_runtime *rtd, - else - rate = 192000; - -- if ((lowpass > 14) || (lowpass < 0)) -- lowpass = 3; -- if ((mode > 2) || (mode < 0)) -- mode = 0; -+ if (lowpass > 14) -+ glb_ptr->set_lowpass = lowpass = 3; -+ -+ if (mode > 3) -+ glb_ptr->set_mode = mode = 0; -+ -+ if (mode > 0) -+ glb_ptr->dual_mode = 0; - - /* same configuration loaded */ - if ((rate == glb_ptr->set_rate) && (lowpass == glb_ptr->set_lowpass) - && (mode == glb_ptr->set_mode)) - return 0; - -- if (mode == 0) { /* 2.0 */ -- snd_soc_write(rtd->codec_dais[1]->codec, -- PCM512x_MUTE, 0x11); -+ switch (mode) { -+ case 0: /* None */ -+ 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); - glb_ptr->set_rate = rate; - glb_ptr->set_mode = mode; - glb_ptr->set_lowpass = lowpass; - return 1; -- } else { -- snd_soc_write(rtd->codec_dais[1]->codec, -- PCM512x_MUTE, 0x00); -+ -+ default: -+ snd_soc_write(rtd->codec_dais[0]->codec, PCM512x_MUTE, 0x00); -+ snd_soc_write(rtd->codec_dais[1]->codec, PCM512x_MUTE, 0x00); - } - - for (dac = 0; dac < rtd->num_codecs; dac++) { -@@ -128,13 +147,13 @@ static int __snd_allo_piano_dsp_program(struct snd_soc_pcm_runtime *rtd, - int i = 1; - - if (dac == 0) { /* high */ -- sprintf(firmware_name, -+ snprintf(firmware_name, sizeof(firmware_name), - "allo/piano/2.2/allo-piano-dsp-%d-%d-%d.bin", - rate, ((lowpass * 10) + 60), dac); - } else { /* low */ -- sprintf(firmware_name, -+ snprintf(firmware_name, sizeof(firmware_name), - "allo/piano/2.%d/allo-piano-dsp-%d-%d-%d.bin", -- mode, rate, ((lowpass * 10) + 60), dac); -+ (mode - 1), rate, ((lowpass * 10) + 60), dac); - } - - dev_info(codec->dev, "Dsp Firmware File Name: %s\n", -@@ -199,6 +218,80 @@ static int snd_allo_piano_dsp_program(struct snd_soc_pcm_runtime *rtd, - return ret; - } - -+static int snd_allo_piano_dual_mode_get(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; -+ -+ ucontrol->value.integer.value[0] = glb_ptr->dual_mode; -+ -+ return 0; -+} -+ -+static int snd_allo_piano_dual_mode_put(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; -+ struct snd_card *snd_card_ptr = card->snd_card; -+ struct snd_kcontrol *kctl; -+ struct soc_mixer_control *mc; -+ unsigned int left_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) { -+ if (glb_ptr->set_mode <= 0) { -+ glb_ptr->dual_mode = 1; -+ glb_ptr->set_mode = 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); -+ snd_soc_write(rtd->codec_dais[0]->codec, -+ PCM512x_DIGITAL_VOLUME_3, 0xff); -+ -+ list_for_each_entry(kctl, &snd_card_ptr->controls, list) { -+ if (!strncmp(kctl->id.name, "Digital Playback Volume", -+ sizeof(kctl->id.name))) { -+ mc = (struct soc_mixer_control *) -+ kctl->private_value; -+ mc->rreg = mc->reg; -+ break; -+ } -+ } -+ } else { -+ left_val = snd_soc_read(rtd->codec_dais[0]->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))) { -+ mc = (struct soc_mixer_control *) -+ kctl->private_value; -+ mc->rreg = PCM512x_DIGITAL_VOLUME_3; -+ break; -+ } -+ } -+ -+ 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); -+ } -+ -+ return 0; -+} -+ - static int snd_allo_piano_mode_get(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_value *ucontrol) - { -@@ -215,8 +308,30 @@ static int snd_allo_piano_mode_put(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; -+ struct snd_card *snd_card_ptr = card->snd_card; -+ struct snd_kcontrol *kctl; -+ struct soc_mixer_control *mc; -+ unsigned int left_val = 0; - - rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); -+ -+ if ((glb_ptr->dual_mode == 1) && -+ (ucontrol->value.integer.value[0] > 0)) { -+ left_val = snd_soc_read(rtd->codec_dais[0]->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))) { -+ mc = (struct soc_mixer_control *) -+ kctl->private_value; -+ mc->rreg = PCM512x_DIGITAL_VOLUME_3; -+ break; -+ } -+ } -+ snd_soc_write(rtd->codec_dais[0]->codec, -+ PCM512x_DIGITAL_VOLUME_3, left_val); -+ } -+ - return(snd_allo_piano_dsp_program(rtd, - ucontrol->value.integer.value[0], - glb_ptr->set_rate, glb_ptr->set_lowpass)); -@@ -344,6 +459,11 @@ static const struct snd_kcontrol_new allo_piano_controls[] = { - snd_allo_piano_mode_get, - snd_allo_piano_mode_put), - -+ SOC_ENUM_EXT("Dual Mode Route", -+ allo_piano_dual_mode_enum, -+ snd_allo_piano_dual_mode_get, -+ snd_allo_piano_dual_mode_put), -+ - SOC_ENUM_EXT("Lowpass Route", allo_piano_enum, - snd_allo_piano_lowpass_get, - snd_allo_piano_lowpass_put), -@@ -472,7 +592,7 @@ static int snd_allo_piano_dac_hw_params( - PCM512x_RATE_DET_4); - if (val < 0) { - dev_err(rtd->codec_dais[dac]->codec->dev, -- "Failed to read register PCM512x_RATE_DET_4\n"); -+ "Failed to read register PCM512x_RATE_DET_4\n"); - return val; - } - -@@ -482,7 +602,7 @@ static int snd_allo_piano_dac_hw_params( - PCM512x_SREF_BCK); - - dev_info(rtd->codec_dais[dac]->codec->dev, -- "Setting BCLK as input clock & Enable PLL\n"); -+ "Setting BCLK as input clock & Enable PLL\n"); - } else { - snd_soc_write(rtd->codec_dais[dac]->codec, - PCM512x_PLL_EN, -@@ -493,7 +613,7 @@ static int snd_allo_piano_dac_hw_params( - PCM512x_SREF_SCK); - - dev_info(rtd->codec_dais[dac]->codec->dev, -- "Setting SCLK as input clock & disabled PLL\n"); -+ "Setting SCLK as input clock & disabled PLL\n"); - } - } - -@@ -504,6 +624,7 @@ static int snd_allo_piano_dac_hw_params( - 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) -@@ -521,6 +642,7 @@ static int snd_allo_piano_dac_prepare( - struct snd_soc_card *card = rtd->card; - - snd_allo_piano_gpio_unmute(card); -+ - return 0; - } - - -From cc8001ffcc6659c8db8eeec255cac3c22d662ce1 Mon Sep 17 00:00:00 2001 -From: Matthijs Kooijman -Date: Sun, 9 Jul 2017 15:15:22 +0200 -Subject: [PATCH 200/201] overlays: Add gpio-shutdown overlay (#2103) - -This overlay facilitates the addition of a powerbutton by converting -GPIO edges into KEY_POWER keypresses, which can be handled by -systemd-logind to shut down the system. - -Signed-off-by: Matthijs Kooijman ---- - arch/arm/boot/dts/overlays/Makefile | 1 + - arch/arm/boot/dts/overlays/README | 32 +++++++++ - .../boot/dts/overlays/gpio-shutdown-overlay.dts | 80 ++++++++++++++++++++++ - 3 files changed, 113 insertions(+) - create mode 100644 arch/arm/boot/dts/overlays/gpio-shutdown-overlay.dts - -diff --git a/arch/arm/boot/dts/overlays/Makefile b/arch/arm/boot/dts/overlays/Makefile -index 8a3131f5a4bc90d4a597b416416953e8e49d41ec..c50b1dfa9d7334df47ce087f9d2a7a816afa05ba 100644 ---- a/arch/arm/boot/dts/overlays/Makefile -+++ b/arch/arm/boot/dts/overlays/Makefile -@@ -30,6 +30,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \ - googlevoicehat-soundcard.dtbo \ - gpio-ir.dtbo \ - gpio-poweroff.dtbo \ -+ gpio-shutdown.dtbo \ - hifiberry-amp.dtbo \ - hifiberry-dac.dtbo \ - hifiberry-dacplus.dtbo \ -diff --git a/arch/arm/boot/dts/overlays/README b/arch/arm/boot/dts/overlays/README -index a69e3a0d8dce1633598dd3cd8e00cad9509eee03..e6d777a601c91d192bc5713f9a73e1a2d4d708ef 100644 ---- a/arch/arm/boot/dts/overlays/README -+++ b/arch/arm/boot/dts/overlays/README -@@ -508,6 +508,38 @@ Params: gpiopin GPIO for signalling (default 26) - will also cause the pin to go low. - - -+Name: gpio-shutdown -+Info: Initiates a shutdown when GPIO pin changes. The given GPIO pin -+ is configured as an input key that generates KEY_POWER events. -+ This event is handled by systemd-logind by initiating a -+ shutdown. Systemd versions older than 225 need an udev rule -+ enable listening to the input device: -+ -+ ACTION!="REMOVE", SUBSYSTEM=="input", KERNEL=="event*", \ -+ SUBSYSTEMS=="platform", DRIVERS=="gpio-keys", \ -+ ATTRS{keys}=="116", TAG+="power-switch" -+ -+ This overlay only handles shutdown. After shutdown, the system -+ can be powered up again by driving GPIO3 low. The default -+ configuration uses GPIO3 with a pullup, so if you connect a -+ button between GPIO3 and GND (pin 5 and 6 on the 40-pin header), -+ you get a shutdown and power-up button. -+Load: dtoverlay=gpio-shutdown,= -+Params: gpio_pin GPIO pin to trigger on (default 3) -+ -+ active_low When this is 1 (active low), a falling -+ edge generates a key down event and a -+ rising edge generates a key up event. -+ When this is 0 (active high), this is -+ reversed. The default is 1 (active low). -+ -+ gpio_pull Desired pull-up/down state (off, down, up) -+ Default is "up". -+ -+ Note that the default pin (GPIO3) has an -+ external pullup. -+ -+ - Name: hifiberry-amp - Info: Configures the HifiBerry Amp and Amp+ audio cards - Load: dtoverlay=hifiberry-amp -diff --git a/arch/arm/boot/dts/overlays/gpio-shutdown-overlay.dts b/arch/arm/boot/dts/overlays/gpio-shutdown-overlay.dts -new file mode 100644 -index 0000000000000000000000000000000000000000..863fb395c8539734b658682b900e1fbd96c9443e ---- /dev/null -+++ b/arch/arm/boot/dts/overlays/gpio-shutdown-overlay.dts -@@ -0,0 +1,80 @@ -+// Definitions for gpio-poweroff module -+/dts-v1/; -+/plugin/; -+ -+// This overlay sets up an input device that generates KEY_POWER events -+// when a given GPIO pin changes. It defaults to using GPIO3, which can -+// also be used to wake up (start) the Rpi again after shutdown. Since -+// wakeup is active-low, this defaults to active-low with a pullup -+// enabled, but all of this can be changed using overlay parameters (but -+// note that GPIO3 has an external pullup on at least some boards). -+ -+/ { -+ compatible = "brcm,bcm2708"; -+ -+ fragment@0 { -+ // Configure the gpio pin controller -+ target = <&gpio>; -+ __overlay__ { -+ // Define a pinctrl state, that sets up the gpio -+ // as an input with a pullup enabled. This does -+ // not take effect by itself, only when referenced -+ // by a "pinctrl client", as is done below. See: -+ // https://www.kernel.org/doc/Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt -+ // https://www.kernel.org/doc/Documentation/devicetree/bindings/pinctrl/brcm,bcm2835-gpio.txt -+ pin_state: shutdown_button_pins { -+ brcm,pins = <3>; // gpio number -+ brcm,function = <0>; // 0 = input, 1 = output -+ brcm,pull = <2>; // 0 = none, 1 = pull down, 2 = pull up -+ }; -+ }; -+ }; -+ fragment@1 { -+ // Add a new device to the /soc devicetree node -+ target-path = "/soc"; -+ __overlay__ { -+ shutdown_button { -+ // Let the gpio-keys driver handle this device. See: -+ // https://www.kernel.org/doc/Documentation/devicetree/bindings/input/gpio-keys.txt -+ compatible = "gpio-keys"; -+ -+ // Declare a single pinctrl state (referencing the one declared above) and name it -+ // default, so it is activated automatically. -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pin_state>; -+ -+ // Enable this device -+ status = "okay"; -+ -+ // Define a single key, called "shutdown" that monitors the gpio and sends KEY_POWER -+ // (keycode 116, see -+ // https://github.com/torvalds/linux/blob/v4.12/include/uapi/linux/input-event-codes.h#L190) -+ button: shutdown { -+ label = "shutdown"; -+ linux,code = <116>; // KEY_POWER -+ gpios = <&gpio 3 1>; -+ }; -+ }; -+ }; -+ }; -+ -+ // This defines parameters that can be specified when loading -+ // the overlay. Each foo = line specifies one parameter, named -+ // foo. The rest of the specification gives properties where the -+ // parameter value is inserted into (changing the values above -+ // or adding new ones). -+ __overrides__ { -+ // Allow overriding the GPIO number. -+ gpio_pin = <&button>,"gpios:4", -+ <&pin_state>,"brcm,pins:0"; -+ -+ // Allow changing the internal pullup/down state. 0 = none, 1 = pulldown, 2 = pullup -+ // Note that GPIO3 and GPIO2 are the I2c pins and have an external pullup (at least -+ // on some boards). -+ gpio_pull = <&pin_state>,"brcm,pull:0"; -+ -+ // Allow setting the active_low flag. 0 = active high, 1 = active low -+ active_low = <&button>,"gpios:8"; -+ }; -+ -+}; - -From ac5194854ccca1ae4048af6c4a6b314752b12862 Mon Sep 17 00:00:00 2001 -From: Matthias Reichl -Date: Mon, 10 Jul 2017 11:05:17 +0200 -Subject: [PATCH 201/201] config: enable generic S/PDIF codec drivers (#2104) - -These drivers can be used as dummy ADC/DAC drivers for -attaching general codecs that don't need to be configured. - -This option will build 2 additional drivers, spdif_receiver -and spdif_transmitter. - -Since these drivers have DT bindings they are handy for quick -testing of I2S peripherals with simple-audio-card. - -eg: - -fragment@0 { - target-path = "/"; - __overlay__ { - dummy_receiver: spdif-receiver { - #address-cells = <0>; - #size-cells = <0>; - #sound-dai-cells = <0>; - compatible = "linux,spdif-dir"; - status = "okay"; - }; - }; -}; - -Signed-off-by: Matthias Reichl ---- - 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 7434a6ddd94b121f6ffd9cf518d16b9fda5422b1..7d237499aeb2ebbbf95d96d1459f61f546935630 100644 ---- a/arch/arm/configs/bcm2709_defconfig -+++ b/arch/arm/configs/bcm2709_defconfig -@@ -898,6 +898,7 @@ CONFIG_SND_PISOUND=m - CONFIG_SND_SOC_ADAU1701=m - CONFIG_SND_SOC_ADAU7002=m - CONFIG_SND_SOC_AK4554=m -+CONFIG_SND_SOC_SPDIF=m - CONFIG_SND_SOC_WM8804_I2C=m - CONFIG_SND_SIMPLE_CARD=m - CONFIG_SOUND_PRIME=m -diff --git a/arch/arm/configs/bcmrpi_defconfig b/arch/arm/configs/bcmrpi_defconfig -index f13f9fb0a19424bebe5f3c662c92789ca41be509..dca568d6577cfa71280668e9d08232bff978dfc3 100644 ---- a/arch/arm/configs/bcmrpi_defconfig -+++ b/arch/arm/configs/bcmrpi_defconfig -@@ -892,6 +892,7 @@ CONFIG_SND_PISOUND=m - CONFIG_SND_SOC_ADAU1701=m - CONFIG_SND_SOC_ADAU7002=m - CONFIG_SND_SOC_AK4554=m -+CONFIG_SND_SOC_SPDIF=m - CONFIG_SND_SOC_WM8804_I2C=m - CONFIG_SND_SIMPLE_CARD=m - CONFIG_SOUND_PRIME=m