CONFIG_BACKLIGHT_LCD_SUPPORT=y
CONFIG_BCM2708_DT=y
CONFIG_BCM2708_GPIO=y
-CONFIG_BCM2708_MBOX=y
# CONFIG_BCM2708_NOL2CACHE is not set
CONFIG_BCM2708_VCHIQ=y
CONFIG_BCM2708_VCMEM=y
CONFIG_FB_CFB_FILLRECT=y
CONFIG_FB_CFB_IMAGEBLIT=y
CONFIG_FB_CMDLINE=y
+# CONFIG_FB_RPISENSE is not set
CONFIG_FIQ=y
CONFIG_FIRMWARE_IN_KERNEL=y
# CONFIG_FONTS is not set
CONFIG_LOGO_LINUX_CLUT224=y
# CONFIG_LOGO_LINUX_MONO is not set
# CONFIG_LOGO_LINUX_VGA16 is not set
-# CONFIG_LZ4_COMPRESS is not set
-# CONFIG_LZ4_DECOMPRESS is not set
CONFIG_MACH_BCM2708=y
CONFIG_MAC_PARTITION=y
CONFIG_MAGIC_SYSRQ=y
CONFIG_PROC_PAGE_MONITOR=y
CONFIG_RASPBERRYPI_FIRMWARE=y
CONFIG_RAW_DRIVER=y
-# CONFIG_RCU_EXPEDITE_BOOT is not set
# CONFIG_RCU_STALL_COMMON is not set
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_SCHED_HRTICK=y
# CONFIG_BACKLIGHT_CLASS_DEVICE is not set
CONFIG_BACKLIGHT_LCD_SUPPORT=y
CONFIG_BCM2708_GPIO=y
-CONFIG_BCM2708_MBOX=y
CONFIG_BCM2708_NOL2CACHE=y
CONFIG_BCM2708_VCHIQ=y
CONFIG_BCM2708_VCMEM=y
CONFIG_FB_CFB_FILLRECT=y
CONFIG_FB_CFB_IMAGEBLIT=y
CONFIG_FB_CMDLINE=y
+# CONFIG_FB_RPISENSE is not set
CONFIG_FIQ=y
CONFIG_FIRMWARE_IN_KERNEL=y
# CONFIG_FONTS is not set
CONFIG_LOGO_LINUX_CLUT224=y
# CONFIG_LOGO_LINUX_MONO is not set
# CONFIG_LOGO_LINUX_VGA16 is not set
-# CONFIG_LZ4_COMPRESS is not set
-# CONFIG_LZ4_DECOMPRESS is not set
CONFIG_MACH_BCM2709=y
CONFIG_MAC_PARTITION=y
CONFIG_MAGIC_SYSRQ=y
CONFIG_PROC_PAGE_MONITOR=y
CONFIG_RASPBERRYPI_FIRMWARE=y
CONFIG_RAW_DRIVER=y
-# CONFIG_RCU_EXPEDITE_BOOT is not set
CONFIG_RCU_STALL_COMMON=y
CONFIG_RFS_ACCEL=y
CONFIG_RPS=y
-From 57f6047cdbd633f660b9a859b903503709cc821e Mon Sep 17 00:00:00 2001
+From 6f0468a9f44474189135066bbeb8eecf8d99bebf Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Sun, 12 May 2013 12:24:19 +0100
-Subject: [PATCH 001/121] Main bcm2708/bcm2709 linux port
+Subject: [PATCH 001/148] Main bcm2708/bcm2709 linux port
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
-From eef200f75c4a6f6701f1693f8f59ab2c83d1abcd Mon Sep 17 00:00:00 2001
+From 0dcdc1b4040137f2e273f85355f8bcc431a83ca6 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Wed, 8 Oct 2014 18:50:05 +0100
-Subject: [PATCH 002/121] Add bcm2708_gpio driver
+Subject: [PATCH 002/148] Add bcm2708_gpio driver
Signed-off-by: popcornmix <popcornmix@gmail.com>
-From 6f5003498da677a660cbdfaf9be78d3c0aff2e4c Mon Sep 17 00:00:00 2001
+From 4646501204922076db934dad7ec5c2d170daf104 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
Date: Fri, 1 May 2015 19:11:03 +0200
-Subject: [PATCH 003/121] mailbox: bcm2708: Add bcm2708-vcio
+Subject: [PATCH 003/148] mailbox: bcm2708: Add bcm2708-vcio
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
-From 7c8a47937b598fa8dad4cd50753164b5ee44f8c1 Mon Sep 17 00:00:00 2001
+From a941db3fbb5241762f38ec031140ea47becfaeaa Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Wed, 1 May 2013 19:46:17 +0100
-Subject: [PATCH 004/121] Add dwc_otg driver
+Subject: [PATCH 004/148] Add dwc_otg driver
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
-From 70cf7eac2e13367cb8939741ee140c6bbac32f62 Mon Sep 17 00:00:00 2001
+From 85e2240b7c7cdcaf410a3746c07ceea0504fcf21 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Wed, 1 May 2013 19:54:32 +0100
-Subject: [PATCH 005/121] bcm2708 watchdog driver
+Subject: [PATCH 005/148] bcm2708 watchdog driver
Signed-off-by: popcornmix <popcornmix@gmail.com>
---
-From 6655b0b613cde9e4eb6aacaf43d04a388d8cd6c6 Mon Sep 17 00:00:00 2001
+From 4c7a97f1aaca30131495af59d21e1ba1f4be79d0 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Wed, 17 Jun 2015 17:06:34 +0100
-Subject: [PATCH 006/121] bcm2708 framebuffer driver
+Subject: [PATCH 006/148] bcm2708 framebuffer driver
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
-From 0f8c3ed7803f3a871df49398b678c364aa4929c2 Mon Sep 17 00:00:00 2001
+From 8ac096712e565eea7627dbba7b72c0d13e9798b0 Mon Sep 17 00:00:00 2001
From: Florian Meier <florian.meier@koalo.de>
Date: Fri, 22 Nov 2013 14:22:53 +0100
-Subject: [PATCH 007/121] dmaengine: Add support for BCM2708
+Subject: [PATCH 007/148] dmaengine: Add support for BCM2708
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
-From 0464f674cf3e441b8651c4a5ea0131fa24a3adc4 Mon Sep 17 00:00:00 2001
+From d95bfdd2012a3dc5ae6feea819121d11ead9dbfc Mon Sep 17 00:00:00 2001
From: gellert <gellert@raspberrypi.org>
Date: Fri, 15 Aug 2014 16:35:06 +0100
-Subject: [PATCH 008/121] MMC: added alternative MMC driver
+Subject: [PATCH 008/148] MMC: added alternative MMC driver
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
-From 7bf3e966797438781e11dbc233e17bbe4746bd5b Mon Sep 17 00:00:00 2001
+From 216f8f57dfe55688478495957bfda34d66cde9df Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Wed, 25 Mar 2015 17:49:47 +0000
-Subject: [PATCH 009/121] Adding bcm2835-sdhost driver, and an overlay to
+Subject: [PATCH 009/148] Adding bcm2835-sdhost driver, and an overlay to
enable it
BCM2835 has two SD card interfaces. This driver uses the other one.
-From 2bb9c01de4c90a8b7a9b52be95f504177abeaf45 Mon Sep 17 00:00:00 2001
+From 656283956919c31ba61b1ebbb28531b408ad9cd5 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Wed, 3 Jul 2013 00:31:47 +0100
-Subject: [PATCH 010/121] cma: Add vc_cma driver to enable use of CMA
+Subject: [PATCH 010/148] cma: Add vc_cma driver to enable use of CMA
Signed-off-by: popcornmix <popcornmix@gmail.com>
-From 801a4cbc4ea0f0ffd64b4fa0065be3f791b9d1d0 Mon Sep 17 00:00:00 2001
+From fdd1856ca99e00dcc9edf4373ffd7e6e080b4293 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Mon, 26 Mar 2012 22:15:50 +0100
-Subject: [PATCH 011/121] bcm2708: alsa sound driver
+Subject: [PATCH 011/148] bcm2708: alsa sound driver
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
-From 32495b1b4a656f2388b1dc133278a80616e40994 Mon Sep 17 00:00:00 2001
+From 48dac350e45f5e45aa29fedb1b79247f9b771233 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Tue, 2 Jul 2013 23:42:01 +0100
-Subject: [PATCH 012/121] bcm2708 vchiq driver
+Subject: [PATCH 012/148] bcm2708 vchiq driver
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
-From 8909329c134abdf242dc345a4528e98e86c85c33 Mon Sep 17 00:00:00 2001
+From af60d6d916093924188d0d532dbe181fe58b4e0d Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Wed, 17 Jun 2015 16:07:06 +0100
-Subject: [PATCH 013/121] vc_mem: Add vc_mem driver
+Subject: [PATCH 013/148] vc_mem: Add vc_mem driver
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
-From 3dc51b65ed267fd3cc57feeda298e6c02af5cf82 Mon Sep 17 00:00:00 2001
+From 3ba2f11104537f40460f840d40a2cb3427812310 Mon Sep 17 00:00:00 2001
From: Tim Gover <tgover@broadcom.com>
Date: Tue, 22 Jul 2014 15:41:04 +0100
-Subject: [PATCH 014/121] vcsm: VideoCore shared memory service for BCM2835
+Subject: [PATCH 014/148] vcsm: VideoCore shared memory service for BCM2835
Add experimental support for the VideoCore shared memory service.
This allows user processes to allocate memory from VideoCore's
-From 250314915c749fccd25d98aca0b9a2d29f55ec1c Mon Sep 17 00:00:00 2001
+From b1a1f2fb6ed4ccaf466754512e545cbd5cf7ce3b Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Wed, 3 Jul 2013 00:51:55 +0100
-Subject: [PATCH 015/121] Add hwrng (hardware random number generator) driver
+Subject: [PATCH 015/148] Add hwrng (hardware random number generator) driver
---
drivers/char/hw_random/Kconfig | 13 +++-
-From e074d656e4011eae32577e4d20d7ce6dfa15f6e8 Mon Sep 17 00:00:00 2001
+From 5d006d177c4f6071bfb05594d600eecb35a1e9d3 Mon Sep 17 00:00:00 2001
From: Aron Szabo <aron@aron.ws>
Date: Sat, 16 Jun 2012 12:15:55 +0200
-Subject: [PATCH 016/121] lirc: added support for RaspberryPi GPIO
+Subject: [PATCH 016/148] 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
-From ccdc49f30be0caec97b9b7e4352b8c63eb45acdd Mon Sep 17 00:00:00 2001
+From 327ed0ed75f77f72f17e0c14bbcd30cdab584817 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Wed, 3 Jul 2013 00:49:20 +0100
-Subject: [PATCH 017/121] Add cpufreq driver
+Subject: [PATCH 017/148] Add cpufreq driver
Signed-off-by: popcornmix <popcornmix@gmail.com>
---
-From b7e45ce253f9aa6f3f4b33967b124198d3e2b74f Mon Sep 17 00:00:00 2001
+From 40d8a3f8af68f312479b38b0e704b4fe57c97f4c Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Tue, 26 Mar 2013 19:24:24 +0000
-Subject: [PATCH 018/121] Added hwmon/thermal driver for reporting core
+Subject: [PATCH 018/148] Added hwmon/thermal driver for reporting core
temperature. Thanks Dorian
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
-From f65673287078cca868595a556d8613802e9a1743 Mon Sep 17 00:00:00 2001
+From f35d4ef360d9428cfe544b75ca3aedbf0a19f503 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Wed, 17 Jun 2015 15:41:33 +0100
-Subject: [PATCH 019/121] Add Chris Boot's spi driver.
+Subject: [PATCH 019/148] Add Chris Boot's spi driver.
spi: bcm2708: add device tree support
-From 31dade83cc4f448f81d7d460c59d02b9ebc3b05b Mon Sep 17 00:00:00 2001
+From cc02f1ee1ee91b686290e05cf53df8bc83d03299 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Wed, 17 Jun 2015 15:44:08 +0100
-Subject: [PATCH 020/121] Add Chris Boot's i2c driver
+Subject: [PATCH 020/148] Add Chris Boot's i2c driver
i2c-bcm2708: fixed baudrate
-From 170ee05def27ef6ddedf2561d1dd770c992962b1 Mon Sep 17 00:00:00 2001
+From 6326185c97e8da25bcd0acacb4a0e9b388f6a76f Mon Sep 17 00:00:00 2001
From: Vincent Sanders <vincent.sanders@collabora.co.uk>
Date: Wed, 30 Jan 2013 12:45:18 +0000
-Subject: [PATCH 021/121] bcm2835: add v4l2 camera device
+Subject: [PATCH 021/148] bcm2835: add v4l2 camera device
- Supports raw YUV capture, preview, JPEG and H264.
- Uses videobuf2 for data transfer, using dma_buf.
-From e864404b1afe2fdb0dbd9b3bc5968ea2173fd3e7 Mon Sep 17 00:00:00 2001
+From 1383a48ac698b4253bb3dfac6a7407f58cddfa37 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Fri, 23 Jan 2015 14:48:55 +0000
-Subject: [PATCH 022/121] scripts/dtc: Update to upstream version with overlay
+Subject: [PATCH 022/148] scripts/dtc: Update to upstream version with overlay
patches
---
-From 5b2523aae9c5beb443315a7814633fc740992d07 Mon Sep 17 00:00:00 2001
+From 9c388113f17ae4ea0c516d753d5cf3f69ceb0c87 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Mon, 11 May 2015 09:00:42 +0100
-Subject: [PATCH 023/121] scripts: Add mkknlimg and knlinfo scripts from tools
+Subject: [PATCH 023/148] scripts: Add mkknlimg and knlinfo scripts from tools
repo
The Raspberry Pi firmware looks for a trailer on the kernel image to
-From 73ffc770b510d914757449f9bd52ff5e0b300a52 Mon Sep 17 00:00:00 2001
+From c18bed87cf9c823818221355bbe3508a60221080 Mon Sep 17 00:00:00 2001
From: notro <notro@tronnes.org>
Date: Wed, 9 Jul 2014 14:46:08 +0200
-Subject: [PATCH 025/121] BCM2708: Add core Device Tree support
+Subject: [PATCH 025/148] BCM2708: Add core Device Tree support
Add the bare minimum needed to boot BCM2708 from a Device Tree.
-From 4559e395eaf5d2a4c9af93066c8edc7d184287e3 Mon Sep 17 00:00:00 2001
+From b957660f910ddcf5c7c43ebd20c347d3ef5c220f Mon Sep 17 00:00:00 2001
From: Siarhei Siamashka <siarhei.siamashka@gmail.com>
Date: Mon, 17 Jun 2013 13:32:11 +0300
-Subject: [PATCH 026/121] fbdev: add FBIOCOPYAREA ioctl
+Subject: [PATCH 026/148] fbdev: add FBIOCOPYAREA ioctl
Based on the patch authored by Ali Gholami Rudi at
https://lkml.org/lkml/2009/7/13/153
-From 68d4d166abf2d287a3b333bbae60e2c9c027fa71 Mon Sep 17 00:00:00 2001
+From d8546609674b9071d86c884a750a99be111ff927 Mon Sep 17 00:00:00 2001
From: Harm Hanemaaijer <fgenfb@yahoo.com>
Date: Thu, 20 Jun 2013 20:21:39 +0200
-Subject: [PATCH 029/121] Speed up console framebuffer imageblit function
+Subject: [PATCH 029/148] 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
-From 5e3834b22d4c560ac1354cfff30a6713b6d94e64 Mon Sep 17 00:00:00 2001
+From aa320d01565ccd90b5e6954b63724076cba88ca5 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Tue, 26 Mar 2013 17:26:38 +0000
-Subject: [PATCH 030/121] Allow mac address to be set in smsc95xx
+Subject: [PATCH 030/148] Allow mac address to be set in smsc95xx
Signed-off-by: popcornmix <popcornmix@gmail.com>
---
-From 9c50f6318fdf116e5abaeb05bffa0b65e48ba259 Mon Sep 17 00:00:00 2001
+From 4a703aa1cc152189682c173bb4d89ef8f9da6c21 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Wed, 8 May 2013 11:46:50 +0100
-Subject: [PATCH 031/121] enabling the realtime clock 1-wire chip DS1307 and
+Subject: [PATCH 031/148] 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
-From 0c549d69d2a3c2d068d0364dba73a14d16fc5b22 Mon Sep 17 00:00:00 2001
+From 7df25b626767cc1af02e6a3d1168796638616c96 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Wed, 3 Jul 2013 00:54:08 +0100
-Subject: [PATCH 032/121] Added Device IDs for August DVB-T 205
+Subject: [PATCH 032/148] Added Device IDs for August DVB-T 205
---
drivers/media/usb/dvb-usb-v2/rtl28xxu.c | 4 ++++
-From 2722779be49b7b76dea3de564e03d9fd0083f094 Mon Sep 17 00:00:00 2001
+From 7a190806d076ec3adaab102f8dd2cfaca16c1067 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Wed, 18 Dec 2013 22:16:19 +0000
-Subject: [PATCH 033/121] config: Enable CONFIG_MEMCG, but leave it disabled
+Subject: [PATCH 033/148] config: Enable CONFIG_MEMCG, but leave it disabled
(due to memory cost). Enable with cgroup_enable=memory.
---
-From 27e4ffc36fc9366bfcefe25321191a78460ba1fd Mon Sep 17 00:00:00 2001
+From 6fb867c30ac9a24482bcccd69c146d526c8e89ec Mon Sep 17 00:00:00 2001
From: Florian Meier <florian.meier@koalo.de>
Date: Fri, 22 Nov 2013 14:33:38 +0100
-Subject: [PATCH 034/121] ASoC: Add support for BCM2708
+Subject: [PATCH 034/148] ASoC: Add support for BCM2708
This driver adds support for digital audio (I2S)
for the BCM2708 SoC that is used by the
-From c368e010eacbc50e6a5f527fcc8651ea1cdc5f26 Mon Sep 17 00:00:00 2001
+From 6b65db90e60e189ae7fb310c73f203f422b50a5d Mon Sep 17 00:00:00 2001
From: Florian Meier <florian.meier@koalo.de>
Date: Fri, 22 Nov 2013 14:59:51 +0100
-Subject: [PATCH 035/121] ASoC: Add support for PCM5102A codec
+Subject: [PATCH 035/148] ASoC: Add support for PCM5102A codec
Some definitions to support the PCM5102A codec
by Texas Instruments.
-From 1ae47f91380b552b3bb3adb28f3283be31786064 Mon Sep 17 00:00:00 2001
+From 48e87b89080e40af51338d5966480753b09ef7d3 Mon Sep 17 00:00:00 2001
From: Florian Meier <florian.meier@koalo.de>
Date: Fri, 22 Nov 2013 19:04:54 +0100
-Subject: [PATCH 036/121] BCM2708: Add I2S support to board file
+Subject: [PATCH 036/148] BCM2708: Add I2S support to board file
Adds the required initializations for I2S
to the board file of mach-bcm2708.
-From 65a3e3f912faa5d0c0cdb937b23e641d45608236 Mon Sep 17 00:00:00 2001
+From 0d1e38720f4aacf46480fdfb54b1d699ec08d619 Mon Sep 17 00:00:00 2001
From: Florian Meier <florian.meier@koalo.de>
Date: Fri, 22 Nov 2013 19:19:08 +0100
-Subject: [PATCH 037/121] ASoC: Add support for HifiBerry DAC
+Subject: [PATCH 037/148] ASoC: Add support for HifiBerry DAC
This adds a machine driver for the HifiBerry DAC.
It is a sound card that can
-From 1fee3fa181deb59422ad4f5f08262c8328189370 Mon Sep 17 00:00:00 2001
+From 33a09a3e03ad860ab2783a2ba2f4b79f763ec756 Mon Sep 17 00:00:00 2001
From: Florian Meier <florian.meier@koalo.de>
Date: Fri, 22 Nov 2013 19:21:34 +0100
-Subject: [PATCH 038/121] BCM2708: Add HifiBerry DAC to board file
+Subject: [PATCH 038/148] BCM2708: Add HifiBerry DAC to board file
This adds the initalization of the HifiBerry DAC
to the mach-bcm2708 board file.
-From c5a634c60f6706ba7ffaec669d6ddae793a7b889 Mon Sep 17 00:00:00 2001
+From 2a71fe357bbabc53e589759ad980f9f4645f6d99 Mon Sep 17 00:00:00 2001
From: Florian Meier <florian.meier@koalo.de>
Date: Fri, 6 Dec 2013 20:50:28 +0100
-Subject: [PATCH 039/121] ASoC: BCM2708: Add support for RPi-DAC
+Subject: [PATCH 039/148] ASoC: BCM2708: Add support for RPi-DAC
This adds a machine driver for the RPi-DAC.
-From c739ac8e078de6188449830672c7dd1e5b57af52 Mon Sep 17 00:00:00 2001
+From e6bf0295904cdcd9076615b25e3e9708a7aa26f4 Mon Sep 17 00:00:00 2001
From: Daniel Matuschek <info@crazy-audio.com>
Date: Wed, 15 Jan 2014 21:41:23 +0100
-Subject: [PATCH 040/121] ASoC: wm8804: Implement MCLK configuration options,
+Subject: [PATCH 040/148] 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
-From 7cce7a2fdf84a988e7b23caa129dddbcc7613b10 Mon Sep 17 00:00:00 2001
+From 3c00a5d6f700aadbddae2d1ce66bf1c005e57630 Mon Sep 17 00:00:00 2001
From: Daniel Matuschek <info@crazy-audio.com>
Date: Wed, 15 Jan 2014 21:42:08 +0100
-Subject: [PATCH 041/121] ASoC: BCM:Add support for HiFiBerry Digi. Driver is
+Subject: [PATCH 041/148] ASoC: BCM:Add support for HiFiBerry Digi. Driver is
based on the patched WM8804 driver.
Signed-off-by: Daniel Matuschek <daniel@matuschek.net>
-From 6912c1ddd399d69d7704e9f6445014d40ec21c9b Mon Sep 17 00:00:00 2001
+From ab2549a74dcee90dc017a08091ee4580550aa914 Mon Sep 17 00:00:00 2001
From: Daniel Matuschek <info@crazy-audio.com>
Date: Thu, 16 Jan 2014 07:26:08 +0100
-Subject: [PATCH 042/121] BCM2708: Added support for HiFiBerry Digi board Board
+Subject: [PATCH 042/148] BCM2708: Added support for HiFiBerry Digi board Board
initalization by I2C
Signed-off-by: Daniel Matuschek <daniel@matuschek.net>
-From c1291a2b3390ab53e3a6ca2325e39d0a01908d87 Mon Sep 17 00:00:00 2001
+From 66e9a2c228b82d81b46de10621f4621098e169f9 Mon Sep 17 00:00:00 2001
From: Daniel Matuschek <info@crazy-audio.com>
Date: Thu, 16 Jan 2014 07:36:35 +0100
-Subject: [PATCH 043/121] ASoC: wm8804: Set idle_bias_off to false Idle bias
+Subject: [PATCH 043/148] ASoC: wm8804: Set idle_bias_off to false Idle bias
has been change to remove warning on driver startup
Signed-off-by: Daniel Matuschek <daniel@matuschek.net>
-From 3cefe8f4539e290215418a54ff815913bb658814 Mon Sep 17 00:00:00 2001
+From e2af7e8bdcf9e9ab3899eee75e821ba2976a86c6 Mon Sep 17 00:00:00 2001
From: Gordon Garrity <gordon@iqaudio.com>
Date: Sat, 8 Mar 2014 16:56:57 +0000
-Subject: [PATCH 044/121] Add IQaudIO Sound Card support for Raspberry Pi
+Subject: [PATCH 044/148] Add IQaudIO Sound Card support for Raspberry Pi
Set a limit of 0dB on Digital Volume Control
-From 63dc5102ff1e782a18c891169ef614ff83fd16da Mon Sep 17 00:00:00 2001
+From 8cf49e40e46b9bef3ba7cb250153135329015a0e Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Wed, 18 Jun 2014 13:42:01 +0100
-Subject: [PATCH 045/121] vmstat: Workaround for issue where dirty page count
+Subject: [PATCH 045/148] vmstat: Workaround for issue where dirty page count
goes negative
See:
-From 4b7eb6e29aee506fd82e9eea37b951f0a4101f8a Mon Sep 17 00:00:00 2001
+From ef61715b2dadf9e237c3d3efdff54838dafdc058 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Mon, 14 Jul 2014 22:02:09 +0100
-Subject: [PATCH 046/121] hid: Reduce default mouse polling interval to 60Hz
+Subject: [PATCH 046/148] hid: Reduce default mouse polling interval to 60Hz
Reduces overhead when using X
---
-From e35b74b6335b49387b09d114966b89549a13f1d5 Mon Sep 17 00:00:00 2001
+From 2ed5cd5830ee0d32b50fdb9865c904897eed9bc3 Mon Sep 17 00:00:00 2001
From: Daniel Matuschek <info@crazy-audio.com>
Date: Mon, 4 Aug 2014 10:06:56 +0200
-Subject: [PATCH 047/121] Added support for HiFiBerry DAC+
+Subject: [PATCH 047/148] 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.
-From ee406533a463686db7d11c7ad0f626578c1edcac Mon Sep 17 00:00:00 2001
+From 304bf1caf8484bec3ae645839761b1ed320227c3 Mon Sep 17 00:00:00 2001
From: Daniel Matuschek <info@crazy-audio.com>
Date: Mon, 4 Aug 2014 11:09:58 +0200
-Subject: [PATCH 048/121] Added driver for HiFiBerry Amp amplifier add-on board
+Subject: [PATCH 048/148] 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.
-From b904f76b1090667c9f4741a60da8e60cebc8a91c Mon Sep 17 00:00:00 2001
+From ed44696bbccff9cf2feede419b4e335f18e686ea Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Mon, 13 Apr 2015 19:14:18 +0100
-Subject: [PATCH 049/121] bcm2708: Allow option card devices to be configured
+Subject: [PATCH 049/148] bcm2708: Allow option card devices to be configured
via DT
If the kernel is built with Device Tree support, and if a DT blob
-From 8b4aab9c9a47544e493ba3479ad0e6397e4ea27a Mon Sep 17 00:00:00 2001
+From 7549b31790752c201683aa1d3839eae680b88ba6 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Mon, 13 Apr 2015 18:45:39 +0100
-Subject: [PATCH 050/121] Adding Device Tree support for some RPi audio cards
+Subject: [PATCH 050/148] Adding Device Tree support for some RPi audio cards
---
arch/arm/mach-bcm2709/bcm2709.c | 143 ++++++++++++++++++++++++++++++++++++++
-From bc32dfd7d696d4e3c381344064aabc38961b7f46 Mon Sep 17 00:00:00 2001
+From 98aa7a02be7161b743f1def20715d9c4e21e2a1e Mon Sep 17 00:00:00 2001
From: Timo Kokkonen <tjko@iki.fi>
Date: Wed, 29 Oct 2014 23:30:30 -0700
-Subject: [PATCH 051/121] Added support to reserve/enable a GPIO pin to be used
+Subject: [PATCH 051/148] Added support to reserve/enable a GPIO pin to be used
from pps-gpio module (LinuxPPS). Enable PPS modules in default config for
RPi.
-From 5b706049d22fc0593a14a1d94ebf7f9bf54feeea Mon Sep 17 00:00:00 2001
+From 3dc6b954bfb66e359c10a2e6c947b7eb3d9d93b3 Mon Sep 17 00:00:00 2001
From: Ryan Coe <bluemrp9@gmail.com>
Date: Sat, 31 Jan 2015 18:25:49 -0700
-Subject: [PATCH 052/121] Update ds1307 driver for device-tree support
+Subject: [PATCH 052/148] Update ds1307 driver for device-tree support
Signed-off-by: Ryan Coe <bluemrp9@gmail.com>
---
-From 1578dbee8e10fed1be0f64820fe511dc4b7a720e Mon Sep 17 00:00:00 2001
+From 175e672036450144fc2e984a22dc26dce271ca82 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Fri, 6 Feb 2015 13:50:57 +0000
-Subject: [PATCH 053/121] BCM270x_DT: Add pwr_led, and the required "input"
+Subject: [PATCH 053/148] BCM270x_DT: Add pwr_led, and the required "input"
trigger
The "input" trigger makes the associated GPIO an input. This is to support
-From a926a1d2720eef63b580a4510a9aec4540836d40 Mon Sep 17 00:00:00 2001
+From 39a6ff9b1ecb74c734606429647a9d783c7504f1 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Fri, 20 Jun 2014 17:19:27 +0100
-Subject: [PATCH 054/121] bcm2709: Simplify and strip down IRQ handler
+Subject: [PATCH 054/148] bcm2709: Simplify and strip down IRQ handler
---
arch/arm/include/asm/entry-macro-multi.S | 2 +
-From 39cf4677b7c38fac3da503b75d5cd7efc64dd19a Mon Sep 17 00:00:00 2001
+From d34fbe19c2d2c7bb36c2f6432529f8404144a135 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Thu, 12 Feb 2015 11:17:53 +0000
-Subject: [PATCH 055/121] Fix LED "input" trigger implementation for 3.19
+Subject: [PATCH 055/148] Fix LED "input" trigger implementation for 3.19
---
drivers/leds/leds-gpio.c | 10 +++++++++-
-From d6f122c984a90914b054c16def454ee77a002bad Mon Sep 17 00:00:00 2001
+From 430d332d3e87818f380939f70e9f6ad1d7ee4a56 Mon Sep 17 00:00:00 2001
From: notro <notro@tronnes.org>
Date: Thu, 10 Jul 2014 13:59:47 +0200
-Subject: [PATCH 056/121] pinctrl-bcm2835: Set base to 0 give expected gpio
+Subject: [PATCH 056/148] pinctrl-bcm2835: Set base to 0 give expected gpio
numbering
Signed-off-by: Noralf Tronnes <notro@tronnes.org>
-From 0bb455e4eca847aa74560f58bfd7daa13e9fb496 Mon Sep 17 00:00:00 2001
+From 6a57f03cd6d659fb9851d9da5c56d2273de441b1 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Wed, 4 Feb 2015 10:02:24 +0000
-Subject: [PATCH 057/121] pinctrl-bcm2835: bcm2835_gpio_direction_output must
+Subject: [PATCH 057/148] pinctrl-bcm2835: bcm2835_gpio_direction_output must
set the value
---
-From 1ee5ccaeae81a9acd296d4d3eaba9fa1807b9e17 Mon Sep 17 00:00:00 2001
+From cb824c3bbea4e7a8d970f2b0b6739bb6c739400e Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Tue, 24 Feb 2015 13:40:50 +0000
-Subject: [PATCH 058/121] pinctrl-bcm2835: Fix interrupt handling for GPIOs
+Subject: [PATCH 058/148] pinctrl-bcm2835: Fix interrupt handling for GPIOs
28-31 and 46-53
Contrary to the documentation, the BCM2835 GPIO controller actually has
-From 7e2506a80d3a218bab8db21c947187c92d29812c Mon Sep 17 00:00:00 2001
+From 7b6f8a3a905ffa22aea67b0e0c2ad5551598e01f Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Thu, 26 Feb 2015 09:58:22 +0000
-Subject: [PATCH 059/121] pinctrl-bcm2835: Only request the interrupts listed
+Subject: [PATCH 059/148] pinctrl-bcm2835: Only request the interrupts listed
in the DTB
Although the GPIO controller can generate three interrupts (four counting
-From 69c25727685034a06c041fee3938afba0b84e582 Mon Sep 17 00:00:00 2001
+From c00a18aab58f8f35d01a203d6a6812e9d9c27aad Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Fri, 27 Feb 2015 15:10:24 +0000
-Subject: [PATCH 060/121] enc28j60: Add device tree compatible string and an
+Subject: [PATCH 060/148] enc28j60: Add device tree compatible string and an
overlay
---
-From 9ea362cfd9b8e0b2a8896a713b8b82c0c5834a68 Mon Sep 17 00:00:00 2001
+From 09dce3fc3ac247ed3f09649d03498b50e7bda3f7 Mon Sep 17 00:00:00 2001
From: Waldemar Brodkorb <wbrodkorb@conet.de>
Date: Wed, 25 Mar 2015 09:26:17 +0100
-Subject: [PATCH 061/121] Add driver for rpi-proto
+Subject: [PATCH 061/148] 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
-From db5f1ae7154cf08397ba74b67af282f246a17ddf Mon Sep 17 00:00:00 2001
+From 6bebfa1c83eaef7e74130d772af46882136fe7e6 Mon Sep 17 00:00:00 2001
From: Clive Messer <clive.m.messer@gmail.com>
Date: Thu, 2 Apr 2015 12:22:55 +0100
-Subject: [PATCH 062/121] Add Device Tree support for RPi-DAC.
+Subject: [PATCH 062/148] Add Device Tree support for RPi-DAC.
---
sound/soc/bcm/rpi-dac.c | 21 +++++++++++++++++++++
-From 0fa5223ca68a9c68b92b6ea149fccc42d50c3357 Mon Sep 17 00:00:00 2001
+From 587f77c07d823708192c2d3d9232d9bdd826b845 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Mon, 13 Apr 2015 17:16:29 +0100
-Subject: [PATCH 063/121] config: Add default configs
+Subject: [PATCH 063/148] config: Add default configs
---
arch/arm/configs/bcm2709_defconfig | 1204 ++++++++++++++++++++++++++++++++++++
-From 4fc03ec1bfe73a125775bb06937a246be639dc55 Mon Sep 17 00:00:00 2001
+From 3c0758bef1d20342889a1b8f2a61e1911eef9f5d Mon Sep 17 00:00:00 2001
From: Steve Glendinning <steve.glendinning@smsc.com>
Date: Thu, 19 Feb 2015 18:47:12 +0000
-Subject: [PATCH 064/121] smsx95xx: fix crimes against truesize
+Subject: [PATCH 064/148] 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.
-From 9131a29e8e039bdc5055dad93d41f11a111a13b9 Mon Sep 17 00:00:00 2001
+From 167467c3b8bf94b09d40e60267454dacb90ec8ea Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Fri, 17 Apr 2015 16:58:45 +0100
-Subject: [PATCH 065/121] smsc95xx: Disable turbo mode by default
+Subject: [PATCH 065/148] smsc95xx: Disable turbo mode by default
---
drivers/net/usb/smsc95xx.c | 2 +-
-From 510eb2621d1b1b74618236a324538c19c9106ece Mon Sep 17 00:00:00 2001
+From 3394c3b27330d5d20e11d02210b4e63a53cd22e0 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Fri, 17 Apr 2015 19:30:22 +0100
-Subject: [PATCH 066/121] Add blk_pos parameter to mmc multi_io_quirk callback
+Subject: [PATCH 066/148] Add blk_pos parameter to mmc multi_io_quirk callback
---
drivers/mmc/card/block.c | 1 +
-From d2482f75a64fce6da8a4138f88a6c59cb0de4d9b Mon Sep 17 00:00:00 2001
+From b64bc32acd5a5c13259516a95ae1564ac4b2f1cb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
Date: Wed, 29 Apr 2015 17:24:02 +0200
-Subject: [PATCH 067/121] bcm2835: bcm2835_defconfig
+Subject: [PATCH 067/148] bcm2835: bcm2835_defconfig
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
-From 984698645ff73ed2100b4bfea99ed035139ac721 Mon Sep 17 00:00:00 2001
+From 95bce14bde6d7235c1852cc555624d1f8c110f69 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
Date: Fri, 1 May 2015 23:00:15 +0200
-Subject: [PATCH 068/121] BCM270x_DT: Add mailbox bcm2708-vcio
+Subject: [PATCH 068/148] BCM270x_DT: Add mailbox bcm2708-vcio
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
-From 156ce0fa550bbcb8e63eb60d11ac05cc28c14775 Mon Sep 17 00:00:00 2001
+From 510d194d2dbfafc448fc82f9d74a676f75e96323 Mon Sep 17 00:00:00 2001
From: Gordon Hollingworth <gordon@raspberrypi.org>
Date: Tue, 12 May 2015 14:47:56 +0100
-Subject: [PATCH 069/121] rpi-ft5406: Add touchscreen driver for pi LCD display
+Subject: [PATCH 069/148] rpi-ft5406: Add touchscreen driver for pi LCD display
---
drivers/input/touchscreen/Kconfig | 7 +
-From e2149721bbb442d9f1622bfd0b4c89a892afd88f Mon Sep 17 00:00:00 2001
+From e8c84e58d7e57adb7cd10dd471222eb944b3bc62 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Mon, 13 Oct 2014 11:47:53 +0100
-Subject: [PATCH 070/121] Improve __copy_to_user and __copy_from_user
+Subject: [PATCH 070/148] Improve __copy_to_user and __copy_from_user
performance
Provide a __copy_from_user that uses memcpy. On BCM2708, use
-From 92f76fcdda43617a0f3461741bba9e6d328684da Mon Sep 17 00:00:00 2001
+From 628dbab26b97ba2ea43791e2f1587115dc4e224b Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Wed, 27 May 2015 17:22:15 +0100
-Subject: [PATCH 071/121] bcm2835-audio: Create the platform device if the DT
+Subject: [PATCH 071/148] bcm2835-audio: Create the platform device if the DT
node is disabled
For backwards compatibility, allow the built-in ALSA driver to be enabled
-From e64ab6c66db34627b7765099e815a8c2d4957296 Mon Sep 17 00:00:00 2001
+From 577a59069e50c2c675d7be5c024a1501f24271a4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
Date: Wed, 3 Jun 2015 12:26:13 +0200
-Subject: [PATCH 072/121] ARM: bcm2835: Set Serial number and Revision
+Subject: [PATCH 072/148] ARM: bcm2835: Set Serial number and Revision
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
-From 8a609b1977da490cd177740e61169444383fd8c4 Mon Sep 17 00:00:00 2001
+From 2b0194651fab870c094638cbda17b36d43353e2e Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Tue, 16 Jun 2015 17:47:27 +0100
-Subject: [PATCH 073/121] platform: Add force_core command line setting to boot
+Subject: [PATCH 073/148] platform: Add force_core command line setting to boot
from a different core number
---
-From 2efab5a48bc519a3901b62da297ee5523c91ee58 Mon Sep 17 00:00:00 2001
+From 84aca867e5cb35ba0abdcd4a9963a55e64c31c56 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Thu, 18 Jun 2015 17:46:17 +0100
-Subject: [PATCH 074/121] mach-bcm270x: Enable the building of pinctrl-bcm2835
+Subject: [PATCH 074/148] mach-bcm270x: Enable the building of pinctrl-bcm2835
---
drivers/pinctrl/Makefile | 1 +
-From 436bd2ba164863768b90c2456a943dcfed3b053c Mon Sep 17 00:00:00 2001
+From 10b20886a5c2f337e6607f8bd24dff7fdaa1186d Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Fri, 19 Jun 2015 16:41:39 +0100
-Subject: [PATCH 075/121] BCM270X_DT: Document the i2s-mmap overlay
+Subject: [PATCH 075/148] BCM270X_DT: Document the i2s-mmap overlay
---
arch/arm/boot/dts/overlays/README | 6 ++++++
-From 175d8f77d2fe5ed0d43d53ece08978fd50c97a97 Mon Sep 17 00:00:00 2001
+From 23d5b7edb052559fcac15a305d3f665aa432831c Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Wed, 17 Jun 2015 11:36:53 +0100
-Subject: [PATCH 076/121] bcm2835-sdhost: Improve error handling and recovery
+Subject: [PATCH 076/148] bcm2835-sdhost: Improve error handling and recovery
1) Expose the hw_reset method to the MMC framework, removing many
internal calls by the driver.
-From 48297e4045a1d8a3b2a0edbe6cf371a34c5eb3be Mon Sep 17 00:00:00 2001
+From dc305fc3389b68e35f7ef905884073eb947e52f3 Mon Sep 17 00:00:00 2001
From: Eric Anholt <eric@anholt.net>
Date: Thu, 4 Jun 2015 13:11:46 -0700
-Subject: [PATCH 077/121] ARM: bcm2835: Add the Raspberry Pi firmware driver
+Subject: [PATCH 077/148] ARM: bcm2835: Add the Raspberry Pi firmware driver
This gives us a function for making mailbox property channel requests
of the firmware, which is most notable in that it will let us get and
-From 9762ae8cc9ebb55739cb553f3b2c5bc604aec9e4 Mon Sep 17 00:00:00 2001
+From 4c2c484dd79a0a4f56e31d228cebf9735ce1a9ac Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Sun, 22 Mar 2015 13:33:23 +0000
-Subject: [PATCH 078/121] config: Enable ZSMALLOC, ZRAM and PGTABLE_MAPPING
+Subject: [PATCH 078/148] config: Enable ZSMALLOC, ZRAM and PGTABLE_MAPPING
---
arch/arm/configs/bcm2709_defconfig | 4 ++++
-From dd888666ae9c4f80521f3bbe48edb86b423bb6f6 Mon Sep 17 00:00:00 2001
+From 81aedd19fa0515db2fbb474951be86ca692c394e Mon Sep 17 00:00:00 2001
From: Gordon Hollingworth <gordon@fiveninjas.com>
Date: Mon, 22 Jun 2015 16:27:07 +0100
-Subject: [PATCH 079/121] Add rpi-ft5406 overlay Add rpi-ft5406 driver as
+Subject: [PATCH 079/148] Add rpi-ft5406 overlay Add rpi-ft5406 driver as
module
---
-From afae7dff11e5ee1d5aaf0d00cf26ea3cf24db2d8 Mon Sep 17 00:00:00 2001
+From 94b88ebdb90e6b3ae6eca18355a2ff318041318f Mon Sep 17 00:00:00 2001
From: Gordon Hollingworth <gordon@fiveninjas.com>
Date: Tue, 23 Jun 2015 09:53:40 +0100
-Subject: [PATCH 080/121] Fix driver detection failure Check that the buffer
+Subject: [PATCH 080/148] Fix driver detection failure Check that the buffer
response is non-zero meaning the touchscreen was detected
---
-From 9e053b2e623361aa3a3bbfa298e7b8d33adf7abc Mon Sep 17 00:00:00 2001
+From 5c2ff90c5b6087442f8ba6a9f7bc6557b6db62e8 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Tue, 23 Jun 2015 13:24:01 +0100
-Subject: [PATCH 081/121] config: Enable 8250 serial port
+Subject: [PATCH 081/148] config: Enable 8250 serial port
---
arch/arm/configs/bcm2709_defconfig | 7 +++++++
-From 60300e1082cd46b3ae2732854776ee549e217387 Mon Sep 17 00:00:00 2001
+From 2272606d5aee8fc6f420f3edce8c0ef9f11dc1f0 Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Tue, 23 Jun 2015 14:10:58 +0100
-Subject: [PATCH 082/121] config: Enable POWER_RESET_GPIO
+Subject: [PATCH 082/148] config: Enable POWER_RESET_GPIO
---
arch/arm/configs/bcm2709_defconfig | 2 ++
-From 79796a03fa8311ea9030817db27690f24f72214c Mon Sep 17 00:00:00 2001
+From 9fa64d590a4f206f604b4b78bf61fc17c94e1d5d Mon Sep 17 00:00:00 2001
From: popcornmix <popcornmix@gmail.com>
Date: Fri, 26 Jun 2015 17:37:38 +0100
-Subject: [PATCH 083/121] bcm2708-vcio: Remove restriction of only a single
+Subject: [PATCH 083/148] bcm2708-vcio: Remove restriction of only a single
instance being open
We need more than one process to be able to use mailbox interface (e.g. HW cursor in fbturbo and hello_fft).
-From 6bda1bf0de21592f772c2d65b3e66ddf89d50bdf Mon Sep 17 00:00:00 2001
+From de3f225e647da316e52ed34b4129a6b512f2892f Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Fri, 26 Jun 2015 08:39:19 +0100
-Subject: [PATCH 084/121] BCM270X_DT: Create a "core" clock, use it for SPI and
+Subject: [PATCH 084/148] BCM270X_DT: Create a "core" clock, use it for SPI and
sdhost
---
-From d4a0abb7a644365a9f21204a5e3f530a8112d5e8 Mon Sep 17 00:00:00 2001
+From 016d0929fffe98d94188cff48aa4454e78942855 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Wed, 24 Jun 2015 09:24:31 +0100
-Subject: [PATCH 085/121] BCM270X_DT: Add MCP7941X to i2c-rtc overlay
+Subject: [PATCH 085/148] BCM270X_DT: Add MCP7941X to i2c-rtc overlay
---
arch/arm/boot/dts/overlays/README | 3 +++
-From 54695dcb27d8e4c37e8dd9620e85257b8abb89d8 Mon Sep 17 00:00:00 2001
+From c9695bc0ae507aceb723b385eaf8733b9b8a3c45 Mon Sep 17 00:00:00 2001
From: P33M <P33M@github.com>
Date: Wed, 24 Jun 2015 11:23:06 +0100
-Subject: [PATCH 086/121] dts/overlays: document DHT11 overlay
+Subject: [PATCH 086/148] dts/overlays: document DHT11 overlay
---
arch/arm/boot/dts/overlays/README | 8 ++++++++
-From 842fe412d512dabb76d169395086b6337150015a Mon Sep 17 00:00:00 2001
+From f8d5316066987cfd355c2da083a411ff41515ed4 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Thu, 25 Jun 2015 12:16:11 +0100
-Subject: [PATCH 087/121] gpio-poweroff: Allow it to work on Raspberry Pi
+Subject: [PATCH 087/148] 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
-From 311119b99b34e88df249d706c69bdcffcd8dafb5 Mon Sep 17 00:00:00 2001
+From 23fdc62943363c31ca68bde9e7598fcee9b27cbf Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Wed, 17 Jun 2015 17:10:40 +0100
-Subject: [PATCH 088/121] BCM270x_DT: Default Compute Module i2c, i2s and spi
+Subject: [PATCH 088/148] BCM270x_DT: Default Compute Module i2c, i2s and spi
support
---
-From bd6dabc8c7f6cdaba821ff3246034cd704f6364d Mon Sep 17 00:00:00 2001
+From e9b92372565ede53c177c0edb5417d59c5c5b732 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Mon, 22 Jun 2015 14:21:55 +0100
-Subject: [PATCH 089/121] BCM270X_DT: Sort nodes by bus address, and
+Subject: [PATCH 089/148] BCM270X_DT: Sort nodes by bus address, and
consolidate aliases
---
-From f40ed032e6f0892778bac7d33d45593c0483628b Mon Sep 17 00:00:00 2001
+From fe34b48346183c588118ffe74360b2bc341a51e4 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Mon, 22 Jun 2015 14:23:03 +0100
-Subject: [PATCH 090/121] i2c-bcm2708/BCM270X_DT: Add support for I2C2
+Subject: [PATCH 090/148] i2c-bcm2708/BCM270X_DT: Add support for I2C2
The third I2C bus (I2C2) is normally reserved for HDMI use. Careless
use of this bus can break an attached display - use with caution.
-From 9451939c7a95b4f81886a2bf89f953be1833189d Mon Sep 17 00:00:00 2001
+From 66fd44f83b2525c3ced483c041b5d23d6f0c8a9b Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Mon, 29 Jun 2015 12:14:02 +0100
-Subject: [PATCH 091/121] BCM270X_DT: Correct the lirc-rpi overlay
+Subject: [PATCH 091/148] BCM270X_DT: Correct the lirc-rpi overlay
documentation
The polarity of the "sense" parameter was inverted with respect to reality.
-From d645d31525be338b1baa22916217f3ac0c3705f9 Mon Sep 17 00:00:00 2001
+From cf43a49e4ace4cbf98e135db16d47b4ee1378273 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Thu, 25 Jun 2015 08:47:09 +0100
-Subject: [PATCH 092/121] bcm2835-sdhost: Further improve overclock back-off
+Subject: [PATCH 092/148] bcm2835-sdhost: Further improve overclock back-off
---
drivers/mmc/host/bcm2835-sdhost.c | 144 +++++++++++++++++++++-----------------
-From 11667799f99dca096d4d92e63b7823db2a8f8779 Mon Sep 17 00:00:00 2001
+From 7d7e3c816b4ea9993e03d6ca1c4f4093572b25a8 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Tue, 30 Jun 2015 10:28:59 +0100
-Subject: [PATCH 093/121] i2c-bcm2708: Increase timeouts to allow larger
+Subject: [PATCH 093/148] i2c-bcm2708: Increase timeouts to allow larger
transfers
Use the timeout value provided by the I2C_TIMEOUT ioctl when waiting
-From 04f7264e602d7148822f3a162176190fcc41f71a Mon Sep 17 00:00:00 2001
+From bb1fa51567d23d5ff27e4011257ee25bb97675d8 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Tue, 30 Jun 2015 10:33:52 +0100
-Subject: [PATCH 094/121] spi-bcm2708: Increase timeout from 150ms to 1s
+Subject: [PATCH 094/148] spi-bcm2708: Increase timeout from 150ms to 1s
See: https://github.com/raspberrypi/linux/issues/260
---
-From 2e6c5de15687dadf4c24d880d0cdcb6763aacda5 Mon Sep 17 00:00:00 2001
+From 83a08affef9c792cbb0e986909e734ef9932a12e Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Mon, 15 Jun 2015 09:59:38 +0100
-Subject: [PATCH 095/121] bcm2708-spi: Don't use static pin configuration with
+Subject: [PATCH 095/148] bcm2708-spi: Don't use static pin configuration with
DT
Also remove superfluous error checking - the SPI framework ensures the
-From 699c056af380b45856086c0b33a65acc3d2ad3d8 Mon Sep 17 00:00:00 2001
+From 93ad20e6fe455b39b7bc0c970435a414ca49f09c Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Mon, 15 Jun 2015 10:10:59 +0100
-Subject: [PATCH 096/121] bcm2708-i2s: Don't use static pin configuration with
+Subject: [PATCH 096/148] bcm2708-i2s: Don't use static pin configuration with
DT
---
-From 6b8e6f74b78fcc225c873ea1b07890352dd77ee5 Mon Sep 17 00:00:00 2001
+From 376c2c5f17f41d25e0da6c42544bd337b219af82 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Tue, 30 Jun 2015 14:12:42 +0100
-Subject: [PATCH 097/121] serial: 8250: Don't crash when nr_uarts is 0
+Subject: [PATCH 097/148] serial: 8250: Don't crash when nr_uarts is 0
---
drivers/tty/serial/8250/8250_core.c | 2 ++
-From 5131bc710dd79b98d12c08b2f22477f48fdbd0d3 Mon Sep 17 00:00:00 2001
+From 00a68898d386e94e95cadca325b152b2094909d7 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Fri, 26 Jun 2015 08:50:11 +0100
-Subject: [PATCH 098/121] BCM270X_DT: Add overlay to enable uart1
+Subject: [PATCH 098/148] BCM270X_DT: Add overlay to enable uart1
N.B. The UART1 clock is derived from the core clock. The firmware
will update clock-frequency if core_freq is set, but be aware
-From 72d2ba8d7fa2d47c53ed1425501c2dac2aa909b0 Mon Sep 17 00:00:00 2001
+From f2758fa42f4dc6a584648ce4fdaeab1ba2956cab Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Wed, 24 Jun 2015 14:10:44 +0100
-Subject: [PATCH 099/121] spi-bcm2835: Support pin groups other than 7-11
+Subject: [PATCH 099/148] 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
-From 4bf9c275c9733d1fcf41f6ee70b40e321b39eac1 Mon Sep 17 00:00:00 2001
+From 7b204cc61246f8d36e5c26782ed6db027ece669c Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Tue, 30 Jun 2015 17:37:38 +0100
-Subject: [PATCH 100/121] BCM270X_DT: Change pio_limit of sdhost driver to 1
+Subject: [PATCH 100/148] BCM270X_DT: Change pio_limit of sdhost driver to 1
---
arch/arm/boot/dts/overlays/sdhost-overlay.dts | 2 +-
-From 0ca1e1d7ffdfcf1e716205491a00bf025fb71a77 Mon Sep 17 00:00:00 2001
+From 7b1af4332860714520c332a83e05654a5cee1478 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Wed, 1 Jul 2015 12:51:52 +0100
-Subject: [PATCH 101/121] bcm2835-sdhost: Clear HBLC for PIO mode
+Subject: [PATCH 101/148] bcm2835-sdhost: Clear HBLC for PIO mode
Also update pio_limit default in overlay README.
---
-From f158c5aa486712cfad1c405eb849d65272b2cbc3 Mon Sep 17 00:00:00 2001
+From ee7ce47e28ef800120d1d52bf2aa72cb26192855 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Fri, 3 Jul 2015 12:21:01 +0100
-Subject: [PATCH 102/121] BCM270X_DT: I2S needs function Alt2
+Subject: [PATCH 102/148] BCM270X_DT: I2S needs function Alt2
---
arch/arm/boot/dts/bcm2708-rpi-b-plus.dts | 2 +-
-From 704b53d89697a2542dfa6d23224f49c0d5350abb Mon Sep 17 00:00:00 2001
+From 662a767720003f3283d5222c32e2084b10868069 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
Date: Fri, 26 Jun 2015 14:16:15 +0200
-Subject: [PATCH 103/121] configs: Incorporate v4.1 dependency changes
+Subject: [PATCH 103/148] configs: Incorporate v4.1 dependency changes
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
-From d47845877b27576daac3c55bdb742a43209baaed Mon Sep 17 00:00:00 2001
+From c08762271e447e9a58c5d8bec603aabfd5b0b016 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Fri, 3 Jul 2015 15:47:33 +0100
-Subject: [PATCH 104/121] bcmrpi_defconfigs: Add SND_SOC_WM8804_I2C (for
+Subject: [PATCH 104/148] bcmrpi_defconfigs: Add SND_SOC_WM8804_I2C (for
HifiBerry Digi)
4.1 has split out support for the I2C and SPI variants, so it now
-From a984b5d876c74984fad16d90507b95a50db22fba Mon Sep 17 00:00:00 2001
+From b15b535e7efb3bf2cb60f4194fa2503203d7ace5 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Sat, 4 Jul 2015 19:55:23 +0100
-Subject: [PATCH 105/121] squash: BCM270X_DT: I2S only needs Alt2 on 28-31
+Subject: [PATCH 105/148] squash: BCM270X_DT: I2S only needs Alt2 on 28-31
See: https://github.com/raspberrypi/linux/issues/1046
---
-From edb21286ac7e246dfe7c9ee05101880f719e00e8 Mon Sep 17 00:00:00 2001
+From cc9c5f1595655eee24d4e08d86a1760dc8c7ef36 Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Wed, 8 Jul 2015 14:48:57 +0100
-Subject: [PATCH 106/121] vchiq_arm: Two cacheing fixes
+Subject: [PATCH 106/148] vchiq_arm: Two cacheing fixes
1) Make fragment size vary with cache line size
Without this patch, non-cache-line-aligned transfers may corrupt
-From 265838d467aedd75abf2949373d889cfec090168 Mon Sep 17 00:00:00 2001
+From ee874bae0042910abccd54b90e411a852b4569ef Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Tue, 30 Jun 2015 09:10:36 +0100
-Subject: [PATCH 107/121] BCM270X_DT: Overlay for the Fen Logic VGA666 board
+Subject: [PATCH 107/148] BCM270X_DT: Overlay for the Fen Logic VGA666 board
The VGA666 board requires GPIOs 2-21 (so no I2C or UART). Using the
overlay (instead of a custom dt-blob.bin) has the advantage that it will
-From 5c8148df6f5147fcaa9fe81425b58a3e7a64cdba Mon Sep 17 00:00:00 2001
+From ecc55e30f8eab5fd63c50ff3276ccb77d7d0ce76 Mon Sep 17 00:00:00 2001
From: petit-miner <cooker5000@gmail.com>
Date: Fri, 10 Jul 2015 13:59:18 +0200
-Subject: [PATCH 108/121] Added support for 2 mcp2515 CAN Bus IC
+Subject: [PATCH 108/148] Added support for 2 mcp2515 CAN Bus IC
See: https://github.com/raspberrypi/linux/issues/1018
https://github.com/raspberrypi/linux/pull/1049
-From a097ef23c580bdcad619cca1deabd71eb6237984 Mon Sep 17 00:00:00 2001
+From 97b130d04ed860f89812755c8d576a548b13bd3b Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lkundrak@v3.sk>
Date: Tue, 5 May 2015 13:27:45 -0700
-Subject: [PATCH 109/121] mailbox: Enable BCM2835 mailbox support
+Subject: [PATCH 109/148] mailbox: Enable BCM2835 mailbox support
This mailbox driver provides a single mailbox channel to write 32-bit
values to the VPU and get a 32-bit response. The Raspberry Pi
-From aa1ca835a9a179168f9d8355a458bd0eecda3912 Mon Sep 17 00:00:00 2001
+From 38a0a5c357245cfe2b359277bc38509fa05c268d Mon Sep 17 00:00:00 2001
From: Eric Anholt <eric@anholt.net>
Date: Wed, 13 May 2015 13:10:32 -0700
-Subject: [PATCH 110/121] mailbox/bcm2835: Fix mailbox full detection.
+Subject: [PATCH 110/148] mailbox/bcm2835: Fix mailbox full detection.
With the VC reader blocked and the ARM writing, MAIL0_STA reads empty
permanently while MAIL1_STA goes from empty (0x40000000) to non-empty
-From 36301913195582a2398add6d60477be534d4f603 Mon Sep 17 00:00:00 2001
+From 593a12b7b0e1daaf0cd335a309bd18e68502daab Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
Date: Fri, 26 Jun 2015 14:19:30 +0200
-Subject: [PATCH 111/121] mailbox: bcm2835: Support ARCH_BCM270x
+Subject: [PATCH 111/148] mailbox: bcm2835: Support ARCH_BCM270x
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
-From e3d1e45b4cf84fead585758e48adad894858670c Mon Sep 17 00:00:00 2001
+From fe1043e681b28b6fb83c3ce49b3f15e783e84569 Mon Sep 17 00:00:00 2001
From: Eric Anholt <eric@anholt.net>
Date: Thu, 4 Jun 2015 13:11:47 -0700
-Subject: [PATCH 112/121] ARM: bcm2835: Add the firmware driver information to
+Subject: [PATCH 112/148] ARM: bcm2835: Add the firmware driver information to
the RPi DT
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
-From 4b72dfbcb5e820f4bfdb2ccb423538b2e4821329 Mon Sep 17 00:00:00 2001
+From e7866e5a684f398a01abe84ceaebe0411976f3e9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
Date: Fri, 26 Jun 2015 14:21:20 +0200
-Subject: [PATCH 113/121] firmware: bcm2835: Add missing property tags
+Subject: [PATCH 113/148] firmware: bcm2835: Add missing property tags
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
-From d72c334f7fe3305ae13034ac0562123c26820ade Mon Sep 17 00:00:00 2001
+From 6f0c28f26878f1d675dd660cfaed32822817d4d8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
Date: Fri, 26 Jun 2015 14:25:01 +0200
-Subject: [PATCH 114/121] firmware: bcm2835: Support ARCH_BCM270x
+Subject: [PATCH 114/148] firmware: bcm2835: Support ARCH_BCM270x
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
-From be083fb29207201d3db279f9d5654c5f8c2cb6de Mon Sep 17 00:00:00 2001
+From 40aa3c4f0c430cd5c574498f4d1d5e9f0bc1cf11 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
Date: Fri, 26 Jun 2015 14:26:10 +0200
-Subject: [PATCH 115/121] firmware: bcm2835: Support legacy mailbox API
+Subject: [PATCH 115/148] firmware: bcm2835: Support legacy mailbox API
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
-From becc3412eae55ac3b1642ddc074cb9ca2cbc2e11 Mon Sep 17 00:00:00 2001
+From 9b55578b9e72480f02b317b323b016b250554863 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
Date: Fri, 26 Jun 2015 14:27:06 +0200
-Subject: [PATCH 116/121] char: broadcom: Add vcio module
+Subject: [PATCH 116/148] char: broadcom: Add vcio module
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
-From 3349eaf79dd91c2e6f9b7aed0c155668e4f5a856 Mon Sep 17 00:00:00 2001
+From 96b48f6ba14e6e422f1c1d8a4e193ac1e9922c37 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
Date: Fri, 26 Jun 2015 14:37:19 +0200
-Subject: [PATCH 117/121] BCM270x: Switch to firmware driver
+Subject: [PATCH 117/148] BCM270x: Switch to firmware driver
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
-From 04f82e046133586649c9c9c72b565c2dbccf0e97 Mon Sep 17 00:00:00 2001
+From 8b67d17c70ce88f2ed14aec439e457accce0b37a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
Date: Fri, 26 Jun 2015 14:39:21 +0200
-Subject: [PATCH 118/121] bcm2835: Switch to firmware driver
+Subject: [PATCH 118/148] bcm2835: Switch to firmware driver
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
-From 0dd4dae3071d135836946ab1b990061c0899e9b5 Mon Sep 17 00:00:00 2001
+From 35f9c869b55fa358e089d4394205082c5c825a27 Mon Sep 17 00:00:00 2001
From: Phil Elwell <pelwell@users.noreply.github.com>
Date: Mon, 13 Jul 2015 13:25:31 +0100
-Subject: [PATCH 119/121] Merge pull request #1059 from pelwell/rpi-4.0.y
+Subject: [PATCH 119/148] Merge pull request #1059 from pelwell/rpi-4.0.y
w1_therm: Back-port locking improvements from 4.2-rc1
---
-From 042bc608f4877bcf9dd16db9657a33fcabd1023c Mon Sep 17 00:00:00 2001
+From dd3754783c478d9d4bb5cfc760194362ad195feb Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Tue, 14 Jul 2015 11:11:51 +0100
-Subject: [PATCH 120/121] vchiq_arm: Sort out the vmalloc case
+Subject: [PATCH 120/148] vchiq_arm: Sort out the vmalloc case
See: https://github.com/raspberrypi/linux/issues/1055
---
-From 133b98eee50e70510dbacae5b28a425987499bf8 Mon Sep 17 00:00:00 2001
+From df38d99d8ba198b91a60b770a2e6bc8fa8a444df Mon Sep 17 00:00:00 2001
From: Phil Elwell <phil@raspberrypi.org>
Date: Tue, 14 Jul 2015 10:26:09 +0100
-Subject: [PATCH 121/121] spidev: Add "spidev" compatible string to silence
+Subject: [PATCH 121/148] spidev: Add "spidev" compatible string to silence
warning
See: https://github.com/raspberrypi/linux/issues/1054
--- /dev/null
+From 910b89499e2db97931afa64b0db1b7d7640af3db Mon Sep 17 00:00:00 2001
+From: Phil Elwell <pelwell@users.noreply.github.com>
+Date: Tue, 14 Jul 2015 14:32:47 +0100
+Subject: [PATCH 122/148] Merge pull request #1043 from XECDesign/sense-4.0
+
+mfd: Add Raspberry Pi Sense HAT core driver
+---
+ arch/arm/boot/dts/overlays/Makefile | 1 +
+ arch/arm/boot/dts/overlays/README | 6 +
+ arch/arm/boot/dts/overlays/rpi-sense-overlay.dts | 47 +++++
+ arch/arm/configs/bcm2709_defconfig | 2 +
+ arch/arm/configs/bcmrpi_defconfig | 2 +
+ drivers/input/joystick/Kconfig | 8 +
+ drivers/input/joystick/Makefile | 1 +
+ drivers/input/joystick/rpisense-js.c | 153 +++++++++++++++
+ drivers/mfd/Kconfig | 8 +
+ drivers/mfd/Makefile | 2 +
+ drivers/mfd/rpisense-core.c | 157 +++++++++++++++
+ drivers/video/fbdev/Kconfig | 13 ++
+ drivers/video/fbdev/Makefile | 1 +
+ drivers/video/fbdev/rpisense-fb.c | 235 +++++++++++++++++++++++
+ include/linux/mfd/rpisense/core.h | 47 +++++
+ include/linux/mfd/rpisense/framebuffer.h | 28 +++
+ include/linux/mfd/rpisense/joystick.h | 35 ++++
+ 17 files changed, 746 insertions(+)
+ create mode 100644 arch/arm/boot/dts/overlays/rpi-sense-overlay.dts
+ create mode 100644 drivers/input/joystick/rpisense-js.c
+ create mode 100644 drivers/mfd/rpisense-core.c
+ create mode 100644 drivers/video/fbdev/rpisense-fb.c
+ create mode 100644 include/linux/mfd/rpisense/core.h
+ create mode 100644 include/linux/mfd/rpisense/framebuffer.h
+ create mode 100644 include/linux/mfd/rpisense/joystick.h
+
+--- a/arch/arm/boot/dts/overlays/Makefile
++++ b/arch/arm/boot/dts/overlays/Makefile
+@@ -39,6 +39,7 @@ dtb-$(RPI_DT_OVERLAYS) += rpi-dac-overla
+ dtb-$(RPI_DT_OVERLAYS) += rpi-display-overlay.dtb
+ dtb-$(RPI_DT_OVERLAYS) += rpi-ft5406-overlay.dtb
+ dtb-$(RPI_DT_OVERLAYS) += rpi-proto-overlay.dtb
++dtb-$(RPI_DT_OVERLAYS) += rpi-sense-overlay.dtb
+ dtb-$(RPI_DT_OVERLAYS) += sdhost-overlay.dtb
+ dtb-$(RPI_DT_OVERLAYS) += spi-bcm2708-overlay.dtb
+ dtb-$(RPI_DT_OVERLAYS) += spi-bcm2835-overlay.dtb
+--- a/arch/arm/boot/dts/overlays/README
++++ b/arch/arm/boot/dts/overlays/README
+@@ -442,6 +442,12 @@ Load: dtoverlay=rpi-proto
+ Params: <None>
+
+
++Name: rpi-sense
++Info: Raspberry Pi Sense HAT
++Load: dtoverlay=rpi-sense
++Params: <None>
++
++
+ Name: sdhost
+ Info: Selects the bcm2835-sdhost SD/MMC driver, optionally with overclock
+ Load: dtoverlay=sdhost,<param>=<val>
+--- /dev/null
++++ b/arch/arm/boot/dts/overlays/rpi-sense-overlay.dts
+@@ -0,0 +1,47 @@
++// rpi-sense HAT
++/dts-v1/;
++/plugin/;
++
++/ {
++ compatible = "brcm,bcm2708", "brcm,bcm2709";
++
++ fragment@0 {
++ target = <&i2c1>;
++ __overlay__ {
++ #address-cells = <1>;
++ #size-cells = <0>;
++ status = "okay";
++
++ rpi-sense@46 {
++ compatible = "rpi,rpi-sense";
++ reg = <0x46>;
++ keys-int-gpios = <&gpio 23 1>;
++ status = "okay";
++ };
++
++ lsm9ds1-magn@1c {
++ compatible = "st,lsm9ds1-magn";
++ reg = <0x1c>;
++ status = "okay";
++ };
++
++ lsm9ds1-accel6a {
++ compatible = "st,lsm9ds1-accel";
++ reg = <0x6a>;
++ status = "okay";
++ };
++
++ lps25h-press@5c {
++ compatible = "st,lps25h-press";
++ reg = <0x5c>;
++ status = "okay";
++ };
++
++ hts221-humid@5f {
++ compatible = "st,hts221-humid";
++ reg = <0x5f>;
++ status = "okay";
++ };
++ };
++ };
++};
+--- a/arch/arm/configs/bcm2709_defconfig
++++ b/arch/arm/configs/bcm2709_defconfig
+@@ -533,6 +533,7 @@ CONFIG_JOYSTICK_IFORCE=m
+ CONFIG_JOYSTICK_IFORCE_USB=y
+ CONFIG_JOYSTICK_XPAD=m
+ CONFIG_JOYSTICK_XPAD_FF=y
++CONFIG_JOYSTICK_RPISENSE=m
+ CONFIG_INPUT_TOUCHSCREEN=y
+ CONFIG_TOUCHSCREEN_ADS7846=m
+ CONFIG_TOUCHSCREEN_EGALAX=m
+@@ -789,6 +790,7 @@ CONFIG_VIDEO_MT9V011=m
+ CONFIG_FB=y
+ CONFIG_FB_BCM2708=y
+ CONFIG_FB_SSD1307=m
++CONFIG_FB_RPISENSE=m
+ # CONFIG_BACKLIGHT_GENERIC is not set
+ CONFIG_BACKLIGHT_GPIO=m
+ CONFIG_FRAMEBUFFER_CONSOLE=y
+--- a/arch/arm/configs/bcmrpi_defconfig
++++ b/arch/arm/configs/bcmrpi_defconfig
+@@ -526,6 +526,7 @@ CONFIG_JOYSTICK_IFORCE=m
+ CONFIG_JOYSTICK_IFORCE_USB=y
+ CONFIG_JOYSTICK_XPAD=m
+ CONFIG_JOYSTICK_XPAD_FF=y
++CONFIG_JOYSTICK_RPISENSE=m
+ CONFIG_INPUT_TOUCHSCREEN=y
+ CONFIG_TOUCHSCREEN_ADS7846=m
+ CONFIG_TOUCHSCREEN_EGALAX=m
+@@ -782,6 +783,7 @@ CONFIG_VIDEO_MT9V011=m
+ CONFIG_FB=y
+ CONFIG_FB_BCM2708=y
+ CONFIG_FB_SSD1307=m
++CONFIG_FB_RPISENSE=m
+ # CONFIG_BACKLIGHT_GENERIC is not set
+ CONFIG_BACKLIGHT_GPIO=m
+ CONFIG_FRAMEBUFFER_CONSOLE=y
+--- a/drivers/input/joystick/Kconfig
++++ b/drivers/input/joystick/Kconfig
+@@ -329,4 +329,12 @@ config JOYSTICK_MAPLE
+ To compile this as a module choose M here: the module will be called
+ maplecontrol.
+
++config JOYSTICK_RPISENSE
++ tristate "Raspberry Pi Sense HAT joystick"
++ depends on GPIOLIB && INPUT
++ select MFD_RPISENSE_CORE
++
++ help
++ This is the joystick driver for the Raspberry Pi Sense HAT
++
+ endif
+--- a/drivers/input/joystick/Makefile
++++ b/drivers/input/joystick/Makefile
+@@ -32,4 +32,5 @@ obj-$(CONFIG_JOYSTICK_WARRIOR) += warri
+ obj-$(CONFIG_JOYSTICK_XPAD) += xpad.o
+ obj-$(CONFIG_JOYSTICK_ZHENHUA) += zhenhua.o
+ obj-$(CONFIG_JOYSTICK_WALKERA0701) += walkera0701.o
++obj-$(CONFIG_JOYSTICK_RPISENSE) += rpisense-js.o
+
+--- /dev/null
++++ b/drivers/input/joystick/rpisense-js.c
+@@ -0,0 +1,153 @@
++/*
++ * Raspberry Pi Sense HAT joystick driver
++ * http://raspberrypi.org
++ *
++ * Copyright (C) 2015 Raspberry Pi
++ *
++ * Author: Serge Schneider
++ *
++ * 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; either version 2 of the License, or (at your
++ * option) any later version.
++ *
++ */
++
++#include <linux/module.h>
++
++#include <linux/mfd/rpisense/joystick.h>
++#include <linux/mfd/rpisense/core.h>
++
++struct rpisense *rpisense;
++unsigned char keymap[5] = {KEY_DOWN, KEY_RIGHT, KEY_UP, KEY_ENTER, KEY_LEFT,};
++
++static void keys_work_fn(struct work_struct *work)
++{
++ int i;
++ static s32 prev_keys;
++ struct rpisense_js *rpisense_js = &rpisense->joystick;
++ s32 keys = rpisense_reg_read(rpisense, RPISENSE_KEYS);
++ s32 changes = keys ^ prev_keys;
++
++ prev_keys = keys;
++ for (i = 0; i < 5; i++) {
++ if (changes & 1) {
++ input_report_key(rpisense_js->keys_dev,
++ keymap[i], keys & 1);
++ }
++ changes >>= 1;
++ keys >>= 1;
++ }
++ input_sync(rpisense_js->keys_dev);
++}
++
++static irqreturn_t keys_irq_handler(int irq, void *pdev)
++{
++ struct rpisense_js *rpisense_js = &rpisense->joystick;
++
++ schedule_work(&rpisense_js->keys_work_s);
++ return IRQ_HANDLED;
++}
++
++static int rpisense_js_probe(struct platform_device *pdev)
++{
++ int ret;
++ int i;
++ struct rpisense_js *rpisense_js;
++
++ rpisense = rpisense_get_dev();
++ rpisense_js = &rpisense->joystick;
++
++ INIT_WORK(&rpisense_js->keys_work_s, keys_work_fn);
++
++ rpisense_js->keys_dev = input_allocate_device();
++ if (!rpisense_js->keys_dev) {
++ dev_err(&pdev->dev, "Could not allocate input device.\n");
++ return -ENOMEM;
++ }
++
++ rpisense_js->keys_dev->evbit[0] = BIT_MASK(EV_KEY);
++ for (i = 0; i < ARRAY_SIZE(keymap); i++) {
++ set_bit(keymap[i],
++ rpisense_js->keys_dev->keybit);
++ }
++
++ rpisense_js->keys_dev->name = "Raspberry Pi Sense HAT Joystick";
++ rpisense_js->keys_dev->phys = "rpi-sense-joy/input0";
++ rpisense_js->keys_dev->id.bustype = BUS_I2C;
++ rpisense_js->keys_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP);
++ rpisense_js->keys_dev->keycode = keymap;
++ rpisense_js->keys_dev->keycodesize = sizeof(unsigned char);
++ rpisense_js->keys_dev->keycodemax = ARRAY_SIZE(keymap);
++
++ ret = input_register_device(rpisense_js->keys_dev);
++ if (ret) {
++ dev_err(&pdev->dev, "Could not register input device.\n");
++ goto err_keys_alloc;
++ }
++
++ ret = gpiod_direction_input(rpisense_js->keys_desc);
++ if (ret) {
++ dev_err(&pdev->dev, "Could not set keys-int direction.\n");
++ goto err_keys_reg;
++ }
++
++ rpisense_js->keys_irq = gpiod_to_irq(rpisense_js->keys_desc);
++ if (rpisense_js->keys_irq < 0) {
++ dev_err(&pdev->dev, "Could not determine keys-int IRQ.\n");
++ ret = rpisense_js->keys_irq;
++ goto err_keys_reg;
++ }
++
++ ret = devm_request_irq(&pdev->dev, rpisense_js->keys_irq,
++ keys_irq_handler, IRQF_TRIGGER_RISING,
++ "keys", &pdev->dev);
++ if (ret) {
++ dev_err(&pdev->dev, "IRQ request failed.\n");
++ goto err_keys_reg;
++ }
++ return 0;
++err_keys_reg:
++ input_unregister_device(rpisense_js->keys_dev);
++err_keys_alloc:
++ input_free_device(rpisense_js->keys_dev);
++ return ret;
++}
++
++static int rpisense_js_remove(struct platform_device *pdev)
++{
++ struct rpisense_js *rpisense_js = &rpisense->joystick;
++
++ input_unregister_device(rpisense_js->keys_dev);
++ input_free_device(rpisense_js->keys_dev);
++ return 0;
++}
++
++#ifdef CONFIG_OF
++static const struct of_device_id rpisense_js_id[] = {
++ { .compatible = "rpi,rpi-sense-js" },
++ { },
++};
++MODULE_DEVICE_TABLE(of, rpisense_js_id);
++#endif
++
++static struct platform_device_id rpisense_js_device_id[] = {
++ { .name = "rpi-sense-js" },
++ { },
++};
++MODULE_DEVICE_TABLE(platform, rpisense_js_device_id);
++
++static struct platform_driver rpisense_js_driver = {
++ .probe = rpisense_js_probe,
++ .remove = rpisense_js_remove,
++ .driver = {
++ .name = "rpi-sense-js",
++ .owner = THIS_MODULE,
++ },
++};
++
++module_platform_driver(rpisense_js_driver);
++
++MODULE_DESCRIPTION("Raspberry Pi Sense HAT joystick driver");
++MODULE_AUTHOR("Serge Schneider <serge@raspberrypi.org>");
++MODULE_LICENSE("GPL");
+--- a/drivers/mfd/Kconfig
++++ b/drivers/mfd/Kconfig
+@@ -10,6 +10,14 @@ config MFD_CORE
+ select IRQ_DOMAIN
+ default n
+
++config MFD_RPISENSE_CORE
++ tristate "Raspberry Pi Sense HAT core functions"
++ depends on I2C
++ select MFD_CORE
++ help
++ This is the core driver for the Raspberry Pi Sense HAT. This provides
++ the necessary functions to communicate with the hardware.
++
+ config MFD_CS5535
+ tristate "AMD CS5535 and CS5536 southbridge core functions"
+ select MFD_CORE
+--- a/drivers/mfd/Makefile
++++ b/drivers/mfd/Makefile
+@@ -185,3 +185,5 @@ obj-$(CONFIG_MFD_SKY81452) += sky81452.o
+ intel-soc-pmic-objs := intel_soc_pmic_core.o intel_soc_pmic_crc.o
+ obj-$(CONFIG_INTEL_SOC_PMIC) += intel-soc-pmic.o
+ obj-$(CONFIG_MFD_MT6397) += mt6397-core.o
++
++obj-$(CONFIG_MFD_RPISENSE_CORE) += rpisense-core.o
+--- /dev/null
++++ b/drivers/mfd/rpisense-core.c
+@@ -0,0 +1,157 @@
++/*
++ * Raspberry Pi Sense HAT core driver
++ * http://raspberrypi.org
++ *
++ * Copyright (C) 2015 Raspberry Pi
++ *
++ * Author: Serge Schneider
++ *
++ * 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; either version 2 of the License, or (at your
++ * option) any later version.
++ *
++ * This driver is based on wm8350 implementation.
++ */
++
++#include <linux/module.h>
++#include <linux/moduleparam.h>
++#include <linux/err.h>
++#include <linux/init.h>
++#include <linux/i2c.h>
++#include <linux/platform_device.h>
++#include <linux/mfd/rpisense/core.h>
++#include <linux/slab.h>
++
++struct rpisense *rpisense;
++
++static void rpisense_client_dev_register(struct rpisense *rpisense,
++ const char *name,
++ struct platform_device **pdev)
++{
++ int ret;
++
++ *pdev = platform_device_alloc(name, -1);
++ if (*pdev == NULL) {
++ dev_err(rpisense->dev, "Failed to allocate %s\n", name);
++ return;
++ }
++
++ (*pdev)->dev.parent = rpisense->dev;
++ platform_set_drvdata(*pdev, rpisense);
++ ret = platform_device_add(*pdev);
++ if (ret != 0) {
++ dev_err(rpisense->dev, "Failed to register %s: %d\n",
++ name, ret);
++ platform_device_put(*pdev);
++ *pdev = NULL;
++ }
++}
++
++static int rpisense_probe(struct i2c_client *i2c,
++ const struct i2c_device_id *id)
++{
++ int ret;
++ struct rpisense_js *rpisense_js;
++
++ rpisense = devm_kzalloc(&i2c->dev, sizeof(struct rpisense), GFP_KERNEL);
++ if (rpisense == NULL)
++ return -ENOMEM;
++
++ i2c_set_clientdata(i2c, rpisense);
++ rpisense->dev = &i2c->dev;
++ rpisense->i2c_client = i2c;
++
++ ret = rpisense_reg_read(rpisense, RPISENSE_WAI);
++ if (ret > 0) {
++ if (ret != 's')
++ return -EINVAL;
++ } else {
++ return ret;
++ }
++ ret = rpisense_reg_read(rpisense, RPISENSE_VER);
++ if (ret < 0)
++ return ret;
++
++ dev_info(rpisense->dev,
++ "Raspberry Pi Sense HAT firmware version %i\n", ret);
++
++ rpisense_js = &rpisense->joystick;
++ rpisense_js->keys_desc = devm_gpiod_get(&i2c->dev,
++ "keys-int", GPIOD_IN);
++ if (IS_ERR(rpisense_js->keys_desc)) {
++ dev_warn(&i2c->dev, "Failed to get keys-int descriptor.\n");
++ rpisense_js->keys_desc = gpio_to_desc(23);
++ if (rpisense_js->keys_desc == NULL) {
++ dev_err(&i2c->dev, "GPIO23 fallback failed.\n");
++ return PTR_ERR(rpisense_js->keys_desc);
++ }
++ }
++ rpisense_client_dev_register(rpisense, "rpi-sense-js",
++ &(rpisense->joystick.pdev));
++ rpisense_client_dev_register(rpisense, "rpi-sense-fb",
++ &(rpisense->framebuffer.pdev));
++
++ return 0;
++}
++
++static int rpisense_remove(struct i2c_client *i2c)
++{
++ struct rpisense *rpisense = i2c_get_clientdata(i2c);
++
++ platform_device_unregister(rpisense->joystick.pdev);
++ return 0;
++}
++
++struct rpisense *rpisense_get_dev(void)
++{
++ return rpisense;
++}
++EXPORT_SYMBOL_GPL(rpisense_get_dev);
++
++s32 rpisense_reg_read(struct rpisense *rpisense, int reg)
++{
++ int ret = i2c_smbus_read_byte_data(rpisense->i2c_client, reg);
++
++ if (ret < 0)
++ dev_err(rpisense->dev, "Read from reg %d failed\n", reg);
++ /* Due to the BCM270x I2C clock stretching bug, some values
++ * may have MSB set. Clear it to avoid incorrect values.
++ * */
++ return ret & 0x7F;
++}
++EXPORT_SYMBOL_GPL(rpisense_reg_read);
++
++int rpisense_block_write(struct rpisense *rpisense, const char *buf, int count)
++{
++ int ret = i2c_master_send(rpisense->i2c_client, buf, count);
++
++ if (ret < 0)
++ dev_err(rpisense->dev, "Block write failed\n");
++ return ret;
++}
++EXPORT_SYMBOL_GPL(rpisense_block_write);
++
++static const struct i2c_device_id rpisense_i2c_id[] = {
++ { "rpi-sense", 0 },
++ { }
++};
++MODULE_DEVICE_TABLE(i2c, rpisense_i2c_id);
++
++
++static struct i2c_driver rpisense_driver = {
++ .driver = {
++ .name = "rpi-sense",
++ .owner = THIS_MODULE,
++ },
++ .probe = rpisense_probe,
++ .remove = rpisense_remove,
++ .id_table = rpisense_i2c_id,
++};
++
++module_i2c_driver(rpisense_driver);
++
++MODULE_DESCRIPTION("Raspberry Pi Sense HAT core driver");
++MODULE_AUTHOR("Serge Schneider <serge@raspberrypi.org>");
++MODULE_LICENSE("GPL");
++
+--- a/drivers/video/fbdev/Kconfig
++++ b/drivers/video/fbdev/Kconfig
+@@ -2495,3 +2495,16 @@ config FB_SSD1307
+ help
+ This driver implements support for the Solomon SSD1307
+ OLED controller over I2C.
++
++config FB_RPISENSE
++ tristate "Raspberry Pi Sense HAT framebuffer"
++ depends on FB
++ select MFD_RPISENSE_CORE
++ select FB_SYS_FOPS
++ select FB_SYS_FILLRECT
++ select FB_SYS_COPYAREA
++ select FB_SYS_IMAGEBLIT
++ select FB_DEFERRED_IO
++
++ help
++ This is the framebuffer driver for the Raspberry Pi Sense HAT
+--- a/drivers/video/fbdev/Makefile
++++ b/drivers/video/fbdev/Makefile
+@@ -150,6 +150,7 @@ obj-$(CONFIG_FB_DA8XX) += da8xx-fb.o
+ obj-$(CONFIG_FB_MXS) += mxsfb.o
+ obj-$(CONFIG_FB_SSD1307) += ssd1307fb.o
+ obj-$(CONFIG_FB_SIMPLE) += simplefb.o
++obj-$(CONFIG_FB_RPISENSE) += rpisense-fb.o
+
+ # the test framebuffer is last
+ obj-$(CONFIG_FB_VIRTUAL) += vfb.o
+--- /dev/null
++++ b/drivers/video/fbdev/rpisense-fb.c
+@@ -0,0 +1,235 @@
++/*
++ * Raspberry Pi Sense HAT framebuffer driver
++ * http://raspberrypi.org
++ *
++ * Copyright (C) 2015 Raspberry Pi
++ *
++ * Author: Serge Schneider
++ *
++ * 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; either version 2 of the License, or (at your
++ * option) any later version.
++ *
++ */
++
++#include <linux/module.h>
++#include <linux/kernel.h>
++#include <linux/errno.h>
++#include <linux/string.h>
++#include <linux/mm.h>
++#include <linux/slab.h>
++#include <linux/delay.h>
++#include <linux/fb.h>
++#include <linux/init.h>
++
++#include <linux/mfd/rpisense/framebuffer.h>
++#include <linux/mfd/rpisense/core.h>
++
++struct rpisense *rpisense;
++
++struct rpisense_fb_param {
++ char __iomem *vmem;
++ u8 *vmem_work;
++ u32 vmemsize;
++ u8 gamma[32];
++};
++
++static struct rpisense_fb_param rpisense_fb_param = {
++ .vmem = NULL,
++ .vmemsize = 128,
++ .gamma = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
++ 0x02, 0x02, 0x03, 0x03, 0x04, 0x05, 0x06, 0x07,
++ 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0E, 0x0F, 0x11,
++ 0x12, 0x14, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F,},
++};
++
++static struct fb_deferred_io rpisense_fb_defio;
++
++static struct fb_fix_screeninfo rpisense_fb_fix = {
++ .id = "RPi-Sense FB",
++ .type = FB_TYPE_PACKED_PIXELS,
++ .visual = FB_VISUAL_TRUECOLOR,
++ .xpanstep = 0,
++ .ypanstep = 0,
++ .ywrapstep = 0,
++ .accel = FB_ACCEL_NONE,
++ .line_length = 16,
++};
++
++static struct fb_var_screeninfo rpisense_fb_var = {
++ .xres = 8,
++ .yres = 8,
++ .xres_virtual = 8,
++ .yres_virtual = 8,
++ .bits_per_pixel = 16,
++ .red = {11, 5, 0},
++ .green = {5, 6, 0},
++ .blue = {0, 5, 0},
++};
++
++static ssize_t rpisense_fb_write(struct fb_info *info,
++ const char __user *buf, size_t count,
++ loff_t *ppos)
++{
++ ssize_t res = fb_sys_write(info, buf, count, ppos);
++
++ schedule_delayed_work(&info->deferred_work, rpisense_fb_defio.delay);
++ return res;
++}
++
++static void rpisense_fb_fillrect(struct fb_info *info,
++ const struct fb_fillrect *rect)
++{
++ sys_fillrect(info, rect);
++ schedule_delayed_work(&info->deferred_work, rpisense_fb_defio.delay);
++}
++
++static void rpisense_fb_copyarea(struct fb_info *info,
++ const struct fb_copyarea *area)
++{
++ sys_copyarea(info, area);
++ schedule_delayed_work(&info->deferred_work, rpisense_fb_defio.delay);
++}
++
++static void rpisense_fb_imageblit(struct fb_info *info,
++ const struct fb_image *image)
++{
++ sys_imageblit(info, image);
++ schedule_delayed_work(&info->deferred_work, rpisense_fb_defio.delay);
++}
++
++static void rpisense_fb_deferred_io(struct fb_info *info,
++ struct list_head *pagelist)
++{
++ int i;
++ int j;
++ u8 *vmem_work = rpisense_fb_param.vmem_work;
++ u16 *mem = (u16 *)rpisense_fb_param.vmem;
++ u8 *gamma = rpisense_fb_param.gamma;
++
++ vmem_work[0] = 0;
++ for (j = 0; j < 8; j++) {
++ for (i = 0; i < 8; i++) {
++ vmem_work[(j * 24) + i + 1] =
++ gamma[(mem[(j * 8) + i] >> 11) & 0x1F];
++ vmem_work[(j * 24) + (i + 8) + 1] =
++ gamma[(mem[(j * 8) + i] >> 6) & 0x1F];
++ vmem_work[(j * 24) + (i + 16) + 1] =
++ gamma[(mem[(j * 8) + i]) & 0x1F];
++ }
++ }
++ rpisense_block_write(rpisense, vmem_work, 193);
++}
++
++static struct fb_deferred_io rpisense_fb_defio = {
++ .delay = HZ/100,
++ .deferred_io = rpisense_fb_deferred_io,
++};
++
++static struct fb_ops rpisense_fb_ops = {
++ .owner = THIS_MODULE,
++ .fb_read = fb_sys_read,
++ .fb_write = rpisense_fb_write,
++ .fb_fillrect = rpisense_fb_fillrect,
++ .fb_copyarea = rpisense_fb_copyarea,
++ .fb_imageblit = rpisense_fb_imageblit,
++};
++
++static int rpisense_fb_probe(struct platform_device *pdev)
++{
++ struct fb_info *info;
++ int ret = -ENOMEM;
++ struct rpisense_fb *rpisense_fb;
++
++ rpisense = rpisense_get_dev();
++ rpisense_fb = &rpisense->framebuffer;
++
++ rpisense_fb_param.vmem = vzalloc(rpisense_fb_param.vmemsize);
++ if (!rpisense_fb_param.vmem)
++ return ret;
++
++ rpisense_fb_param.vmem_work = devm_kmalloc(&pdev->dev, 193, GFP_KERNEL);
++ if (!rpisense_fb_param.vmem_work)
++ goto err_malloc;
++
++ info = framebuffer_alloc(0, &pdev->dev);
++ if (!info) {
++ dev_err(&pdev->dev, "Could not allocate framebuffer.\n");
++ goto err_malloc;
++ }
++ rpisense_fb->info = info;
++
++ rpisense_fb_fix.smem_start = (unsigned long)rpisense_fb_param.vmem;
++ rpisense_fb_fix.smem_len = rpisense_fb_param.vmemsize;
++
++ info->fbops = &rpisense_fb_ops;
++ info->fix = rpisense_fb_fix;
++ info->var = rpisense_fb_var;
++ info->fbdefio = &rpisense_fb_defio;
++ info->flags = FBINFO_FLAG_DEFAULT | FBINFO_VIRTFB;
++ info->screen_base = rpisense_fb_param.vmem;
++ info->screen_size = rpisense_fb_param.vmemsize;
++
++ fb_deferred_io_init(info);
++
++ ret = register_framebuffer(info);
++ if (ret < 0) {
++ dev_err(&pdev->dev, "Could not register framebuffer.\n");
++ goto err_fballoc;
++ }
++
++ fb_info(info, "%s frame buffer device\n", info->fix.id);
++ schedule_delayed_work(&info->deferred_work, rpisense_fb_defio.delay);
++ return 0;
++err_fballoc:
++ framebuffer_release(info);
++err_malloc:
++ vfree(rpisense_fb_param.vmem);
++ return ret;
++}
++
++static int rpisense_fb_remove(struct platform_device *pdev)
++{
++ struct rpisense_fb *rpisense_fb = &rpisense->framebuffer;
++ struct fb_info *info = rpisense_fb->info;
++
++ if (info) {
++ unregister_framebuffer(info);
++ fb_deferred_io_cleanup(info);
++ framebuffer_release(info);
++ vfree(rpisense_fb_param.vmem);
++ }
++
++ return 0;
++}
++
++#ifdef CONFIG_OF
++static const struct of_device_id rpisense_fb_id[] = {
++ { .compatible = "rpi,rpi-sense-fb" },
++ { },
++};
++MODULE_DEVICE_TABLE(of, rpisense_fb_id);
++#endif
++
++static struct platform_device_id rpisense_fb_device_id[] = {
++ { .name = "rpi-sense-fb" },
++ { },
++};
++MODULE_DEVICE_TABLE(platform, rpisense_fb_device_id);
++
++static struct platform_driver rpisense_fb_driver = {
++ .probe = rpisense_fb_probe,
++ .remove = rpisense_fb_remove,
++ .driver = {
++ .name = "rpi-sense-fb",
++ .owner = THIS_MODULE,
++ },
++};
++
++module_platform_driver(rpisense_fb_driver);
++
++MODULE_DESCRIPTION("Raspberry Pi Sense HAT framebuffer driver");
++MODULE_AUTHOR("Serge Schneider <serge@raspberrypi.org>");
++MODULE_LICENSE("GPL");
++
+--- /dev/null
++++ b/include/linux/mfd/rpisense/core.h
+@@ -0,0 +1,47 @@
++/*
++ * Raspberry Pi Sense HAT core driver
++ * http://raspberrypi.org
++ *
++ * Copyright (C) 2015 Raspberry Pi
++ *
++ * Author: Serge Schneider
++ *
++ * 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; either version 2 of the License, or (at your
++ * option) any later version.
++ *
++ */
++
++#ifndef __LINUX_MFD_RPISENSE_CORE_H_
++#define __LINUX_MFD_RPISENSE_CORE_H_
++
++#include <linux/mfd/rpisense/joystick.h>
++#include <linux/mfd/rpisense/framebuffer.h>
++
++/*
++ * Register values.
++ */
++#define RPISENSE_FB 0x00
++#define RPISENSE_WAI 0xF0
++#define RPISENSE_VER 0xF1
++#define RPISENSE_KEYS 0xF2
++#define RPISENSE_EE_WP 0xF3
++
++#define RPISENSE_ID 's'
++
++struct rpisense {
++ struct device *dev;
++ struct i2c_client *i2c_client;
++
++ /* Client devices */
++ struct rpisense_js joystick;
++ struct rpisense_fb framebuffer;
++};
++
++struct rpisense *rpisense_get_dev(void);
++s32 rpisense_reg_read(struct rpisense *rpisense, int reg);
++int rpisense_reg_write(struct rpisense *rpisense, int reg, u16 val);
++int rpisense_block_write(struct rpisense *rpisense, const char *buf, int count);
++
++#endif
+--- /dev/null
++++ b/include/linux/mfd/rpisense/framebuffer.h
+@@ -0,0 +1,28 @@
++/*
++ * Raspberry Pi Sense HAT framebuffer driver
++ * http://raspberrypi.org
++ *
++ * Copyright (C) 2015 Raspberry Pi
++ *
++ * Author: Serge Schneider
++ *
++ * 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; either version 2 of the License, or (at your
++ * option) any later version.
++ *
++ */
++
++#ifndef __LINUX_RPISENSE_FB_H_
++#define __LINUX_RPISENSE_FB_H_
++
++#include <linux/platform_device.h>
++
++struct rpisense;
++
++struct rpisense_fb {
++ struct platform_device *pdev;
++ struct fb_info *info;
++};
++
++#endif
+--- /dev/null
++++ b/include/linux/mfd/rpisense/joystick.h
+@@ -0,0 +1,35 @@
++/*
++ * Raspberry Pi Sense HAT joystick driver
++ * http://raspberrypi.org
++ *
++ * Copyright (C) 2015 Raspberry Pi
++ *
++ * Author: Serge Schneider
++ *
++ * 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; either version 2 of the License, or (at your
++ * option) any later version.
++ *
++ */
++
++#ifndef __LINUX_RPISENSE_JOYSTICK_H_
++#define __LINUX_RPISENSE_JOYSTICK_H_
++
++#include <linux/input.h>
++#include <linux/interrupt.h>
++#include <linux/gpio/consumer.h>
++#include <linux/platform_device.h>
++
++struct rpisense;
++
++struct rpisense_js {
++ struct platform_device *pdev;
++ struct input_dev *keys_dev;
++ struct gpio_desc *keys_desc;
++ struct work_struct keys_work_s;
++ int keys_irq;
++};
++
++
++#endif
--- /dev/null
+From b0482b8fe870cfc43e4f9a00470b267f27900ce7 Mon Sep 17 00:00:00 2001
+From: Phil Elwell <phil@raspberrypi.org>
+Date: Wed, 15 Jul 2015 13:46:08 +0100
+Subject: [PATCH 123/148] leds-gpio: Implement the brightness_get method
+
+The power LED uses some clever logic that means it is driven
+by a voltage measuring circuit when configured as input, otherwise
+it is driven by the GPIO output value. This patch wires up the
+brightness_get method for leds-gpio so that user-space can monitor
+the LED value via /sys/class/gpio/led1/brightness. Using the input
+trigger this returns an indication of the system power health,
+otherwise it is just whatever value the trigger has written most
+recently.
+
+See: https://github.com/raspberrypi/linux/issues/1064
+---
+ drivers/leds/leds-gpio.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+--- a/drivers/leds/leds-gpio.c
++++ b/drivers/leds/leds-gpio.c
+@@ -82,6 +82,13 @@ static void gpio_led_set(struct led_clas
+ }
+ }
+
++static enum led_brightness gpio_led_get(struct led_classdev *led_cdev)
++{
++ struct gpio_led_data *led_dat =
++ container_of(led_cdev, struct gpio_led_data, cdev);
++ return gpiod_get_value_cansleep(led_dat->gpiod) ? LED_FULL : LED_OFF;
++}
++
+ static int gpio_blink_set(struct led_classdev *led_cdev,
+ unsigned long *delay_on, unsigned long *delay_off)
+ {
+@@ -138,6 +145,7 @@ static int create_gpio_led(const struct
+ 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);
+ else
--- /dev/null
+From 176730440c132bf74f6f7a7e34b6b9b087e1b55f Mon Sep 17 00:00:00 2001
+From: Robert Tiemann <rtie@gmx.de>
+Date: Fri, 17 Jul 2015 09:50:55 +0200
+Subject: [PATCH 124/148] dmaengine: bcm2708-dmaengine: Fix memory leak when
+ stopping a running transfer
+
+---
+ drivers/dma/bcm2708-dmaengine.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/dma/bcm2708-dmaengine.c
++++ b/drivers/dma/bcm2708-dmaengine.c
+@@ -964,6 +964,7 @@ static int bcm2835_dma_terminate_all(str
+ * c->desc is NULL and exit.)
+ */
+ if (c->desc) {
++ bcm2835_dma_desc_free(&c->desc->vd);
+ c->desc = NULL;
+ bcm2835_dma_abort(c->chan_base);
+
--- /dev/null
+From 7906fa935ee088391c6a3092374e477f51e799cd Mon Sep 17 00:00:00 2001
+From: Robert Tiemann <rtie@gmx.de>
+Date: Mon, 20 Jul 2015 11:01:13 +0200
+Subject: [PATCH 125/148] BCM270X_DT: Fix I2S register map
+
+---
+ arch/arm/boot/dts/bcm2708_common.dtsi | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/arch/arm/boot/dts/bcm2708_common.dtsi
++++ b/arch/arm/boot/dts/bcm2708_common.dtsi
+@@ -117,8 +117,8 @@
+
+ i2s: i2s@7e203000 {
+ compatible = "brcm,bcm2708-i2s";
+- reg = <0x7e203000 0x20>,
+- <0x7e101098 0x02>;
++ reg = <0x7e203000 0x24>,
++ <0x7e101098 0x08>;
+
+ //dmas = <&dma 2>,
+ // <&dma 3>;
--- /dev/null
+From f0618c918f9debe6e75a6b17d06268f264166965 Mon Sep 17 00:00:00 2001
+From: Robert Tiemann <rtie@gmx.de>
+Date: Mon, 20 Jul 2015 11:01:25 +0200
+Subject: [PATCH 126/148] BCM2835_DT: Fix I2S register map
+
+---
+ Documentation/devicetree/bindings/dma/brcm,bcm2835-dma.txt | 4 ++--
+ Documentation/devicetree/bindings/sound/brcm,bcm2835-i2s.txt | 4 ++--
+ arch/arm/boot/dts/bcm2835.dtsi | 4 ++--
+ 3 files changed, 6 insertions(+), 6 deletions(-)
+
+--- a/Documentation/devicetree/bindings/dma/brcm,bcm2835-dma.txt
++++ b/Documentation/devicetree/bindings/dma/brcm,bcm2835-dma.txt
+@@ -48,8 +48,8 @@ Example:
+
+ bcm2835_i2s: i2s@7e203000 {
+ compatible = "brcm,bcm2835-i2s";
+- reg = < 0x7e203000 0x20>,
+- < 0x7e101098 0x02>;
++ reg = < 0x7e203000 0x24>,
++ < 0x7e101098 0x08>;
+
+ dmas = <&dma 2>,
+ <&dma 3>;
+--- a/Documentation/devicetree/bindings/sound/brcm,bcm2835-i2s.txt
++++ b/Documentation/devicetree/bindings/sound/brcm,bcm2835-i2s.txt
+@@ -16,8 +16,8 @@ Example:
+
+ bcm2835_i2s: i2s@7e203000 {
+ compatible = "brcm,bcm2835-i2s";
+- reg = <0x7e203000 0x20>,
+- <0x7e101098 0x02>;
++ reg = <0x7e203000 0x24>,
++ <0x7e101098 0x08>;
+
+ dmas = <&dma 2>,
+ <&dma 3>;
+--- a/arch/arm/boot/dts/bcm2835.dtsi
++++ b/arch/arm/boot/dts/bcm2835.dtsi
+@@ -101,8 +101,8 @@
+
+ i2s: i2s@7e203000 {
+ compatible = "brcm,bcm2835-i2s";
+- reg = <0x7e203000 0x20>,
+- <0x7e101098 0x02>;
++ reg = <0x7e203000 0x24>,
++ <0x7e101098 0x08>;
+
+ dmas = <&dma 2>,
+ <&dma 3>;
--- /dev/null
+From 167dc102f310fd58c9b5143f8a5c4cce65d51b69 Mon Sep 17 00:00:00 2001
+From: David Frey <david.frey@sensirion.com>
+Date: Tue, 14 Jul 2015 15:57:36 +0200
+Subject: [PATCH 127/148] config: Enable SHT drivers for raspberry pi
+
+The SHT temperature and humidity sensors are often used in weather
+station projects.
+
+Signed-off-by: David Frey <david.frey@sensirion.com>
+---
+ arch/arm/configs/bcm2709_defconfig | 4 +++-
+ arch/arm/configs/bcmrpi_defconfig | 4 +++-
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+--- a/arch/arm/configs/bcm2709_defconfig
++++ b/arch/arm/configs/bcm2709_defconfig
+@@ -611,7 +611,9 @@ CONFIG_W1_SLAVE_BQ27000=m
+ CONFIG_BATTERY_DS2760=m
+ CONFIG_POWER_RESET=y
+ CONFIG_POWER_RESET_GPIO=y
+-# CONFIG_HWMON is not set
++CONFIG_HWMON=m
++CONFIG_SENSORS_SHT21=m
++CONFIG_SENSORS_SHTC1=m
+ CONFIG_THERMAL=y
+ CONFIG_THERMAL_BCM2835=y
+ CONFIG_WATCHDOG=y
+--- a/arch/arm/configs/bcmrpi_defconfig
++++ b/arch/arm/configs/bcmrpi_defconfig
+@@ -604,7 +604,9 @@ CONFIG_W1_SLAVE_BQ27000=m
+ CONFIG_BATTERY_DS2760=m
+ CONFIG_POWER_RESET=y
+ CONFIG_POWER_RESET_GPIO=y
+-# CONFIG_HWMON is not set
++CONFIG_HWMON=m
++CONFIG_SENSORS_SHT21=m
++CONFIG_SENSORS_SHTC1=m
+ CONFIG_THERMAL=y
+ CONFIG_THERMAL_BCM2835=y
+ CONFIG_WATCHDOG=y
--- /dev/null
+From 6c9ebd30d2a1c6ec36515b45235be02e61ced87e Mon Sep 17 00:00:00 2001
+From: Phil Elwell <phil@raspberrypi.org>
+Date: Mon, 20 Jul 2015 14:07:14 +0100
+Subject: [PATCH 128/148] BCM270X_DT: Correct typo in overlays/README
+
+---
+ arch/arm/boot/dts/overlays/README | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/arm/boot/dts/overlays/README
++++ b/arch/arm/boot/dts/overlays/README
+@@ -78,7 +78,7 @@ Name: <The base DTB>
+ Info: Configures the base Raspberry Pi hardware
+ Load: <loaded automatically>
+ Params:
+- audio Set to "on" to disable the onboard ALSA audio
++ audio Set to "on" to enable the onboard ALSA audio
+ interface (default "off")
+
+ i2c_arm Set to "on" to enable the ARM's i2c interface
--- /dev/null
+From fc3fb877e0c097321d9d8a2a4cb10d5c0d2fc6a0 Mon Sep 17 00:00:00 2001
+From: Phil Elwell <phil@raspberrypi.org>
+Date: Mon, 20 Jul 2015 10:53:26 +0100
+Subject: [PATCH 129/148] bcm2835-sdhost: Add the ERASE capability
+
+See: https://github.com/raspberrypi/linux/issues/1076
+---
+ drivers/mmc/host/bcm2835-sdhost.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/mmc/host/bcm2835-sdhost.c
++++ b/drivers/mmc/host/bcm2835-sdhost.c
+@@ -1675,7 +1675,7 @@ int bcm2835_sdhost_add_host(struct bcm28
+ /* host controller capabilities */
+ mmc->caps |= /* MMC_CAP_SDIO_IRQ |*/ MMC_CAP_4_BIT_DATA |
+ MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED |
+- MMC_CAP_NEEDS_POLL | MMC_CAP_HW_RESET |
++ MMC_CAP_NEEDS_POLL | MMC_CAP_HW_RESET | MMC_CAP_ERASE |
+ (ALLOW_CMD23 * MMC_CAP_CMD23);
+
+ spin_lock_init(&host->lock);
--- /dev/null
+From 34b107a036211e45ce06d2c1406fab77dc4ec3c7 Mon Sep 17 00:00:00 2001
+From: Phil Elwell <phil@raspberrypi.org>
+Date: Mon, 20 Jul 2015 17:32:18 +0100
+Subject: [PATCH 130/148] bcm2835-sdhost: Ignore CRC7 for MMC CMD1
+
+It seems that the sdhost interface returns CRC7 errors for CMD1,
+which is the MMC-specific SEND_OP_COND. Returning these errors to
+the MMC layer causes a downward spiral, but ignoring them seems
+to be harmless.
+---
+ drivers/mmc/host/bcm2835-sdhost.c | 39 +++++++++++++++++++++++----------------
+ 1 file changed, 23 insertions(+), 16 deletions(-)
+
+--- a/drivers/mmc/host/bcm2835-sdhost.c
++++ b/drivers/mmc/host/bcm2835-sdhost.c
+@@ -959,25 +959,32 @@ static void bcm2835_sdhost_finish_comman
+ mmc_hostname(host->mmc), sdcmd, sdhsts,
+ bcm2835_sdhost_read(host, SDEDM));
+
+- if (sdhsts & SDHSTS_CMD_TIME_OUT) {
+- switch (host->cmd->opcode) {
+- case 5: case 52: case 53:
+- /* Don't warn about SDIO commands */
+- break;
+- default:
+- pr_err("%s: command timeout\n",
++ if ((sdhsts & SDHSTS_CRC7_ERROR) &&
++ (host->cmd->opcode == 1)) {
++ if (host->debug)
++ pr_info("%s: ignoring CRC7 error for CMD1\n",
++ mmc_hostname(host->mmc));
++ } else {
++ if (sdhsts & SDHSTS_CMD_TIME_OUT) {
++ switch (host->cmd->opcode) {
++ case 5: case 52: case 53:
++ /* Don't warn about SDIO commands */
++ break;
++ default:
++ pr_err("%s: command timeout\n",
++ mmc_hostname(host->mmc));
++ break;
++ }
++ host->cmd->error = -ETIMEDOUT;
++ } else {
++ pr_err("%s: unexpected command error\n",
+ mmc_hostname(host->mmc));
+- break;
++ bcm2835_sdhost_dumpregs(host);
++ host->cmd->error = -EIO;
+ }
+- host->cmd->error = -ETIMEDOUT;
+- } else {
+- pr_err("%s: unexpected command error\n",
+- mmc_hostname(host->mmc));
+- bcm2835_sdhost_dumpregs(host);
+- host->cmd->error = -EIO;
++ tasklet_schedule(&host->finish_tasklet);
++ return;
+ }
+- tasklet_schedule(&host->finish_tasklet);
+- return;
+ }
+
+ if (host->cmd->flags & MMC_RSP_PRESENT) {
--- /dev/null
+From c9510f8f7162eb3f377ea9895cb6296cc81c0158 Mon Sep 17 00:00:00 2001
+From: Phil Elwell <phil@raspberrypi.org>
+Date: Mon, 20 Jul 2015 14:48:21 +0100
+Subject: [PATCH 131/148] BCM270X_DT: Add unit address to gpio node name
+
+---
+ arch/arm/boot/dts/bcm2708_common.dtsi | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/arm/boot/dts/bcm2708_common.dtsi
++++ b/arch/arm/boot/dts/bcm2708_common.dtsi
+@@ -92,7 +92,7 @@
+ status = "disabled";
+ };
+
+- gpio: gpio {
++ gpio: gpio@7e200000 {
+ compatible = "brcm,bcm2835-gpio";
+ reg = <0x7e200000 0xb4>;
+ interrupts = <2 17>, <2 18>;
--- /dev/null
+From c9dce515346664285992ebac03a5fd9d63e9a964 Mon Sep 17 00:00:00 2001
+From: Phil Elwell <phil@raspberrypi.org>
+Date: Fri, 24 Jul 2015 10:36:32 +0100
+Subject: [PATCH 132/148] BCM270X_DT: Use i2c_arm for rtc and bmp085 overlays
+
+---
+ arch/arm/boot/dts/overlays/bmp085_i2c-sensor-overlay.dts | 2 +-
+ arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+--- a/arch/arm/boot/dts/overlays/bmp085_i2c-sensor-overlay.dts
++++ b/arch/arm/boot/dts/overlays/bmp085_i2c-sensor-overlay.dts
+@@ -6,7 +6,7 @@
+ compatible = "brcm,bcm2708";
+
+ fragment@0 {
+- target = <&i2c1>;
++ target = <&i2c_arm>;
+ __overlay__ {
+ #address-cells = <1>;
+ #size-cells = <0>;
+--- a/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts
++++ b/arch/arm/boot/dts/overlays/i2c-rtc-overlay.dts
+@@ -6,7 +6,7 @@
+ compatible = "brcm,bcm2708";
+
+ fragment@0 {
+- target = <&i2c1>;
++ target = <&i2c_arm>;
+ __overlay__ {
+ #address-cells = <1>;
+ #size-cells = <0>;
--- /dev/null
+From 1126ca25bb63e74218db91e9abbe6bb4ba712f99 Mon Sep 17 00:00:00 2001
+From: Phil Elwell <phil@raspberrypi.org>
+Date: Fri, 24 Jul 2015 12:11:31 +0100
+Subject: [PATCH 133/148] BCM2708_DT: CM dtparams for audio, watchdog and RNG
+
+---
+ arch/arm/boot/dts/bcm2708-rpi-cm.dtsi | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+--- a/arch/arm/boot/dts/bcm2708-rpi-cm.dtsi
++++ b/arch/arm/boot/dts/bcm2708-rpi-cm.dtsi
+@@ -17,14 +17,14 @@
+ status = "okay";
+ };
+
+-&audio {
+- 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";
+ };
+ };
--- /dev/null
+From e3508264148f91aceb5f557d45eb29986c522f1e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
+Date: Mon, 20 Jul 2015 12:13:18 +0200
+Subject: [PATCH 134/148] vchiq: Use firmware API
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Use the new firmware API instead of the legacy mailbox API.
+
+Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
+---
+ arch/arm/boot/dts/bcm2708_common.dtsi | 1 +
+ .../vc04_services/interface/vchiq_arm/vchiq_2835_arm.c | 17 +++++++++--------
+ .../misc/vc04_services/interface/vchiq_arm/vchiq_arm.c | 17 +++++++++++++++++
+ 3 files changed, 27 insertions(+), 8 deletions(-)
+
+--- a/arch/arm/boot/dts/bcm2708_common.dtsi
++++ b/arch/arm/boot/dts/bcm2708_common.dtsi
+@@ -225,6 +225,7 @@
+ reg = <0x7e00b840 0xf>;
+ interrupts = <0 2>;
+ cache-line-size = <32>;
++ firmware = <&firmware>;
+ };
+
+ thermal: thermal {
+--- a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
++++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
+@@ -39,11 +39,11 @@
+ #include <linux/dma-mapping.h>
+ #include <linux/version.h>
+ #include <linux/io.h>
+-#include <linux/platform_data/mailbox-bcm2708.h>
+ #include <linux/platform_device.h>
+ #include <linux/uaccess.h>
+ #include <linux/of.h>
+ #include <asm/pgtable.h>
++#include <soc/bcm2835/raspberrypi-firmware.h>
+
+ #define TOTAL_SLOTS (VCHIQ_SLOT_ZERO_SLOTS + 2 * 32)
+
+@@ -89,10 +89,12 @@ free_pagelist(PAGELIST_T *pagelist, int
+ int vchiq_platform_init(struct platform_device *pdev, VCHIQ_STATE_T *state)
+ {
+ struct device *dev = &pdev->dev;
++ struct rpi_firmware *fw = platform_get_drvdata(pdev);
+ VCHIQ_SLOT_ZERO_T *vchiq_slot_zero;
+ struct resource *res;
+ void *slot_mem;
+ dma_addr_t slot_phys;
++ u32 channelbase;
+ int slot_mem_size, frag_mem_size;
+ int err, irq, i;
+
+@@ -157,13 +159,12 @@ int vchiq_platform_init(struct platform_
+ }
+
+ /* Send the base address of the slots to VideoCore */
+-
+- dsb(); /* Ensure all writes have completed */
+-
+- err = bcm_mailbox_write(MBOX_CHAN_VCHIQ, (unsigned int)slot_phys);
+- if (err) {
+- dev_err(dev, "mailbox write failed\n");
+- return err;
++ channelbase = slot_phys;
++ err = rpi_firmware_property(fw, RPI_FIRMWARE_VCHIQ_INIT,
++ &channelbase, sizeof(channelbase));
++ if (err || channelbase) {
++ dev_err(dev, "failed to set channelbase\n");
++ return err ? : -ENXIO;
+ }
+
+ vchiq_log_info(vchiq_arm_log_level,
+--- a/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c
++++ b/drivers/misc/vc04_services/interface/vchiq_arm/vchiq_arm.c
+@@ -45,7 +45,9 @@
+ #include <linux/bug.h>
+ #include <linux/semaphore.h>
+ #include <linux/list.h>
++#include <linux/of.h>
+ #include <linux/platform_device.h>
++#include <soc/bcm2835/raspberrypi-firmware.h>
+
+ #include "vchiq_core.h"
+ #include "vchiq_ioctl.h"
+@@ -2793,9 +2795,24 @@ void vchiq_platform_conn_state_changed(V
+
+ static int vchiq_probe(struct platform_device *pdev)
+ {
++ struct device_node *fw_node;
++ struct rpi_firmware *fw;
+ int err;
+ void *ptr_err;
+
++ fw_node = of_parse_phandle(pdev->dev.of_node, "firmware", 0);
++/* Remove comment when booting without Device Tree is no longer supported
++ if (!fw_node) {
++ dev_err(&pdev->dev, "Missing firmware node\n");
++ return -ENOENT;
++ }
++*/
++ fw = rpi_firmware_get(fw_node);
++ if (!fw)
++ return -EPROBE_DEFER;
++
++ platform_set_drvdata(pdev, fw);
++
+ /* create debugfs entries */
+ err = vchiq_debugfs_init();
+ if (err != 0)
--- /dev/null
+From da339e29c12fc20d13610ed458082104b12e48f1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
+Date: Mon, 20 Jul 2015 12:17:10 +0200
+Subject: [PATCH 135/148] thermal: bcm2835: Use firmware API
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Use the new firmware API instead of the legacy mailbox API.
+Remove retry loop on failure to read temperature.
+Clean up code.
+
+Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
+---
+ arch/arm/boot/dts/bcm2708_common.dtsi | 1 +
+ drivers/thermal/bcm2835-thermal.c | 197 +++++++++++++---------------------
+ 2 files changed, 75 insertions(+), 123 deletions(-)
+
+--- a/arch/arm/boot/dts/bcm2708_common.dtsi
++++ b/arch/arm/boot/dts/bcm2708_common.dtsi
+@@ -230,6 +230,7 @@
+
+ thermal: thermal {
+ compatible = "brcm,bcm2835-thermal";
++ firmware = <&firmware>;
+ };
+ };
+
+--- a/drivers/thermal/bcm2835-thermal.c
++++ b/drivers/thermal/bcm2835-thermal.c
+@@ -12,161 +12,113 @@
+ * consent.
+ *****************************************************************************/
+
+-#include <linux/kernel.h>
+ #include <linux/module.h>
+-#include <linux/init.h>
+-#include <linux/platform_data/mailbox-bcm2708.h>
+ #include <linux/platform_device.h>
+-#include <linux/slab.h>
+-#include <linux/sysfs.h>
+ #include <linux/thermal.h>
++#include <soc/bcm2835/raspberrypi-firmware.h>
+
+-
+-/* --- DEFINITIONS --- */
+-#define MODULE_NAME "bcm2835_thermal"
+-
+-/*#define THERMAL_DEBUG_ENABLE*/
+-
+-#ifdef THERMAL_DEBUG_ENABLE
+-#define print_debug(fmt,...) printk(KERN_INFO "%s:%s:%d: "fmt"\n", MODULE_NAME, __func__, __LINE__, ##__VA_ARGS__)
+-#else
+-#define print_debug(fmt,...)
+-#endif
+-#define print_err(fmt,...) printk(KERN_ERR "%s:%s:%d: "fmt"\n", MODULE_NAME, __func__,__LINE__, ##__VA_ARGS__)
+-
+-#define VC_TAG_GET_TEMP 0x00030006
+-#define VC_TAG_GET_MAX_TEMP 0x0003000A
+-
+-typedef enum {
+- TEMP,
+- MAX_TEMP,
+-} temp_type;
+-
+-/* --- STRUCTS --- */
+-/* tag part of the message */
+-struct vc_msg_tag {
+- uint32_t tag_id; /* the tag ID for the temperature */
+- uint32_t buffer_size; /* size of the buffer (should be 8) */
+- uint32_t request_code; /* identifies message as a request (should be 0) */
+- uint32_t id; /* extra ID field (should be 0) */
+- uint32_t val; /* returned value of the temperature */
+-};
+-
+-/* message structure to be sent to videocore */
+-struct vc_msg {
+- uint32_t msg_size; /* simply, sizeof(struct vc_msg) */
+- uint32_t request_code; /* holds various information like the success and number of bytes returned (refer to mailboxes wiki) */
+- struct vc_msg_tag tag; /* the tag structure above to make */
+- uint32_t end_tag; /* an end identifier, should be set to NULL */
+-};
+-
+-struct bcm2835_thermal_data {
+- struct thermal_zone_device *thermal_dev;
+- struct vc_msg msg;
+-};
+-
+-/* --- GLOBALS --- */
+-static struct bcm2835_thermal_data bcm2835_data;
+-
+-/* Thermal Device Operations */
+-static struct thermal_zone_device_ops ops;
+-
+-/* --- FUNCTIONS --- */
+-
+-static int bcm2835_get_temp_or_max(struct thermal_zone_device *thermal_dev, unsigned long *temp, unsigned tag_id)
++static int bcm2835_thermal_get_property(struct thermal_zone_device *tz,
++ unsigned long *temp, u32 tag)
+ {
+- int result = -1, retry = 3;
+- print_debug("IN");
++ struct rpi_firmware *fw = tz->devdata;
++ struct {
++ u32 id;
++ u32 val;
++ } packet;
++ int ret;
+
+ *temp = 0;
+- while (result != 0 && retry-- > 0) {
+- /* wipe all previous message data */
+- memset(&bcm2835_data.msg, 0, sizeof bcm2835_data.msg);
+-
+- /* prepare message */
+- bcm2835_data.msg.msg_size = sizeof bcm2835_data.msg;
+- bcm2835_data.msg.tag.buffer_size = 8;
+- bcm2835_data.msg.tag.tag_id = tag_id;
+-
+- /* send the message */
+- result = bcm_mailbox_property(&bcm2835_data.msg, sizeof bcm2835_data.msg);
+- print_debug("Got %stemperature as %u (%d,%x)\n", tag_id==VC_TAG_GET_MAX_TEMP ? "max ":"", (uint)bcm2835_data.msg.tag.val, result, bcm2835_data.msg.request_code);
+- if (!(bcm2835_data.msg.request_code & 0x80000000))
+- result = -1;
++ packet.id = 0;
++ ret = rpi_firmware_property(fw, tag, &packet, sizeof(packet));
++ if (ret) {
++ dev_err(&tz->device, "Failed to get temperature\n");
++ return ret;
+ }
+
+- /* check if it was all ok and return the rate in milli degrees C */
+- if (result == 0)
+- *temp = (uint)bcm2835_data.msg.tag.val;
+- else
+- print_err("Failed to get temperature! (%x:%d)\n", tag_id, result);
+- print_debug("OUT");
+- return result;
++ *temp = packet.val;
++ dev_dbg(&tz->device, "%stemp=%lu\n",
++ tag == RPI_FIRMWARE_GET_MAX_TEMPERATURE ? "max" : "", *temp);
++
++ return 0;
+ }
+
+-static int bcm2835_get_temp(struct thermal_zone_device *thermal_dev, unsigned long *temp)
++static int bcm2835_thermal_get_temp(struct thermal_zone_device *tz,
++ unsigned long *temp)
+ {
+- return bcm2835_get_temp_or_max(thermal_dev, temp, VC_TAG_GET_TEMP);
++ return bcm2835_thermal_get_property(tz, temp,
++ RPI_FIRMWARE_GET_TEMPERATURE);
+ }
+
+-static int bcm2835_get_max_temp(struct thermal_zone_device *thermal_dev, int trip_num, unsigned long *temp)
++static int bcm2835_thermal_get_max_temp(struct thermal_zone_device *tz,
++ int trip, unsigned long *temp)
+ {
+- return bcm2835_get_temp_or_max(thermal_dev, temp, VC_TAG_GET_MAX_TEMP);
++ /*
++ * The maximum safe temperature of the SoC.
++ * Overclock may be disabled above this temperature.
++ */
++ return bcm2835_thermal_get_property(tz, temp,
++ RPI_FIRMWARE_GET_MAX_TEMPERATURE);
+ }
+
+-static int bcm2835_get_trip_type(struct thermal_zone_device * thermal_dev, int trip_num, enum thermal_trip_type *trip_type)
++static int bcm2835_thermal_get_trip_type(struct thermal_zone_device *tz,
++ int trip, enum thermal_trip_type *type)
+ {
+- *trip_type = THERMAL_TRIP_HOT;
++ *type = THERMAL_TRIP_HOT;
++
+ return 0;
+ }
+
+-
+-static int bcm2835_get_mode(struct thermal_zone_device *thermal_dev, enum thermal_device_mode *dev_mode)
++static int bcm2835_thermal_get_mode(struct thermal_zone_device *tz,
++ enum thermal_device_mode *mode)
+ {
+- *dev_mode = THERMAL_DEVICE_ENABLED;
++ *mode = THERMAL_DEVICE_ENABLED;
++
+ return 0;
+ }
+
++static struct thermal_zone_device_ops ops = {
++ .get_temp = bcm2835_thermal_get_temp,
++ .get_trip_temp = bcm2835_thermal_get_max_temp,
++ .get_trip_type = bcm2835_thermal_get_trip_type,
++ .get_mode = bcm2835_thermal_get_mode,
++};
+
+ static int bcm2835_thermal_probe(struct platform_device *pdev)
+ {
+- print_debug("IN");
+- print_debug("THERMAL Driver has been probed!");
+-
+- /* check that the device isn't null!*/
+- if(pdev == NULL)
+- {
+- print_debug("Platform device is empty!");
+- return -ENODEV;
++ struct device_node *fw_np;
++ struct rpi_firmware *fw;
++ struct thermal_zone_device *tz;
++
++ fw_np = of_parse_phandle(pdev->dev.of_node, "firmware", 0);
++/* Remove comment when booting without Device Tree is no longer supported
++ if (!fw_np) {
++ dev_err(&pdev->dev, "Missing firmware node\n");
++ return -ENOENT;
+ }
+-
+- if(!(bcm2835_data.thermal_dev = thermal_zone_device_register("bcm2835_thermal", 1, 0, NULL, &ops, NULL, 0, 0)))
+- {
+- print_debug("Unable to register the thermal device!");
+- return -EFAULT;
++*/
++ fw = rpi_firmware_get(fw_np);
++ if (!fw)
++ return -EPROBE_DEFER;
++
++ tz = thermal_zone_device_register("bcm2835_thermal", 1, 0, fw, &ops,
++ NULL, 0, 0);
++ if (IS_ERR(tz)) {
++ dev_err(&pdev->dev, "Failed to register the thermal device\n");
++ return PTR_ERR(tz);
+ }
++
++ platform_set_drvdata(pdev, tz);
++
+ return 0;
+ }
+
+-
+ static int bcm2835_thermal_remove(struct platform_device *pdev)
+ {
+- print_debug("IN");
+-
+- thermal_zone_device_unregister(bcm2835_data.thermal_dev);
+-
+- print_debug("OUT");
++ thermal_zone_device_unregister(platform_get_drvdata(pdev));
+
+ return 0;
+ }
+
+-static struct thermal_zone_device_ops ops = {
+- .get_temp = bcm2835_get_temp,
+- .get_trip_temp = bcm2835_get_max_temp,
+- .get_trip_type = bcm2835_get_trip_type,
+- .get_mode = bcm2835_get_mode,
+-};
+-
+ static const struct of_device_id bcm2835_thermal_of_match_table[] = {
+ { .compatible = "brcm,bcm2835-thermal", },
+ {},
+@@ -177,14 +129,13 @@ static struct platform_driver bcm2835_th
+ .probe = bcm2835_thermal_probe,
+ .remove = bcm2835_thermal_remove,
+ .driver = {
+- .name = "bcm2835_thermal",
+- .owner = THIS_MODULE,
+- .of_match_table = bcm2835_thermal_of_match_table,
+- },
++ .name = "bcm2835_thermal",
++ .of_match_table = bcm2835_thermal_of_match_table,
++ },
+ };
++module_platform_driver(bcm2835_thermal_driver);
+
+-MODULE_LICENSE("GPL");
+ MODULE_AUTHOR("Dorian Peake");
++MODULE_AUTHOR("Noralf Trønnes");
+ MODULE_DESCRIPTION("Thermal driver for bcm2835 chip");
+-
+-module_platform_driver(bcm2835_thermal_driver);
++MODULE_LICENSE("GPL");
--- /dev/null
+From b5f2f604151dff8277c10cca8d3eab0ae9b55373 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
+Date: Mon, 20 Jul 2015 12:18:36 +0200
+Subject: [PATCH 136/148] cpufreq: bcm2835: Use firmware API
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Use the new firmware API instead of the legacy mailbox API.
+
+Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
+---
+ drivers/cpufreq/bcm2835-cpufreq.c | 117 +++++++++++++++++---------------------
+ 1 file changed, 53 insertions(+), 64 deletions(-)
+
+--- a/drivers/cpufreq/bcm2835-cpufreq.c
++++ b/drivers/cpufreq/bcm2835-cpufreq.c
+@@ -26,7 +26,7 @@
+ #include <linux/init.h>
+ #include <linux/module.h>
+ #include <linux/cpufreq.h>
+-#include <linux/platform_data/mailbox-bcm2708.h>
++#include <soc/bcm2835/raspberrypi-firmware.h>
+
+ /* ---------- DEFINES ---------- */
+ /*#define CPUFREQ_DEBUG_ENABLE*/ /* enable debugging */
+@@ -43,23 +43,6 @@
+ #define print_err(fmt,...) pr_err("%s:%s:%d: "fmt, MODULE_NAME, __func__,__LINE__, ##__VA_ARGS__)
+ #define print_info(fmt,...) pr_info("%s: "fmt, MODULE_NAME, ##__VA_ARGS__)
+
+-/* tag part of the message */
+-struct vc_msg_tag {
+- uint32_t tag_id; /* the message id */
+- uint32_t buffer_size; /* size of the buffer (which in this case is always 8 bytes) */
+- uint32_t data_size; /* amount of data being sent or received */
+- uint32_t dev_id; /* the ID of the clock/voltage to get or set */
+- uint32_t val; /* the value (e.g. rate (in Hz)) to set */
+-};
+-
+-/* message structure to be sent to videocore */
+-struct vc_msg {
+- uint32_t msg_size; /* simply, sizeof(struct vc_msg) */
+- uint32_t request_code; /* holds various information like the success and number of bytes returned (refer to mailboxes wiki) */
+- struct vc_msg_tag tag; /* the tag structure above to make */
+- uint32_t end_tag; /* an end identifier, should be set to NULL */
+-};
+-
+ /* ---------- GLOBALS ---------- */
+ static struct cpufreq_driver bcm2835_cpufreq_driver; /* the cpufreq driver global */
+
+@@ -74,62 +57,63 @@ static struct cpufreq_frequency_table bc
+ clk_rate either gets or sets the clock rates.
+ ===============================================
+ */
+-static uint32_t bcm2835_cpufreq_set_clock(int cur_rate, int arm_rate)
++
++static int bcm2835_cpufreq_clock_property(u32 tag, u32 id, u32 *val)
+ {
+- int s, actual_rate=0;
+- struct vc_msg msg;
++ struct rpi_firmware *fw = rpi_firmware_get(NULL);
++ struct {
++ u32 id;
++ u32 val;
++ } packet;
++ int ret;
++
++ packet.id = id;
++ packet.val = *val;
++ ret = rpi_firmware_property(fw, tag, &packet, sizeof(packet));
++ if (ret)
++ return ret;
+
+- /* wipe all previous message data */
+- memset(&msg, 0, sizeof msg);
++ *val = packet.val;
+
+- msg.msg_size = sizeof msg;
++ return 0;
++}
+
+- msg.tag.tag_id = VCMSG_SET_CLOCK_RATE;
+- msg.tag.buffer_size = 8;
+- msg.tag.data_size = 8; /* we're sending the clock ID and the new rates which is a total of 2 words */
+- msg.tag.dev_id = VCMSG_ID_ARM_CLOCK;
+- msg.tag.val = arm_rate * 1000;
++static uint32_t bcm2835_cpufreq_set_clock(int cur_rate, int arm_rate)
++{
++ u32 rate = arm_rate * 1000;
++ int ret;
+
+- /* send the message */
+- s = bcm_mailbox_property(&msg, sizeof msg);
++ ret = bcm2835_cpufreq_clock_property(RPI_FIRMWARE_SET_CLOCK_RATE, VCMSG_ID_ARM_CLOCK, &rate);
++ if (ret) {
++ print_err("Failed to set clock: %d (%d)\n", arm_rate, ret);
++ return 0;
++ }
+
+- /* check if it was all ok and return the rate in KHz */
+- if (s == 0 && (msg.request_code & 0x80000000))
+- actual_rate = msg.tag.val/1000;
++ rate /= 1000;
++ print_debug("Setting new frequency = %d -> %d (actual %d)\n", cur_rate, arm_rate, rate);
+
+- print_debug("Setting new frequency = %d -> %d (actual %d)\n", cur_rate, arm_rate, actual_rate);
+- return actual_rate;
++ return rate;
+ }
+
+ static uint32_t bcm2835_cpufreq_get_clock(int tag)
+ {
+- int s;
+- int arm_rate = 0;
+- struct vc_msg msg;
+-
+- /* wipe all previous message data */
+- memset(&msg, 0, sizeof msg);
+-
+- msg.msg_size = sizeof msg;
+- msg.tag.tag_id = tag;
+- msg.tag.buffer_size = 8;
+- msg.tag.data_size = 4; /* we're just sending the clock ID which is one word long */
+- msg.tag.dev_id = VCMSG_ID_ARM_CLOCK;
+-
+- /* send the message */
+- s = bcm_mailbox_property(&msg, sizeof msg);
+-
+- /* check if it was all ok and return the rate in KHz */
+- if (s == 0 && (msg.request_code & 0x80000000))
+- arm_rate = msg.tag.val/1000;
+-
+- print_debug("%s frequency = %d\n",
+- tag == VCMSG_GET_CLOCK_RATE ? "Current":
+- tag == VCMSG_GET_MIN_CLOCK ? "Min":
+- tag == VCMSG_GET_MAX_CLOCK ? "Max":
+- "Unexpected", arm_rate);
++ u32 rate;
++ int ret;
++
++ ret = bcm2835_cpufreq_clock_property(tag, VCMSG_ID_ARM_CLOCK, &rate);
++ if (ret) {
++ print_err("Failed to get clock (%d)\n", ret);
++ return 0;
++ }
++
++ rate /= 1000;
++ print_debug("%s frequency = %u\n",
++ tag == RPI_FIRMWARE_GET_CLOCK_RATE ? "Current":
++ tag == RPI_FIRMWARE_GET_MIN_CLOCK_RATE ? "Min":
++ tag == RPI_FIRMWARE_GET_MAX_CLOCK_RATE ? "Max":
++ "Unexpected", rate);
+
+- return arm_rate;
++ return rate;
+ }
+
+ /*
+@@ -165,9 +149,14 @@ static int bcm2835_cpufreq_driver_init(s
+ /* measured value of how long it takes to change frequency */
+ const unsigned int transition_latency = 355000; /* ns */
+
++ if (!rpi_firmware_get(NULL)) {
++ print_err("Firmware is not available\n");
++ return -ENODEV;
++ }
++
+ /* now find out what the maximum and minimum frequencies are */
+- bcm2835_freq_table[0].frequency = bcm2835_cpufreq_get_clock(VCMSG_GET_MIN_CLOCK);
+- bcm2835_freq_table[1].frequency = bcm2835_cpufreq_get_clock(VCMSG_GET_MAX_CLOCK);
++ bcm2835_freq_table[0].frequency = bcm2835_cpufreq_get_clock(RPI_FIRMWARE_GET_MIN_CLOCK_RATE);
++ bcm2835_freq_table[1].frequency = bcm2835_cpufreq_get_clock(RPI_FIRMWARE_GET_MAX_CLOCK_RATE);
+
+ print_info("min=%d max=%d\n", bcm2835_freq_table[0].frequency, bcm2835_freq_table[1].frequency);
+ return cpufreq_generic_init(policy, bcm2835_freq_table, transition_latency);
+@@ -201,8 +190,8 @@ static int bcm2835_cpufreq_driver_target
+
+ static unsigned int bcm2835_cpufreq_driver_get(unsigned int cpu)
+ {
+- unsigned int actual_rate = bcm2835_cpufreq_get_clock(VCMSG_GET_CLOCK_RATE);
+- print_debug("%d: freq=%d\n", cpu, actual_rate);
++ unsigned int actual_rate = bcm2835_cpufreq_get_clock(RPI_FIRMWARE_GET_CLOCK_RATE);
++ print_debug("cpu%d: freq=%d\n", cpu, actual_rate);
+ return actual_rate <= bcm2835_freq_table[0].frequency ? bcm2835_freq_table[0].frequency : bcm2835_freq_table[1].frequency;
+ }
+
--- /dev/null
+From b436501db9136833c1e213d6efdb3b1c6e711bf1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
+Date: Mon, 20 Jul 2015 12:20:59 +0200
+Subject: [PATCH 137/148] fbdev: bcm2708: Use firmware API
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Use the new firmware API instead of the legacy mailbox API.
+
+Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
+---
+ arch/arm/boot/dts/bcm2708_common.dtsi | 1 +
+ drivers/video/fbdev/bcm2708_fb.c | 273 +++++++++++++++++++---------------
+ 2 files changed, 152 insertions(+), 122 deletions(-)
+
+--- a/arch/arm/boot/dts/bcm2708_common.dtsi
++++ b/arch/arm/boot/dts/bcm2708_common.dtsi
+@@ -217,6 +217,7 @@
+
+ fb: fb {
+ compatible = "brcm,bcm2708-fb";
++ firmware = <&firmware>;
+ status = "disabled";
+ };
+
+--- a/drivers/video/fbdev/bcm2708_fb.c
++++ b/drivers/video/fbdev/bcm2708_fb.c
+@@ -25,7 +25,6 @@
+ #include <linux/ioport.h>
+ #include <linux/list.h>
+ #include <linux/platform_data/dma-bcm2708.h>
+-#include <linux/platform_data/mailbox-bcm2708.h>
+ #include <linux/platform_device.h>
+ #include <linux/clk.h>
+ #include <linux/printk.h>
+@@ -34,6 +33,7 @@
+ #include <asm/sizes.h>
+ #include <linux/io.h>
+ #include <linux/dma-mapping.h>
++#include <soc/bcm2835/raspberrypi-firmware.h>
+
+ //#define BCM2708_FB_DEBUG
+ #define MODULE_NAME "bcm2708_fb"
+@@ -58,15 +58,19 @@ static u32 dma_busy_wait_threshold = 1<<
+ module_param(dma_busy_wait_threshold, int, 0644);
+ MODULE_PARM_DESC(dma_busy_wait_threshold, "Busy-wait for DMA completion below this area");
+
+-/* this data structure describes each frame buffer device we find */
+-
+-struct fbinfo_s {
+- u32 xres, yres, xres_virtual, yres_virtual;
+- u32 pitch, bpp;
++struct fb_alloc_tags {
++ struct rpi_firmware_property_tag_header tag1;
++ u32 xres, yres;
++ struct rpi_firmware_property_tag_header tag2;
++ u32 xres_virtual, yres_virtual;
++ struct rpi_firmware_property_tag_header tag3;
++ u32 bpp;
++ struct rpi_firmware_property_tag_header tag4;
+ u32 xoffset, yoffset;
+- u32 base;
+- u32 screen_size;
+- u16 cmap[256];
++ struct rpi_firmware_property_tag_header tag5;
++ u32 base, screen_size;
++ struct rpi_firmware_property_tag_header tag6;
++ u32 pitch;
+ };
+
+ struct bcm2708_fb_stats {
+@@ -78,9 +82,9 @@ struct bcm2708_fb_stats {
+ struct bcm2708_fb {
+ struct fb_info fb;
+ struct platform_device *dev;
+- struct fbinfo_s *info;
+- dma_addr_t dma;
++ struct rpi_firmware *fw;
+ u32 cmap[16];
++ u32 gpu_cmap[256];
+ int dma_chan;
+ int dma_irq;
+ void __iomem *dma_chan_base;
+@@ -270,69 +274,71 @@ static int bcm2708_fb_check_var(struct f
+
+ static int bcm2708_fb_set_par(struct fb_info *info)
+ {
+- uint32_t val = 0;
+ struct bcm2708_fb *fb = to_bcm2708(info);
+- volatile struct fbinfo_s *fbinfo = fb->info;
+- fbinfo->xres = info->var.xres;
+- fbinfo->yres = info->var.yres;
+- fbinfo->xres_virtual = info->var.xres_virtual;
+- fbinfo->yres_virtual = info->var.yres_virtual;
+- fbinfo->bpp = info->var.bits_per_pixel;
+- fbinfo->xoffset = info->var.xoffset;
+- fbinfo->yoffset = info->var.yoffset;
+- fbinfo->base = 0; /* filled in by VC */
+- fbinfo->pitch = 0; /* filled in by VC */
++ struct fb_alloc_tags fbinfo = {
++ .tag1 = { RPI_FIRMWARE_FRAMEBUFFER_SET_PHYSICAL_WIDTH_HEIGHT,
++ 8, 0, },
++ .xres = info->var.xres,
++ .yres = info->var.yres,
++ .tag2 = { RPI_FIRMWARE_FRAMEBUFFER_SET_VIRTUAL_WIDTH_HEIGHT,
++ 8, 0, },
++ .xres_virtual = info->var.xres_virtual,
++ .yres_virtual = info->var.yres_virtual,
++ .tag3 = { RPI_FIRMWARE_FRAMEBUFFER_SET_DEPTH, 4, 0 },
++ .bpp = info->var.bits_per_pixel,
++ .tag4 = { RPI_FIRMWARE_FRAMEBUFFER_SET_VIRTUAL_OFFSET, 8, 0 },
++ .xoffset = info->var.xoffset,
++ .yoffset = info->var.yoffset,
++ .tag5 = { RPI_FIRMWARE_FRAMEBUFFER_ALLOCATE, 8, 0 },
++ .base = 0,
++ .screen_size = 0,
++ .tag6 = { RPI_FIRMWARE_FRAMEBUFFER_GET_PITCH, 4, 0 },
++ .pitch = 0,
++ };
++ int ret;
+
+ print_debug("bcm2708_fb_set_par info(%p) %dx%d (%dx%d), %d, %d\n", info,
+ info->var.xres, info->var.yres, info->var.xres_virtual,
+ info->var.yres_virtual, (int)info->screen_size,
+ info->var.bits_per_pixel);
+
+- /* ensure last write to fbinfo is visible to GPU */
+- wmb();
+-
+- /* inform vc about new framebuffer */
+- bcm_mailbox_write(MBOX_CHAN_FB, fb->dma);
++ ret = rpi_firmware_property_list(fb->fw, &fbinfo, sizeof(fbinfo));
++ if (ret) {
++ dev_err(info->device,
++ "Failed to allocate GPU framebuffer (%d)\n", ret);
++ return ret;
++ }
+
+- /* TODO: replace fb driver with vchiq version */
+- /* wait for response */
+- bcm_mailbox_read(MBOX_CHAN_FB, &val);
+-
+- /* ensure GPU writes are visible to us */
+- rmb();
+-
+- if (val == 0) {
+- fb->fb.fix.line_length = fbinfo->pitch;
+-
+- if (info->var.bits_per_pixel <= 8)
+- fb->fb.fix.visual = FB_VISUAL_PSEUDOCOLOR;
+- else
+- fb->fb.fix.visual = FB_VISUAL_TRUECOLOR;
+-
+- fb->fb_bus_address = fbinfo->base;
+- fbinfo->base &= ~0xc0000000;
+- fb->fb.fix.smem_start = fbinfo->base;
+- fb->fb.fix.smem_len = fbinfo->pitch * fbinfo->yres_virtual;
+- fb->fb.screen_size = fbinfo->screen_size;
+- if (fb->fb.screen_base)
+- iounmap(fb->fb.screen_base);
+- fb->fb.screen_base =
+- (void *)ioremap_wc(fbinfo->base, fb->fb.screen_size);
+- if (!fb->fb.screen_base) {
+- /* the console may currently be locked */
+- console_trylock();
+- console_unlock();
+- pr_err("bcm2708_fb_set_par: Failed to set screen_base\n");
+- return -EIO;
+- }
++ if (info->var.bits_per_pixel <= 8)
++ fb->fb.fix.visual = FB_VISUAL_PSEUDOCOLOR;
++ else
++ fb->fb.fix.visual = FB_VISUAL_TRUECOLOR;
++
++ fb->fb.fix.line_length = fbinfo.pitch;
++ fbinfo.base |= 0x40000000;
++ fb->fb_bus_address = fbinfo.base;
++ fbinfo.base &= ~0xc0000000;
++ fb->fb.fix.smem_start = fbinfo.base;
++ fb->fb.fix.smem_len = fbinfo.pitch * fbinfo.yres_virtual;
++ fb->fb.screen_size = fbinfo.screen_size;
++ if (fb->fb.screen_base)
++ iounmap(fb->fb.screen_base);
++ fb->fb.screen_base = ioremap_wc(fbinfo.base, fb->fb.screen_size);
++ if (!fb->fb.screen_base) {
++ /* the console may currently be locked */
++ console_trylock();
++ console_unlock();
++ dev_err(info->device, "Failed to set screen_base\n");
++ return -ENOMEM;
+ }
++
+ print_debug
+- ("BCM2708FB: start = %p,%p width=%d, height=%d, bpp=%d, pitch=%d size=%d success=%d\n",
++ ("BCM2708FB: start = %p,%p width=%d, height=%d, bpp=%d, pitch=%d size=%d\n",
+ (void *)fb->fb.screen_base, (void *)fb->fb_bus_address,
+- fbinfo->xres, fbinfo->yres, fbinfo->bpp,
+- fbinfo->pitch, (int)fb->fb.screen_size, val);
++ fbinfo.xres, fbinfo.yres, fbinfo.bpp,
++ fbinfo.pitch, (int)fb->fb.screen_size);
+
+- return val;
++ return 0;
+ }
+
+ static inline u32 convert_bitfield(int val, struct fb_bitfield *bf)
+@@ -352,15 +358,34 @@ static int bcm2708_fb_setcolreg(unsigned
+ /*print_debug("BCM2708FB: setcolreg %d:(%02x,%02x,%02x,%02x) %x\n", regno, red, green, blue, transp, fb->fb.fix.visual);*/
+ if (fb->fb.var.bits_per_pixel <= 8) {
+ if (regno < 256) {
+- /* blue [0:4], green [5:10], red [11:15] */
+- fb->info->cmap[regno] = ((red >> (16-5)) & 0x1f) << 11 |
+- ((green >> (16-6)) & 0x3f) << 5 |
+- ((blue >> (16-5)) & 0x1f) << 0;
++ /* blue [23:16], green [15:8], red [7:0] */
++ fb->gpu_cmap[regno] = ((red >> 8) & 0xff) << 0 |
++ ((green >> 8) & 0xff) << 8 |
++ ((blue >> 8) & 0xff) << 16;
+ }
+ /* Hack: we need to tell GPU the palette has changed, but currently bcm2708_fb_set_par takes noticable time when called for every (256) colour */
+ /* So just call it for what looks like the last colour in a list for now. */
+- if (regno == 15 || regno == 255)
+- bcm2708_fb_set_par(info);
++ if (regno == 15 || regno == 255) {
++ struct packet {
++ u32 offset;
++ u32 length;
++ u32 cmap[256];
++ } *packet;
++ int ret;
++
++ packet = kmalloc(sizeof(*packet), GFP_KERNEL);
++ if (!packet)
++ return -ENOMEM;
++ packet->offset = 0;
++ packet->length = regno + 1;
++ memcpy(packet->cmap, fb->gpu_cmap, sizeof(packet->cmap));
++ ret = rpi_firmware_property(fb->fw, RPI_FIRMWARE_FRAMEBUFFER_SET_PALETTE,
++ packet, (2 + packet->length) * sizeof(u32));
++ if (ret || packet->offset)
++ dev_err(info->device, "Failed to set palette (%d,%u)\n",
++ ret, packet->offset);
++ kfree(packet);
++ }
+ } else if (regno < 16) {
+ fb->cmap[regno] = convert_bitfield(transp, &fb->fb.var.transp) |
+ convert_bitfield(blue, &fb->fb.var.blue) |
+@@ -372,27 +397,31 @@ static int bcm2708_fb_setcolreg(unsigned
+
+ static int bcm2708_fb_blank(int blank_mode, struct fb_info *info)
+ {
+- s32 result = -1;
+- u32 p[7];
+- if ( (blank_mode == FB_BLANK_NORMAL) ||
+- (blank_mode == FB_BLANK_UNBLANK)) {
+-
+- p[0] = 28; // size = sizeof u32 * length of p
+- p[1] = VCMSG_PROCESS_REQUEST; // process request
+- p[2] = VCMSG_SET_BLANK_SCREEN; // (the tag id)
+- p[3] = 4; // (size of the response buffer)
+- p[4] = 4; // (size of the request data)
+- p[5] = blank_mode;
+- p[6] = VCMSG_PROPERTY_END; // end tag
+-
+- bcm_mailbox_property(&p, p[0]);
+-
+- if ( p[1] == VCMSG_REQUEST_SUCCESSFUL )
+- result = 0;
+- else
+- pr_err("bcm2708_fb_blank(%d) returns=%d p[1]=0x%x\n", blank_mode, p[5], p[1]);
++ struct bcm2708_fb *fb = to_bcm2708(info);
++ u32 value;
++ int ret;
++
++ switch (blank_mode) {
++ case FB_BLANK_UNBLANK:
++ value = 0;
++ break;
++ case FB_BLANK_NORMAL:
++ case FB_BLANK_VSYNC_SUSPEND:
++ case FB_BLANK_HSYNC_SUSPEND:
++ case FB_BLANK_POWERDOWN:
++ value = 1;
++ break;
++ default:
++ return -EINVAL;
+ }
+- return result;
++
++ ret = rpi_firmware_property(fb->fw, RPI_FIRMWARE_FRAMEBUFFER_BLANK,
++ &value, sizeof(value));
++ if (ret)
++ dev_err(info->device, "bcm2708_fb_blank(%d) failed: %d\n",
++ blank_mode, ret);
++
++ return ret;
+ }
+
+ static int bcm2708_fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
+@@ -408,25 +437,25 @@ static int bcm2708_fb_pan_display(struct
+
+ static int bcm2708_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
+ {
+- s32 result = -1;
+- u32 p[7];
+- if (cmd == FBIO_WAITFORVSYNC) {
+- p[0] = 28; // size = sizeof u32 * length of p
+- p[1] = VCMSG_PROCESS_REQUEST; // process request
+- p[2] = VCMSG_SET_VSYNC; // (the tag id)
+- p[3] = 4; // (size of the response buffer)
+- p[4] = 4; // (size of the request data)
+- p[5] = 0; // dummy
+- p[6] = VCMSG_PROPERTY_END; // end tag
+-
+- bcm_mailbox_property(&p, p[0]);
+-
+- if ( p[1] == VCMSG_REQUEST_SUCCESSFUL )
+- result = 0;
+- else
+- pr_err("bcm2708_fb_ioctl %x,%lx returns=%d p[1]=0x%x\n", cmd, arg, p[5], p[1]);
++ struct bcm2708_fb *fb = to_bcm2708(info);
++ u32 dummy = 0;
++ int ret;
++
++ switch (cmd) {
++ case FBIO_WAITFORVSYNC:
++ ret = rpi_firmware_property(fb->fw,
++ RPI_FIRMWARE_FRAMEBUFFER_SET_VSYNC,
++ &dummy, sizeof(dummy));
++ break;
++ default:
++ dev_err(info->device, "Unknown ioctl 0x%x\n", cmd);
++ return -EINVAL;
+ }
+- return result;
++
++ if (ret)
++ dev_err(info->device, "ioctl 0x%x failed (%d)\n", cmd, ret);
++
++ return ret;
+ }
+ static void bcm2708_fb_fillrect(struct fb_info *info,
+ const struct fb_fillrect *rect)
+@@ -621,20 +650,7 @@ static struct fb_ops bcm2708_fb_ops = {
+ static int bcm2708_fb_register(struct bcm2708_fb *fb)
+ {
+ int ret;
+- dma_addr_t dma;
+- void *mem;
+
+- mem =
+- dma_alloc_coherent(&fb->dev->dev, PAGE_ALIGN(sizeof(*fb->info)), &dma,
+- GFP_KERNEL);
+-
+- if (NULL == mem) {
+- pr_err(": unable to allocate fbinfo buffer\n");
+- ret = -ENOMEM;
+- } else {
+- fb->info = (struct fbinfo_s *)mem;
+- fb->dma = dma;
+- }
+ fb->fb.fbops = &bcm2708_fb_ops;
+ fb->fb.flags = FBINFO_FLAG_DEFAULT | FBINFO_HWACCEL_COPYAREA;
+ fb->fb.pseudo_palette = fb->cmap;
+@@ -693,9 +709,22 @@ out:
+
+ static int bcm2708_fb_probe(struct platform_device *dev)
+ {
++ struct device_node *fw_np;
++ struct rpi_firmware *fw;
+ struct bcm2708_fb *fb;
+ int ret;
+
++ fw_np = of_parse_phandle(dev->dev.of_node, "firmware", 0);
++/* Remove comment when booting without Device Tree is no longer supported
++ if (!fw_np) {
++ dev_err(&dev->dev, "Missing firmware node\n");
++ return -ENOENT;
++ }
++*/
++ fw = rpi_firmware_get(fw_np);
++ if (!fw)
++ return -EPROBE_DEFER;
++
+ fb = kzalloc(sizeof(struct bcm2708_fb), GFP_KERNEL);
+ if (!fb) {
+ dev_err(&dev->dev,
+@@ -704,6 +733,7 @@ static int bcm2708_fb_probe(struct platf
+ goto free_region;
+ }
+
++ fb->fw = fw;
+ bcm2708_fb_debugfs_init(fb);
+
+ fb->cb_base = dma_alloc_writecombine(&dev->dev, SZ_64K,
+@@ -737,6 +767,7 @@ static int bcm2708_fb_probe(struct platf
+ fb->dma_chan, fb->dma_chan_base);
+
+ fb->dev = dev;
++ fb->fb.device = &dev->dev;
+
+ ret = bcm2708_fb_register(fb);
+ if (ret == 0) {
+@@ -769,8 +800,6 @@ static int bcm2708_fb_remove(struct plat
+ dma_free_writecombine(&dev->dev, SZ_64K, fb->cb_base, fb->cb_handle);
+ bcm_dma_chan_free(fb->dma_chan);
+
+- dma_free_coherent(NULL, PAGE_ALIGN(sizeof(*fb->info)), (void *)fb->info,
+- fb->dma);
+ bcm2708_fb_debugfs_deinit(fb);
+
+ free_irq(fb->dma_irq, fb);
--- /dev/null
+From 9be804b336947fd31728a74a34c7febf44d6b8a5 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
+Date: Mon, 20 Jul 2015 12:27:17 +0200
+Subject: [PATCH 138/148] bcm2835: Add firmware property to affected devices
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Also move firmware depending devices to the rpi dtsi file since
+they depend on the Pi specific firmware.
+
+Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
+---
+ arch/arm/boot/dts/bcm2835-rpi.dtsi | 22 ++++++++++++++++++----
+ arch/arm/boot/dts/bcm2835.dtsi | 15 ---------------
+ 2 files changed, 18 insertions(+), 19 deletions(-)
+
+--- a/arch/arm/boot/dts/bcm2835-rpi.dtsi
++++ b/arch/arm/boot/dts/bcm2835-rpi.dtsi
+@@ -32,6 +32,24 @@
+ compatible = "raspberrypi,bcm2835-firmware";
+ mboxes = <&mailbox>;
+ };
++
++ fb: fb {
++ compatible = "brcm,bcm2708-fb";
++ firmware = <&firmware>;
++ };
++
++ thermal: thermal {
++ compatible = "brcm,bcm2835-thermal";
++ firmware = <&firmware>;
++ };
++
++ vchiq: vchiq {
++ compatible = "brcm,bcm2835-vchiq";
++ reg = <0x7e00b840 0xf>;
++ interrupts = <0 2>;
++ cache-line-size = <32>;
++ firmware = <&firmware>;
++ };
+ };
+
+ /* Onboard audio */
+@@ -101,10 +119,6 @@
+ bus-width = <4>;
+ };
+
+-&fb {
+- status = "okay";
+-};
+-
+ / {
+ __overrides__ {
+ i2s = <&i2s>,"status";
+--- a/arch/arm/boot/dts/bcm2835.dtsi
++++ b/arch/arm/boot/dts/bcm2835.dtsi
+@@ -160,21 +160,6 @@
+ arm-pmu {
+ compatible = "arm,arm1176-pmu";
+ };
+-
+- fb: fb {
+- compatible = "brcm,bcm2708-fb";
+- status = "disabled";
+- };
+-
+- vchiq: vchiq {
+- compatible = "brcm,bcm2835-vchiq";
+- reg = <0x7e00b840 0xf>;
+- interrupts = <0 2>;
+- };
+-
+- thermal: thermal {
+- compatible = "brcm,bcm2835-thermal";
+- };
+ };
+
+ clocks {
--- /dev/null
+From 193a0cacacc91b8c5c3224d0090f342ccd64f45c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
+Date: Tue, 21 Jul 2015 19:09:39 +0200
+Subject: [PATCH 139/148] rpi-ft5406: Use firmware API
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
+---
+ arch/arm/boot/dts/overlays/rpi-ft5406-overlay.dts | 1 +
+ drivers/input/touchscreen/rpi-ft5406.c | 74 ++++++++++-------------
+ 2 files changed, 32 insertions(+), 43 deletions(-)
+
+--- a/arch/arm/boot/dts/overlays/rpi-ft5406-overlay.dts
++++ b/arch/arm/boot/dts/overlays/rpi-ft5406-overlay.dts
+@@ -9,6 +9,7 @@
+ __overlay__ {
+ rpi_ft5406: rpi_ft5406 {
+ compatible = "rpi,rpi-ft5406";
++ firmware = <&firmware>;
+ status = "okay";
+ };
+ };
+--- a/drivers/input/touchscreen/rpi-ft5406.c
++++ b/drivers/input/touchscreen/rpi-ft5406.c
+@@ -21,7 +21,7 @@
+ #include <linux/kthread.h>
+ #include <linux/platform_device.h>
+ #include <asm/io.h>
+-#include <linux/platform_data/mailbox-bcm2708.h>
++#include <soc/bcm2835/raspberrypi-firmware.h>
+
+ #define MAXIMUM_SUPPORTED_POINTS 10
+ struct ft5406_regs {
+@@ -49,23 +49,6 @@ struct ft5406 {
+ struct task_struct * thread;
+ };
+
+-
+-/* tag part of the message */
+-struct vc_msg_tag {
+- uint32_t tag_id; /* the message id */
+- uint32_t buffer_size; /* size of the buffer (which in this case is always 8 bytes) */
+- uint32_t data_size; /* amount of data being sent or received */
+- uint32_t val; /* data buffer */
+-};
+-
+-/* message structure to be sent to videocore */
+-struct vc_msg {
+- uint32_t msg_size; /* simply, sizeof(struct vc_msg) */
+- uint32_t request_code; /* holds various information like the success and number of bytes returned (refer to mailboxes wiki) */
+- struct vc_msg_tag tag; /* the tag structure above to make */
+- uint32_t end_tag; /* an end identifier, should be set to NULL */
+-};
+-
+ /* Thread to poll for touchscreen events
+ *
+ * This thread polls the memory based register copy of the ft5406 registers
+@@ -136,11 +119,37 @@ static int ft5406_probe(struct platform_
+ {
+ int ret;
+ struct input_dev * input_dev = input_allocate_device();
+- struct vc_msg request;
+ struct ft5406 * ts;
++ struct device_node *fw_node;
++ struct rpi_firmware *fw;
++ u32 touchbuf;
+
+ dev_info(&pdev->dev, "Probing device\n");
+
++ fw_node = of_parse_phandle(pdev->dev.of_node, "firmware", 0);
++ if (!fw_node) {
++ dev_err(&pdev->dev, "Missing firmware node\n");
++ return -ENOENT;
++ }
++
++ fw = rpi_firmware_get(fw_node);
++ if (!fw)
++ return -EPROBE_DEFER;
++
++ ret = rpi_firmware_property(fw, RPI_FIRMWARE_FRAMEBUFFER_GET_TOUCHBUF,
++ &touchbuf, sizeof(touchbuf));
++ if (ret) {
++ dev_err(&pdev->dev, "Failed to get touch buffer\n");
++ return ret;
++ }
++
++ if (!touchbuf) {
++ dev_err(&pdev->dev, "Touchscreen not detected\n");
++ return -ENODEV;
++ }
++
++ dev_dbg(&pdev->dev, "Got TS buffer 0x%x\n", touchbuf);
++
+ ts = kzalloc(sizeof(struct ft5406), GFP_KERNEL);
+
+ if (!ts || !input_dev) {
+@@ -174,36 +183,15 @@ static int ft5406_probe(struct platform_
+ return ret;
+ }
+
+- memset(&request, 0, sizeof request);
+-
+- request.msg_size = sizeof request;
+- request.request_code = VCMSG_PROCESS_REQUEST;
+- request.tag.tag_id = VCMSG_GET_TOUCHBUF;
+- request.tag.buffer_size = 4;
+- request.tag.data_size = 4;
+-
+- bcm_mailbox_property(&request, sizeof(request));
+-
+- if(request.request_code == VCMSG_REQUEST_SUCCESSFUL && request.tag.val != 0)
+- {
+- dev_dbg(&pdev->dev, "Got TS buffer 0x%x\n", request.tag.val);
+- }
+- else
+- {
+- input_unregister_device(input_dev);
+- kzfree(ts);
+- return -1;
+- }
+-
+ // mmap the physical memory
+- request.tag.val &= ~0xc0000000;
+- ts->ts_base = ioremap(request.tag.val, sizeof(*ts->regs));
++ touchbuf &= ~0xc0000000;
++ ts->ts_base = ioremap(touchbuf, sizeof(*ts->regs));
+ if(ts->ts_base == NULL)
+ {
+ dev_err(&pdev->dev, "Failed to map physical address\n");
+ input_unregister_device(input_dev);
+ kzfree(ts);
+- return -1;
++ return -ENOMEM;
+ }
+
+ ts->regs = (struct ft5406_regs *) ts->ts_base;
--- /dev/null
+From 062df639b84a36bd22559717b84524045025224c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
+Date: Fri, 12 Jun 2015 19:01:05 +0200
+Subject: [PATCH 140/148] irqchip: bcm2835: Add FIQ support
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Add a duplicate irq range with an offset on the hwirq's so the
+driver can detect that enable_fiq() is used.
+Tested with downstream dwc_otg USB controller driver.
+
+Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
+Reviewed-by: Eric Anholt <eric@anholt.net>
+Acked-by: Stephen Warren <swarren@wwwdotorg.org>
+---
+ arch/arm/mach-bcm/Kconfig | 1 +
+ drivers/irqchip/irq-bcm2835.c | 53 ++++++++++++++++++++++++++++++++++++++-----
+ 2 files changed, 48 insertions(+), 6 deletions(-)
+
+--- a/arch/arm/mach-bcm/Kconfig
++++ b/arch/arm/mach-bcm/Kconfig
+@@ -114,6 +114,7 @@ config ARCH_BCM2835
+ select ARM_ERRATA_411920
+ select ARM_TIMER_SP804
+ select CLKSRC_OF
++ select FIQ
+ select PINCTRL
+ select PINCTRL_BCM2835
+ help
+--- a/drivers/irqchip/irq-bcm2835.c
++++ b/drivers/irqchip/irq-bcm2835.c
+@@ -56,7 +56,7 @@
+ #include "irqchip.h"
+
+ /* Put the bank and irq (32 bits) into the hwirq */
+-#define MAKE_HWIRQ(b, n) ((b << 5) | (n))
++#define MAKE_HWIRQ(b, n) (((b) << 5) | (n))
+ #define HWIRQ_BANK(i) (i >> 5)
+ #define HWIRQ_BIT(i) BIT(i & 0x1f)
+
+@@ -72,9 +72,13 @@
+ | SHORTCUT1_MASK | SHORTCUT2_MASK)
+
+ #define REG_FIQ_CONTROL 0x0c
++#define REG_FIQ_ENABLE 0x80
++#define REG_FIQ_DISABLE 0
+
+ #define NR_BANKS 3
+ #define IRQS_PER_BANK 32
++#define NUMBER_IRQS MAKE_HWIRQ(NR_BANKS, 0)
++#define FIQ_START (NR_IRQS_BANK0 + MAKE_HWIRQ(NR_BANKS - 1, 0))
+
+ static int reg_pending[] __initconst = { 0x00, 0x04, 0x08 };
+ static int reg_enable[] __initconst = { 0x18, 0x10, 0x14 };
+@@ -98,14 +102,38 @@ static struct armctrl_ic intc __read_mos
+ static void __exception_irq_entry bcm2835_handle_irq(
+ struct pt_regs *regs);
+
++static inline unsigned int hwirq_to_fiq(unsigned long hwirq)
++{
++ hwirq -= NUMBER_IRQS;
++ /*
++ * The hwirq numbering used in this driver is:
++ * BASE (0-7) GPU1 (32-63) GPU2 (64-95).
++ * This differ from the one used in the FIQ register:
++ * GPU1 (0-31) GPU2 (32-63) BASE (64-71)
++ */
++ if (hwirq >= 32)
++ return hwirq - 32;
++
++ return hwirq + 64;
++}
++
+ static void armctrl_mask_irq(struct irq_data *d)
+ {
+- writel_relaxed(HWIRQ_BIT(d->hwirq), intc.disable[HWIRQ_BANK(d->hwirq)]);
++ if (d->hwirq >= NUMBER_IRQS)
++ writel_relaxed(REG_FIQ_DISABLE, intc.base + REG_FIQ_CONTROL);
++ else
++ writel_relaxed(HWIRQ_BIT(d->hwirq),
++ intc.disable[HWIRQ_BANK(d->hwirq)]);
+ }
+
+ static void armctrl_unmask_irq(struct irq_data *d)
+ {
+- writel_relaxed(HWIRQ_BIT(d->hwirq), intc.enable[HWIRQ_BANK(d->hwirq)]);
++ if (d->hwirq >= NUMBER_IRQS)
++ writel_relaxed(REG_FIQ_ENABLE | hwirq_to_fiq(d->hwirq),
++ intc.base + REG_FIQ_CONTROL);
++ else
++ writel_relaxed(HWIRQ_BIT(d->hwirq),
++ intc.enable[HWIRQ_BANK(d->hwirq)]);
+ }
+
+ static struct irq_chip armctrl_chip = {
+@@ -150,8 +178,9 @@ static int __init armctrl_of_init(struct
+ panic("%s: unable to map IC registers\n",
+ node->full_name);
+
+- intc.domain = irq_domain_add_linear(node, MAKE_HWIRQ(NR_BANKS, 0),
+- &armctrl_ops, NULL);
++ intc.base = base;
++ intc.domain = irq_domain_add_linear(node, NUMBER_IRQS * 2,
++ &armctrl_ops, NULL);
+ if (!intc.domain)
+ panic("%s: unable to create IRQ domain\n", node->full_name);
+
+@@ -168,8 +197,20 @@ static int __init armctrl_of_init(struct
+ set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
+ }
+ }
+-
+ set_handle_irq(bcm2835_handle_irq);
++
++ /* Make a duplicate irq range which is used to enable FIQ */
++ for (b = 0; b < NR_BANKS; b++) {
++ for (i = 0; i < bank_irqs[b]; i++) {
++ irq = irq_create_mapping(intc.domain,
++ MAKE_HWIRQ(b, i) + NUMBER_IRQS);
++ BUG_ON(irq <= 0);
++ irq_set_chip(irq, &armctrl_chip);
++ set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
++ }
++ }
++ init_FIQ(FIQ_START);
++
+ return 0;
+ }
+
--- /dev/null
+From 5b2e3f5dc51d75e3ed1aefc57f9520feadf63948 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
+Date: Fri, 24 Jul 2015 15:50:04 +0200
+Subject: [PATCH 141/148] dwc_otg: Add ARCH_BCM2835 support
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
+---
+ drivers/usb/host/dwc_otg/dwc_otg_driver.c | 1 +
+ drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c | 1 -
+ drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c | 4 ++++
+ 3 files changed, 5 insertions(+), 1 deletion(-)
+
+--- a/drivers/usb/host/dwc_otg/dwc_otg_driver.c
++++ b/drivers/usb/host/dwc_otg/dwc_otg_driver.c
+@@ -723,6 +723,7 @@ static int dwc_otg_driver_probe(
+
+ memset(dwc_otg_device, 0, sizeof(*dwc_otg_device));
+ dwc_otg_device->os_dep.reg_offset = 0xFFFFFFFF;
++ dwc_otg_device->os_dep.platformdev = _dev;
+
+ /*
+ * Map the DWC_otg Core memory into virtual address space.
+--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c
++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c
+@@ -36,7 +36,6 @@
+ #include "dwc_otg_regs.h"
+
+ #include <linux/jiffies.h>
+-#include <mach/hardware.h>
+ #include <asm/fiq.h>
+
+
+--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c
++++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c
+@@ -445,7 +445,11 @@ static void hcd_init_fiq(void *cookie)
+ DWC_WARN("MPHI periph has NOT been enabled");
+ #endif
+ // Enable FIQ interrupt from USB peripheral
++#ifdef CONFIG_ARCH_BCM2835
++ enable_fiq(platform_get_irq(otg_dev->os_dep.platformdev, 1));
++#else
+ enable_fiq(INTERRUPT_VC_USB);
++#endif
+ local_fiq_enable();
+ }
+
--- /dev/null
+From cdd86992209a3f4d5b896f05062a5550c39de95b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
+Date: Fri, 24 Jul 2015 15:50:24 +0200
+Subject: [PATCH 142/148] bcm2835: Use DWC_OTG
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
+---
+ arch/arm/boot/dts/bcm2835.dtsi | 8 +++++---
+ arch/arm/configs/bcm2835_defconfig | 1 +
+ 2 files changed, 6 insertions(+), 3 deletions(-)
+
+--- a/arch/arm/boot/dts/bcm2835.dtsi
++++ b/arch/arm/boot/dts/bcm2835.dtsi
+@@ -152,9 +152,11 @@
+ };
+
+ usb: usb@7e980000 {
+- compatible = "brcm,bcm2835-usb";
+- reg = <0x7e980000 0x10000>;
+- interrupts = <1 9>;
++ compatible = "brcm,bcm2708-usb";
++ reg = <0x7e980000 0x10000>,
++ <0x7e006000 0x1000>;
++ interrupts = <2 0>,
++ <1 9>;
+ };
+
+ arm-pmu {
+--- a/arch/arm/configs/bcm2835_defconfig
++++ b/arch/arm/configs/bcm2835_defconfig
+@@ -869,6 +869,7 @@ CONFIG_USB_HIDDEV=y
+ CONFIG_USB=y
+ CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
+ CONFIG_USB_MON=m
++CONFIG_USB_DWCOTG=y
+ CONFIG_USB_PRINTER=m
+ CONFIG_USB_STORAGE=y
+ CONFIG_USB_STORAGE_REALTEK=m
--- /dev/null
+From 3817be453657d116131317525915d3e378d46fdc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
+Date: Fri, 24 Jul 2015 19:33:16 +0200
+Subject: [PATCH 143/148] Fix RASPBERRYPI_FIRMWARE dependents
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+If forgot this when converting the drivers.
+
+Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
+---
+ drivers/cpufreq/Kconfig.arm | 2 +-
+ drivers/input/touchscreen/Kconfig | 2 +-
+ drivers/misc/vc04_services/Kconfig | 2 +-
+ drivers/thermal/Kconfig | 2 +-
+ drivers/video/fbdev/Kconfig | 2 +-
+ 5 files changed, 5 insertions(+), 5 deletions(-)
+
+--- a/drivers/cpufreq/Kconfig.arm
++++ b/drivers/cpufreq/Kconfig.arm
+@@ -259,7 +259,7 @@ config ARM_SPEAR_CPUFREQ
+ This adds the CPUFreq driver support for SPEAr SOCs.
+
+ config ARM_BCM2835_CPUFREQ
+- depends on BCM2708_MBOX
++ depends on RASPBERRYPI_FIRMWARE
+ bool "BCM2835 Driver"
+ default y
+ help
+--- a/drivers/input/touchscreen/Kconfig
++++ b/drivers/input/touchscreen/Kconfig
+@@ -585,7 +585,7 @@ config TOUCHSCREEN_EDT_FT5X06
+
+ config TOUCHSCREEN_RPI_FT5406
+ tristate "Raspberry Pi FT5406 driver"
+- depends on ARCH_BCM2708 || ARCH_BCM2709
++ depends on RASPBERRYPI_FIRMWARE
+ help
+ Say Y here to enable the Raspberry Pi memory based FT5406 device
+
+--- a/drivers/misc/vc04_services/Kconfig
++++ b/drivers/misc/vc04_services/Kconfig
+@@ -1,6 +1,6 @@
+ config BCM2708_VCHIQ
+ tristate "Videocore VCHIQ"
+- depends on (MACH_BCM2708 || MACH_BCM2709 || ARCH_BCM2835) && BCM2708_MBOX
++ depends on RASPBERRYPI_FIRMWARE
+ default y
+ help
+ Kernel to VideoCore communication interface for the
+--- a/drivers/thermal/Kconfig
++++ b/drivers/thermal/Kconfig
+@@ -239,7 +239,7 @@ config INTEL_POWERCLAMP
+ user interface is exposed via generic thermal framework.
+
+ config THERMAL_BCM2835
+- depends on BCM2708_MBOX
++ depends on RASPBERRYPI_FIRMWARE
+ tristate "BCM2835 Thermal Driver"
+ help
+ This will enable temperature monitoring for the Broadcom BCM2835
+--- a/drivers/video/fbdev/Kconfig
++++ b/drivers/video/fbdev/Kconfig
+@@ -226,7 +226,7 @@ comment "Frame buffer hardware drivers"
+
+ config FB_BCM2708
+ tristate "BCM2708 framebuffer support"
+- depends on FB && ARM && BCM2708_MBOX
++ depends on FB && RASPBERRYPI_FIRMWARE
+ select FB_CFB_FILLRECT
+ select FB_CFB_COPYAREA
+ select FB_CFB_IMAGEBLIT
--- /dev/null
+From 5385d08b17b5eda5ed816978b29f50c6aad560ac Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
+Date: Fri, 24 Jul 2015 19:33:46 +0200
+Subject: [PATCH 144/148] vc_mem: Remove unnecessary include
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
+---
+ drivers/char/broadcom/vc_mem.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+--- a/drivers/char/broadcom/vc_mem.c
++++ b/drivers/char/broadcom/vc_mem.c
+@@ -22,7 +22,6 @@
+ #include <linux/debugfs.h>
+ #include <asm/uaccess.h>
+ #include <linux/dma-mapping.h>
+-#include <linux/platform_data/mailbox-bcm2708.h>
+ #include <linux/broadcom/vc_mem.h>
+
+ #define DRIVER_NAME "vc-mem"
--- /dev/null
+From 6661f3e0e7db6a720e8b114510da8240d28db1ae Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
+Date: Fri, 24 Jul 2015 19:34:06 +0200
+Subject: [PATCH 145/148] configs: Remove BCM2708_MBOX
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
+---
+ arch/arm/configs/bcm2709_defconfig | 1 -
+ arch/arm/configs/bcm2835_defconfig | 1 -
+ arch/arm/configs/bcmrpi_defconfig | 1 -
+ 3 files changed, 3 deletions(-)
+
+--- a/arch/arm/configs/bcm2709_defconfig
++++ b/arch/arm/configs/bcm2709_defconfig
+@@ -1078,7 +1078,6 @@ CONFIG_FB_TFT_WATTEROTT=m
+ CONFIG_FB_FLEX=m
+ CONFIG_FB_TFT_FBTFT_DEVICE=m
+ CONFIG_MAILBOX=y
+-CONFIG_BCM2708_MBOX=y
+ CONFIG_BCM2835_MBOX=y
+ # CONFIG_IOMMU_SUPPORT is not set
+ CONFIG_EXTCON=m
+--- a/arch/arm/configs/bcm2835_defconfig
++++ b/arch/arm/configs/bcm2835_defconfig
+@@ -1065,7 +1065,6 @@ CONFIG_FB_TFT_WATTEROTT=m
+ CONFIG_FB_FLEX=m
+ CONFIG_FB_TFT_FBTFT_DEVICE=m
+ CONFIG_MAILBOX=y
+-CONFIG_BCM2708_MBOX=y
+ CONFIG_BCM2835_MBOX=y
+ # CONFIG_IOMMU_SUPPORT is not set
+ CONFIG_EXTCON=m
+--- a/arch/arm/configs/bcmrpi_defconfig
++++ b/arch/arm/configs/bcmrpi_defconfig
+@@ -1071,7 +1071,6 @@ CONFIG_FB_TFT_WATTEROTT=m
+ CONFIG_FB_FLEX=m
+ CONFIG_FB_TFT_FBTFT_DEVICE=m
+ CONFIG_MAILBOX=y
+-CONFIG_BCM2708_MBOX=y
+ CONFIG_BCM2835_MBOX=y
+ # CONFIG_IOMMU_SUPPORT is not set
+ CONFIG_EXTCON=m
--- /dev/null
+From 764892688e000751cdebf8fe20564b5fb1862ac1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
+Date: Fri, 24 Jul 2015 19:34:31 +0200
+Subject: [PATCH 146/148] bcm2708-vcio: Remove module
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+All drivers have been converted to the new firmware API, so this
+module is not needed anymore.
+
+Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
+---
+ drivers/mailbox/Kconfig | 6 --
+ drivers/mailbox/Makefile | 2 -
+ drivers/mailbox/bcm2708-vcio.c | 86 -----------------
+ include/linux/platform_data/mailbox-bcm2708.h | 127 --------------------------
+ 4 files changed, 221 deletions(-)
+ delete mode 100644 drivers/mailbox/bcm2708-vcio.c
+ delete mode 100644 include/linux/platform_data/mailbox-bcm2708.h
+
+--- a/drivers/mailbox/Kconfig
++++ b/drivers/mailbox/Kconfig
+@@ -7,12 +7,6 @@ menuconfig MAILBOX
+
+ if MAILBOX
+
+-config BCM2708_MBOX
+- bool "Broadcom BCM2708 Mailbox (vcio)"
+- depends on BCM2835_MBOX
+- help
+- Broadcom BCM2708 Mailbox (vcio)
+-
+ config ARM_MHU
+ tristate "ARM MHU Mailbox"
+ depends on ARM_AMBA
+--- a/drivers/mailbox/Makefile
++++ b/drivers/mailbox/Makefile
+@@ -2,8 +2,6 @@
+
+ obj-$(CONFIG_MAILBOX) += mailbox.o
+
+-obj-$(CONFIG_BCM2708_MBOX) += bcm2708-vcio.o
+-
+ obj-$(CONFIG_ARM_MHU) += arm_mhu.o
+
+ obj-$(CONFIG_PL320_MBOX) += pl320-ipc.o
+--- a/drivers/mailbox/bcm2708-vcio.c
++++ /dev/null
+@@ -1,86 +0,0 @@
+-/*
+- * Copyright (C) 2010 Broadcom
+- *
+- * This program is free software; you can redistribute it and/or modify
+- * it under the terms of the GNU General Public License version 2 as
+- * published by the Free Software Foundation.
+- *
+- * This device provides a shared mechanism for writing to the mailboxes,
+- * semaphores, doorbells etc. that are shared between the ARM and the
+- * VideoCore processor
+- */
+-
+-#include <linux/dma-mapping.h>
+-#include <linux/init.h>
+-#include <linux/module.h>
+-#include <linux/platform_data/mailbox-bcm2708.h>
+-#include <linux/uaccess.h>
+-#include <soc/bcm2835/raspberrypi-firmware.h>
+-
+-#define DRIVER_NAME "bcm2708_vcio"
+-
+-extern int bcm_mailbox_write(unsigned chan, uint32_t data28)
+-{
+- struct rpi_firmware *fw = rpi_firmware_get(NULL);
+-
+- if (!fw)
+- return -ENODEV;
+-
+- return rpi_firmware_transaction(fw, chan, data28);
+-}
+-EXPORT_SYMBOL_GPL(bcm_mailbox_write);
+-
+-extern int bcm_mailbox_read(unsigned chan, uint32_t *data28)
+-{
+- struct rpi_firmware *fw = rpi_firmware_get(NULL);
+-
+- if (!fw)
+- return -ENODEV;
+-
+- *data28 = rpi_firmware_transaction_received(fw);
+-
+- return 0;
+-}
+-EXPORT_SYMBOL_GPL(bcm_mailbox_read);
+-
+-static DEFINE_MUTEX(mailbox_lock);
+-extern int bcm_mailbox_property(void *data, int size)
+-{
+- uint32_t success;
+- dma_addr_t mem_bus; /* the memory address accessed from videocore */
+- void *mem_kern; /* the memory address accessed from driver */
+- int s = 0;
+-
+- mutex_lock(&mailbox_lock);
+- /* allocate some memory for the messages communicating with GPU */
+- mem_kern = dma_alloc_coherent(NULL, PAGE_ALIGN(size), &mem_bus,
+- GFP_KERNEL);
+- if (mem_kern) {
+- /* create the message */
+- memcpy(mem_kern, data, size);
+-
+- /* send the message */
+- wmb();
+- s = bcm_mailbox_write(MBOX_CHAN_PROPERTY, (uint32_t)mem_bus);
+- if (s == 0)
+- s = bcm_mailbox_read(MBOX_CHAN_PROPERTY, &success);
+- if (s == 0) {
+- /* copy the response */
+- rmb();
+- memcpy(data, mem_kern, size);
+- }
+- dma_free_coherent(NULL, PAGE_ALIGN(size), mem_kern, mem_bus);
+- } else {
+- s = -ENOMEM;
+- }
+- if (s != 0)
+- pr_err(DRIVER_NAME ": %s failed (%d)\n", __func__, s);
+-
+- mutex_unlock(&mailbox_lock);
+- return s;
+-}
+-EXPORT_SYMBOL_GPL(bcm_mailbox_property);
+-
+-MODULE_AUTHOR("Gray Girling");
+-MODULE_DESCRIPTION("ARM I/O to VideoCore processor");
+-MODULE_LICENSE("GPL");
+--- a/include/linux/platform_data/mailbox-bcm2708.h
++++ /dev/null
+@@ -1,127 +0,0 @@
+-/*
+- * Copyright (C) 2010 Broadcom
+- *
+- * 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; either version 2 of the License, or
+- * (at your option) any later version.
+- *
+- * 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.
+- */
+-#ifndef _PLAT_MAILBOX_BCM2708_H
+-#define _PLAT_MAILBOX_BCM2708_H
+-
+-/* Routines to handle I/O via the VideoCore "ARM control" registers
+- * (semaphores, doorbells, mailboxes)
+- */
+-
+-/* Constants shared with the ARM identifying separate mailbox channels */
+-#define MBOX_CHAN_POWER 0 /* for use by the power management interface */
+-#define MBOX_CHAN_FB 1 /* for use by the frame buffer */
+-#define MBOX_CHAN_VCHIQ 3 /* for use by the VCHIQ interface */
+-#define MBOX_CHAN_PROPERTY 8 /* for use by the property channel */
+-#define MBOX_CHAN_COUNT 9
+-
+-enum {
+- VCMSG_PROCESS_REQUEST = 0x00000000
+-};
+-
+-enum {
+- VCMSG_REQUEST_SUCCESSFUL = 0x80000000,
+- VCMSG_REQUEST_FAILED = 0x80000001
+-};
+-
+-/* Mailbox property tags */
+-enum {
+- VCMSG_PROPERTY_END = 0x00000000,
+- VCMSG_GET_FIRMWARE_REVISION = 0x00000001,
+- VCMSG_GET_BOARD_MODEL = 0x00010001,
+- VCMSG_GET_BOARD_REVISION = 0x00010002,
+- VCMSG_GET_BOARD_MAC_ADDRESS = 0x00010003,
+- VCMSG_GET_BOARD_SERIAL = 0x00010004,
+- VCMSG_GET_ARM_MEMORY = 0x00010005,
+- VCMSG_GET_VC_MEMORY = 0x00010006,
+- VCMSG_GET_CLOCKS = 0x00010007,
+- VCMSG_GET_COMMAND_LINE = 0x00050001,
+- VCMSG_GET_DMA_CHANNELS = 0x00060001,
+- VCMSG_GET_POWER_STATE = 0x00020001,
+- VCMSG_GET_TIMING = 0x00020002,
+- VCMSG_SET_POWER_STATE = 0x00028001,
+- VCMSG_GET_CLOCK_STATE = 0x00030001,
+- VCMSG_SET_CLOCK_STATE = 0x00038001,
+- VCMSG_GET_CLOCK_RATE = 0x00030002,
+- VCMSG_SET_CLOCK_RATE = 0x00038002,
+- VCMSG_GET_VOLTAGE = 0x00030003,
+- VCMSG_SET_VOLTAGE = 0x00038003,
+- VCMSG_GET_MAX_CLOCK = 0x00030004,
+- VCMSG_GET_MAX_VOLTAGE = 0x00030005,
+- VCMSG_GET_TEMPERATURE = 0x00030006,
+- VCMSG_GET_MIN_CLOCK = 0x00030007,
+- VCMSG_GET_MIN_VOLTAGE = 0x00030008,
+- VCMSG_GET_TURBO = 0x00030009,
+- VCMSG_GET_MAX_TEMPERATURE = 0x0003000a,
+- VCMSG_GET_STC = 0x0003000b,
+- VCMSG_SET_TURBO = 0x00038009,
+- VCMSG_SET_ALLOCATE_MEM = 0x0003000c,
+- VCMSG_SET_LOCK_MEM = 0x0003000d,
+- VCMSG_SET_UNLOCK_MEM = 0x0003000e,
+- VCMSG_SET_RELEASE_MEM = 0x0003000f,
+- VCMSG_SET_EXECUTE_CODE = 0x00030010,
+- VCMSG_SET_EXECUTE_QPU = 0x00030011,
+- VCMSG_SET_ENABLE_QPU = 0x00030012,
+- VCMSG_GET_RESOURCE_HANDLE = 0x00030014,
+- VCMSG_GET_EDID_BLOCK = 0x00030020,
+- VCMSG_GET_CUSTOMER_OTP = 0x00030021,
+- VCMSG_SET_CUSTOMER_OTP = 0x00038021,
+- VCMSG_SET_ALLOCATE_BUFFER = 0x00040001,
+- VCMSG_SET_RELEASE_BUFFER = 0x00048001,
+- VCMSG_SET_BLANK_SCREEN = 0x00040002,
+- VCMSG_TST_BLANK_SCREEN = 0x00044002,
+- VCMSG_GET_PHYSICAL_WIDTH_HEIGHT = 0x00040003,
+- VCMSG_TST_PHYSICAL_WIDTH_HEIGHT = 0x00044003,
+- VCMSG_SET_PHYSICAL_WIDTH_HEIGHT = 0x00048003,
+- VCMSG_GET_VIRTUAL_WIDTH_HEIGHT = 0x00040004,
+- VCMSG_TST_VIRTUAL_WIDTH_HEIGHT = 0x00044004,
+- VCMSG_SET_VIRTUAL_WIDTH_HEIGHT = 0x00048004,
+- VCMSG_GET_DEPTH = 0x00040005,
+- VCMSG_TST_DEPTH = 0x00044005,
+- VCMSG_SET_DEPTH = 0x00048005,
+- VCMSG_GET_PIXEL_ORDER = 0x00040006,
+- VCMSG_TST_PIXEL_ORDER = 0x00044006,
+- VCMSG_SET_PIXEL_ORDER = 0x00048006,
+- VCMSG_GET_ALPHA_MODE = 0x00040007,
+- VCMSG_TST_ALPHA_MODE = 0x00044007,
+- VCMSG_SET_ALPHA_MODE = 0x00048007,
+- VCMSG_GET_PITCH = 0x00040008,
+- VCMSG_TST_PITCH = 0x00044008,
+- VCMSG_SET_PITCH = 0x00048008,
+- VCMSG_GET_VIRTUAL_OFFSET = 0x00040009,
+- VCMSG_TST_VIRTUAL_OFFSET = 0x00044009,
+- VCMSG_SET_VIRTUAL_OFFSET = 0x00048009,
+- VCMSG_GET_OVERSCAN = 0x0004000a,
+- VCMSG_TST_OVERSCAN = 0x0004400a,
+- VCMSG_SET_OVERSCAN = 0x0004800a,
+- VCMSG_GET_PALETTE = 0x0004000b,
+- VCMSG_TST_PALETTE = 0x0004400b,
+- VCMSG_SET_PALETTE = 0x0004800b,
+- VCMSG_GET_LAYER = 0x0004000c,
+- VCMSG_TST_LAYER = 0x0004400c,
+- VCMSG_SET_LAYER = 0x0004800c,
+- VCMSG_GET_TRANSFORM = 0x0004000d,
+- VCMSG_TST_TRANSFORM = 0x0004400d,
+- VCMSG_SET_TRANSFORM = 0x0004800d,
+- VCMSG_TST_VSYNC = 0x0004400e,
+- VCMSG_SET_VSYNC = 0x0004800e,
+- VCMSG_GET_TOUCHBUF = 0x0004000f,
+- VCMSG_SET_CURSOR_INFO = 0x00008010,
+- VCMSG_SET_CURSOR_STATE = 0x00008011,
+-};
+-
+-int bcm_mailbox_read(unsigned chan, uint32_t *data28);
+-int bcm_mailbox_write(unsigned chan, uint32_t data28);
+-int bcm_mailbox_property(void *data, int size);
+-
+-#endif
--- /dev/null
+From dc3946ac37e0c7aed74b0041f742a102d37af425 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
+Date: Fri, 24 Jul 2015 19:34:55 +0200
+Subject: [PATCH 147/148] Revert "firmware: bcm2835: Support legacy mailbox
+ API"
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This reverts commit 40aa3c4f0c430cd5c574498f4d1d5e9f0bc1cf11.
+
+The legacy mailbox API has been removed so this is not needed.
+
+Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
+---
+ drivers/firmware/raspberrypi.c | 15 ++-------------
+ include/soc/bcm2835/raspberrypi-firmware.h | 2 --
+ 2 files changed, 2 insertions(+), 15 deletions(-)
+
+--- a/drivers/firmware/raspberrypi.c
++++ b/drivers/firmware/raspberrypi.c
+@@ -19,7 +19,6 @@
+ #define MBOX_MSG(chan, data28) (((data28) & ~0xf) | ((chan) & 0xf))
+ #define MBOX_CHAN(msg) ((msg) & 0xf)
+ #define MBOX_DATA28(msg) ((msg) & ~0xf)
+-#define MBOX_CHAN_VCHIQ 3
+ #define MBOX_CHAN_PROPERTY 8
+
+ struct rpi_firmware {
+@@ -27,7 +26,6 @@ struct rpi_firmware {
+ struct mbox_chan *chan; /* The property channel. */
+ struct completion c;
+ u32 enabled;
+- u32 received;
+ };
+
+ static struct platform_device *g_pdev;
+@@ -37,7 +35,6 @@ static DEFINE_MUTEX(transaction_lock);
+ static void response_callback(struct mbox_client *cl, void *msg)
+ {
+ struct rpi_firmware *fw = container_of(cl, struct rpi_firmware, cl);
+- fw->received = *(u32 *)msg;
+ complete(&fw->c);
+ }
+
+@@ -45,7 +42,7 @@ static void response_callback(struct mbo
+ * Sends a request to the firmware through the BCM2835 mailbox driver,
+ * and synchronously waits for the reply.
+ */
+-int
++static int
+ rpi_firmware_transaction(struct rpi_firmware *fw, u32 chan, u32 data)
+ {
+ u32 message = MBOX_MSG(chan, data);
+@@ -57,8 +54,7 @@ rpi_firmware_transaction(struct rpi_firm
+ reinit_completion(&fw->c);
+ ret = mbox_send_message(fw->chan, &message);
+ if (ret >= 0) {
+- if (chan != MBOX_CHAN_VCHIQ)
+- wait_for_completion(&fw->c);
++ wait_for_completion(&fw->c);
+ ret = 0;
+ } else {
+ dev_err(fw->cl.dev, "mbox_send_message returned %d\n", ret);
+@@ -67,13 +63,6 @@ rpi_firmware_transaction(struct rpi_firm
+
+ return ret;
+ }
+-EXPORT_SYMBOL(rpi_firmware_transaction);
+-
+-u32 rpi_firmware_transaction_received(struct rpi_firmware *fw)
+-{
+- return MBOX_DATA28(fw->received);
+-}
+-EXPORT_SYMBOL(rpi_firmware_transaction_received);
+
+ /**
+ * rpi_firmware_property_list - Submit firmware property list
+--- a/include/soc/bcm2835/raspberrypi-firmware.h
++++ b/include/soc/bcm2835/raspberrypi-firmware.h
+@@ -116,8 +116,6 @@ enum rpi_firmware_property_tag {
+ RPI_FIRMWARE_GET_DMA_CHANNELS = 0x00060001,
+ };
+
+-int rpi_firmware_transaction(struct rpi_firmware *fw, u32 chan, u32 data);
+-u32 rpi_firmware_transaction_received(struct rpi_firmware *fw);
+ int rpi_firmware_property(struct rpi_firmware *fw,
+ u32 tag, void *data, size_t len);
+ int rpi_firmware_property_list(struct rpi_firmware *fw,
--- /dev/null
+From 2a2dc4e5e4946e75b98c71eacc3660e913dbd302 Mon Sep 17 00:00:00 2001
+From: Jonathan Bell <jonathan@raspberrypi.org>
+Date: Tue, 30 Jun 2015 12:35:39 +0100
+Subject: [PATCH 148/148] pinctrl: bcm2835: Clear the event latch register when
+ disabling interrupts
+
+It's possible to hit a race condition if interrupts are generated on a GPIO
+pin when the IRQ line in question is being disabled.
+
+If the interrupt is freed, bcm2835_gpio_irq_disable() is called which
+disables the event generation sources (edge, level). If an event occurred
+between the last disabling of hard IRQs and the write to the event
+source registers, a bit would be set in the GPIO event detect register
+(GPEDSn) which goes unacknowledged by bcm2835_gpio_irq_handler()
+so Linux complains loudly.
+
+There is no per-GPIO mask register, so when disabling GPIO interrupts
+write 1 to the relevant bit in GPEDSn to clear out any stale events.
+
+Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
+Acked-by: Stephen Warren <swarren@wwwdotorg.org>
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+---
+ drivers/pinctrl/bcm/pinctrl-bcm2835.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c
++++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
+@@ -503,6 +503,8 @@ static void bcm2835_gpio_irq_disable(str
+
+ spin_lock_irqsave(&pc->irq_lock[bank], flags);
+ bcm2835_gpio_irq_config(pc, gpio, false);
++ /* Clear events that were latched prior to clearing event sources */
++ bcm2835_gpio_set_bit(pc, GPEDS0, gpio);
+ clear_bit(offset, &pc->enabled_irq_map[bank]);
+ spin_unlock_irqrestore(&pc->irq_lock[bank], flags);
+ }