brcm2708: update 4.1 patches
[openwrt/openwrt.git] / target / linux / brcm2708 / patches-4.1 / 0147-Revert-firmware-bcm2835-Support-legacy-mailbox-API.patch
1 From dc3946ac37e0c7aed74b0041f742a102d37af425 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= <noralf@tronnes.org>
3 Date: Fri, 24 Jul 2015 19:34:55 +0200
4 Subject: [PATCH 147/148] Revert "firmware: bcm2835: Support legacy mailbox
5 API"
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
10 This reverts commit 40aa3c4f0c430cd5c574498f4d1d5e9f0bc1cf11.
11
12 The legacy mailbox API has been removed so this is not needed.
13
14 Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
15 ---
16 drivers/firmware/raspberrypi.c | 15 ++-------------
17 include/soc/bcm2835/raspberrypi-firmware.h | 2 --
18 2 files changed, 2 insertions(+), 15 deletions(-)
19
20 --- a/drivers/firmware/raspberrypi.c
21 +++ b/drivers/firmware/raspberrypi.c
22 @@ -19,7 +19,6 @@
23 #define MBOX_MSG(chan, data28) (((data28) & ~0xf) | ((chan) & 0xf))
24 #define MBOX_CHAN(msg) ((msg) & 0xf)
25 #define MBOX_DATA28(msg) ((msg) & ~0xf)
26 -#define MBOX_CHAN_VCHIQ 3
27 #define MBOX_CHAN_PROPERTY 8
28
29 struct rpi_firmware {
30 @@ -27,7 +26,6 @@ struct rpi_firmware {
31 struct mbox_chan *chan; /* The property channel. */
32 struct completion c;
33 u32 enabled;
34 - u32 received;
35 };
36
37 static struct platform_device *g_pdev;
38 @@ -37,7 +35,6 @@ static DEFINE_MUTEX(transaction_lock);
39 static void response_callback(struct mbox_client *cl, void *msg)
40 {
41 struct rpi_firmware *fw = container_of(cl, struct rpi_firmware, cl);
42 - fw->received = *(u32 *)msg;
43 complete(&fw->c);
44 }
45
46 @@ -45,7 +42,7 @@ static void response_callback(struct mbo
47 * Sends a request to the firmware through the BCM2835 mailbox driver,
48 * and synchronously waits for the reply.
49 */
50 -int
51 +static int
52 rpi_firmware_transaction(struct rpi_firmware *fw, u32 chan, u32 data)
53 {
54 u32 message = MBOX_MSG(chan, data);
55 @@ -57,8 +54,7 @@ rpi_firmware_transaction(struct rpi_firm
56 reinit_completion(&fw->c);
57 ret = mbox_send_message(fw->chan, &message);
58 if (ret >= 0) {
59 - if (chan != MBOX_CHAN_VCHIQ)
60 - wait_for_completion(&fw->c);
61 + wait_for_completion(&fw->c);
62 ret = 0;
63 } else {
64 dev_err(fw->cl.dev, "mbox_send_message returned %d\n", ret);
65 @@ -67,13 +63,6 @@ rpi_firmware_transaction(struct rpi_firm
66
67 return ret;
68 }
69 -EXPORT_SYMBOL(rpi_firmware_transaction);
70 -
71 -u32 rpi_firmware_transaction_received(struct rpi_firmware *fw)
72 -{
73 - return MBOX_DATA28(fw->received);
74 -}
75 -EXPORT_SYMBOL(rpi_firmware_transaction_received);
76
77 /**
78 * rpi_firmware_property_list - Submit firmware property list
79 --- a/include/soc/bcm2835/raspberrypi-firmware.h
80 +++ b/include/soc/bcm2835/raspberrypi-firmware.h
81 @@ -116,8 +116,6 @@ enum rpi_firmware_property_tag {
82 RPI_FIRMWARE_GET_DMA_CHANNELS = 0x00060001,
83 };
84
85 -int rpi_firmware_transaction(struct rpi_firmware *fw, u32 chan, u32 data);
86 -u32 rpi_firmware_transaction_received(struct rpi_firmware *fw);
87 int rpi_firmware_property(struct rpi_firmware *fw,
88 u32 tag, void *data, size_t len);
89 int rpi_firmware_property_list(struct rpi_firmware *fw,