hostapd: remove old button hotplug script
[openwrt.git] / target / linux / ar71xx / patches-3.8 / 006-spi-ath79-add-shutdown-handler.patch
1 From a32b0e7851320cba0144d20e87e5326ee81e1063 Mon Sep 17 00:00:00 2001
2 From: Gabor Juhos <juhosg@openwrt.org>
3 Date: Tue, 5 Feb 2013 20:57:55 +0100
4 Subject: [PATCH] spi/ath79: add shutdown handler
5
6 commit 7410e848583f9120dd5f9414629f01bb76b5ee5f upstream.
7
8 The SPI controller of the AR7xxx/AR9xxx SoCs
9 have a special mode which allows the SoC to
10 directly read data from SPI flash chips. In
11 this mode, the content of the SPI flash chip
12 can be accessed via a memory mapped region.
13
14 During early init time, the kernel expects
15 that the flash chip is accessible through
16 that memory region because it reads board
17 specific values (e.g. MAC address, WiFi
18 calibration data) from the flash on various
19 boards.
20
21 This is working if the kernel is loaded
22 directly by the bootloader because that
23 leaves the SPI controller in the special
24 mode. However it is not working in a kexec'd
25 kernel because the SPI driver does not restore
26 the special mode during shutdown.
27
28 The patch adds a shutdown handler to fix this
29 issue.
30
31 Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
32 Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
33 ---
34  drivers/spi/spi-ath79.c |    6 ++++++
35  1 file changed, 6 insertions(+)
36
37 --- a/drivers/spi/spi-ath79.c
38 +++ b/drivers/spi/spi-ath79.c
39 @@ -308,9 +308,15 @@ static int ath79_spi_remove(struct platf
40         return 0;
41  }
42  
43 +static void ath79_spi_shutdown(struct platform_device *pdev)
44 +{
45 +       ath79_spi_remove(pdev);
46 +}
47 +
48  static struct platform_driver ath79_spi_driver = {
49         .probe          = ath79_spi_probe,
50         .remove         = ath79_spi_remove,
51 +       .shutdown       = ath79_spi_shutdown,
52         .driver         = {
53                 .name   = DRV_NAME,
54                 .owner  = THIS_MODULE,