Skip to content

Commit

Permalink
Revert "firmware: bcm2835: Support legacy mailbox API"
Browse files Browse the repository at this point in the history
This reverts commit 40aa3c4.

The legacy mailbox API has been removed so this is not needed.

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
  • Loading branch information
notro committed Jul 24, 2015
1 parent 7648926 commit dc3946a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
15 changes: 2 additions & 13 deletions drivers/firmware/raspberrypi.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@
#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 {
struct mbox_client cl;
struct mbox_chan *chan; /* The property channel. */
struct completion c;
u32 enabled;
u32 received;
};

static struct platform_device *g_pdev;
Expand All @@ -37,15 +35,14 @@ 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);
}

/*
* 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);
Expand All @@ -57,8 +54,7 @@ rpi_firmware_transaction(struct rpi_firmware *fw, u32 chan, u32 data)
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);
Expand All @@ -67,13 +63,6 @@ rpi_firmware_transaction(struct rpi_firmware *fw, u32 chan, u32 data)

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
Expand Down
2 changes: 0 additions & 2 deletions include/soc/bcm2835/raspberrypi-firmware.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit dc3946a

Please sign in to comment.