Commit 77331719 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'mailbox-v6.6' of git://git.linaro.org/landing-teams/working/fujitsu/integration

Pull mailbox updates from Jassi Brar:

 - qcom: fix incorrect num_chans counting

 - mhu: Remove redundant dev_err

 - bcm: fix comments

 - common changes:
    - convert to use devm_platform_get_and_ioremap_resource
    - correct DT includes

* tag 'mailbox-v6.6' of git://git.linaro.org/landing-teams/working/fujitsu/integration:
  mailbox: qcom-ipcc: fix incorrect num_chans counting
  mailbox: Explicitly include correct DT includes
  mailbox: ti-msgmgr: Use devm_platform_ioremap_resource_byname()
  mailbox: platform-mhu: Remove redundant dev_err()
  mailbox: bcm-pdc: Fix some kernel-doc comments
  mailbox: mailbox-test: Fix an error check in mbox_test_probe()
  mailbox: tegra-hsp: Convert to devm_platform_ioremap_resource()
  mailbox: rockchip: Use devm_platform_get_and_ioremap_resource()
  mailbox: mailbox-test: Use devm_platform_get_and_ioremap_resource()
  mailbox: bcm-pdc: Use devm_platform_get_and_ioremap_resource()
  mailbox: bcm-ferxrm-mailbox: Use devm_platform_get_and_ioremap_resource()
parents 3c5c9b7c a4932080
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <linux/io.h> #include <linux/io.h>
#include <linux/mailbox_controller.h> #include <linux/mailbox_controller.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of.h>
#define INTR_STAT_OFS 0x0 #define INTR_STAT_OFS 0x0
#define INTR_SET_OFS 0x8 #define INTR_SET_OFS 0x8
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include <linux/mailbox_controller.h> #include <linux/mailbox_controller.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_device.h>
#define INTR_STAT_OFS 0x0 #define INTR_STAT_OFS 0x0
#define INTR_SET_OFS 0x8 #define INTR_SET_OFS 0x8
......
...@@ -1501,16 +1501,12 @@ static int flexrm_mbox_probe(struct platform_device *pdev) ...@@ -1501,16 +1501,12 @@ static int flexrm_mbox_probe(struct platform_device *pdev)
mbox->dev = dev; mbox->dev = dev;
platform_set_drvdata(pdev, mbox); platform_set_drvdata(pdev, mbox);
/* Get resource for registers */ /* Get resource for registers and map registers of all rings */
iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); mbox->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &iomem);
if (!iomem || (resource_size(iomem) < RING_REGS_SIZE)) { if (!iomem || (resource_size(iomem) < RING_REGS_SIZE)) {
ret = -ENODEV; ret = -ENODEV;
goto fail; goto fail;
} } else if (IS_ERR(mbox->regs)) {
/* Map registers of all rings */
mbox->regs = devm_ioremap_resource(&pdev->dev, iomem);
if (IS_ERR(mbox->regs)) {
ret = PTR_ERR(mbox->regs); ret = PTR_ERR(mbox->regs);
goto fail; goto fail;
} }
......
...@@ -694,7 +694,7 @@ pdc_receive(struct pdc_state *pdcs) ...@@ -694,7 +694,7 @@ pdc_receive(struct pdc_state *pdcs)
* pdc_tx_list_sg_add() - Add the buffers in a scatterlist to the transmit * pdc_tx_list_sg_add() - Add the buffers in a scatterlist to the transmit
* descriptors for a given SPU. The scatterlist buffers contain the data for a * descriptors for a given SPU. The scatterlist buffers contain the data for a
* SPU request message. * SPU request message.
* @spu_idx: The index of the SPU to submit the request to, [0, max_spu) * @pdcs: PDC state for the SPU that will process this request
* @sg: Scatterlist whose buffers contain part of the SPU request * @sg: Scatterlist whose buffers contain part of the SPU request
* *
* If a scatterlist buffer is larger than PDC_DMA_BUF_MAX, multiple descriptors * If a scatterlist buffer is larger than PDC_DMA_BUF_MAX, multiple descriptors
...@@ -861,7 +861,7 @@ static int pdc_rx_list_init(struct pdc_state *pdcs, struct scatterlist *dst_sg, ...@@ -861,7 +861,7 @@ static int pdc_rx_list_init(struct pdc_state *pdcs, struct scatterlist *dst_sg,
* pdc_rx_list_sg_add() - Add the buffers in a scatterlist to the receive * pdc_rx_list_sg_add() - Add the buffers in a scatterlist to the receive
* descriptors for a given SPU. The caller must have already DMA mapped the * descriptors for a given SPU. The caller must have already DMA mapped the
* scatterlist. * scatterlist.
* @spu_idx: Indicates which SPU the buffers are for * @pdcs: PDC state for the SPU that will process this request
* @sg: Scatterlist whose buffers are added to the receive ring * @sg: Scatterlist whose buffers are added to the receive ring
* *
* If a receive buffer in the scatterlist is larger than PDC_DMA_BUF_MAX, * If a receive buffer in the scatterlist is larger than PDC_DMA_BUF_MAX,
...@@ -960,7 +960,7 @@ static irqreturn_t pdc_irq_handler(int irq, void *data) ...@@ -960,7 +960,7 @@ static irqreturn_t pdc_irq_handler(int irq, void *data)
/** /**
* pdc_tasklet_cb() - Tasklet callback that runs the deferred processing after * pdc_tasklet_cb() - Tasklet callback that runs the deferred processing after
* a DMA receive interrupt. Reenables the receive interrupt. * a DMA receive interrupt. Reenables the receive interrupt.
* @data: PDC state structure * @t: Pointer to the Altera sSGDMA channel structure
*/ */
static void pdc_tasklet_cb(struct tasklet_struct *t) static void pdc_tasklet_cb(struct tasklet_struct *t)
{ {
...@@ -1566,19 +1566,13 @@ static int pdc_probe(struct platform_device *pdev) ...@@ -1566,19 +1566,13 @@ static int pdc_probe(struct platform_device *pdev)
if (err) if (err)
goto cleanup_ring_pool; goto cleanup_ring_pool;
pdc_regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); pdcs->pdc_reg_vbase = devm_platform_get_and_ioremap_resource(pdev, 0, &pdc_regs);
if (!pdc_regs) {
err = -ENODEV;
goto cleanup_ring_pool;
}
dev_dbg(dev, "PDC register region res.start = %pa, res.end = %pa",
&pdc_regs->start, &pdc_regs->end);
pdcs->pdc_reg_vbase = devm_ioremap_resource(&pdev->dev, pdc_regs);
if (IS_ERR(pdcs->pdc_reg_vbase)) { if (IS_ERR(pdcs->pdc_reg_vbase)) {
err = PTR_ERR(pdcs->pdc_reg_vbase); err = PTR_ERR(pdcs->pdc_reg_vbase);
goto cleanup_ring_pool; goto cleanup_ring_pool;
} }
dev_dbg(dev, "PDC register region res.start = %pa, res.end = %pa",
&pdc_regs->start, &pdc_regs->end);
/* create rx buffer pool after dt read to know how big buffers are */ /* create rx buffer pool after dt read to know how big buffers are */
err = pdc_rx_buf_pool_create(pdcs); err = pdc_rx_buf_pool_create(pdcs);
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <linux/iopoll.h> #include <linux/iopoll.h>
#include <linux/mailbox_controller.h> #include <linux/mailbox_controller.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/slab.h> #include <linux/slab.h>
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include <linux/kfifo.h> #include <linux/kfifo.h>
#include <linux/mailbox_controller.h> #include <linux/mailbox_controller.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/slab.h> #include <linux/slab.h>
......
...@@ -14,7 +14,8 @@ ...@@ -14,7 +14,8 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/mailbox_controller.h> #include <linux/mailbox_controller.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of_device.h> #include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/suspend.h> #include <linux/suspend.h>
#include <linux/slab.h> #include <linux/slab.h>
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/mod_devicetable.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/mailbox_controller.h> #include <linux/mailbox_controller.h>
#include <soc/microchip/mpfs.h> #include <soc/microchip/mpfs.h>
......
...@@ -367,8 +367,7 @@ static int mbox_test_probe(struct platform_device *pdev) ...@@ -367,8 +367,7 @@ static int mbox_test_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
/* It's okay for MMIO to be NULL */ /* It's okay for MMIO to be NULL */
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); tdev->tx_mmio = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
tdev->tx_mmio = devm_ioremap_resource(&pdev->dev, res);
if (PTR_ERR(tdev->tx_mmio) == -EBUSY) { if (PTR_ERR(tdev->tx_mmio) == -EBUSY) {
/* if reserved area in SRAM, try just ioremap */ /* if reserved area in SRAM, try just ioremap */
size = resource_size(res); size = resource_size(res);
...@@ -378,8 +377,7 @@ static int mbox_test_probe(struct platform_device *pdev) ...@@ -378,8 +377,7 @@ static int mbox_test_probe(struct platform_device *pdev)
} }
/* If specified, second reg entry is Rx MMIO */ /* If specified, second reg entry is Rx MMIO */
res = platform_get_resource(pdev, IORESOURCE_MEM, 1); tdev->rx_mmio = devm_platform_get_and_ioremap_resource(pdev, 1, &res);
tdev->rx_mmio = devm_ioremap_resource(&pdev->dev, res);
if (PTR_ERR(tdev->rx_mmio) == -EBUSY) { if (PTR_ERR(tdev->rx_mmio) == -EBUSY) {
size = resource_size(res); size = resource_size(res);
tdev->rx_mmio = devm_ioremap(&pdev->dev, res->start, size); tdev->rx_mmio = devm_ioremap(&pdev->dev, res->start, size);
...@@ -390,7 +388,7 @@ static int mbox_test_probe(struct platform_device *pdev) ...@@ -390,7 +388,7 @@ static int mbox_test_probe(struct platform_device *pdev)
tdev->tx_channel = mbox_test_request_channel(pdev, "tx"); tdev->tx_channel = mbox_test_request_channel(pdev, "tx");
tdev->rx_channel = mbox_test_request_channel(pdev, "rx"); tdev->rx_channel = mbox_test_request_channel(pdev, "rx");
if (!tdev->tx_channel && !tdev->rx_channel) if (IS_ERR_OR_NULL(tdev->tx_channel) && IS_ERR_OR_NULL(tdev->rx_channel))
return -EPROBE_DEFER; return -EPROBE_DEFER;
/* If Rx is not specified but has Rx MMIO, then Rx = Tx */ /* If Rx is not specified but has Rx MMIO, then Rx = Tx */
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <linux/bitops.h> #include <linux/bitops.h>
#include <linux/mailbox_client.h> #include <linux/mailbox_client.h>
#include <linux/mailbox_controller.h> #include <linux/mailbox_controller.h>
#include <linux/of.h>
#include "mailbox.h" #include "mailbox.h"
......
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/mailbox_controller.h> #include <linux/mailbox_controller.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of_device.h> #include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/slab.h> #include <linux/slab.h>
struct mtk_adsp_mbox_priv { struct mtk_adsp_mbox_priv {
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/mailbox_controller.h> #include <linux/mailbox_controller.h>
#include <linux/mailbox/mtk-cmdq-mailbox.h> #include <linux/mailbox/mtk-cmdq-mailbox.h>
#include <linux/of_device.h> #include <linux/of.h>
#define CMDQ_OP_CODE_MASK (0xff << CMDQ_OP_CODE_SHIFT) #define CMDQ_OP_CODE_MASK (0xff << CMDQ_OP_CODE_SHIFT)
#define CMDQ_NUM_CMD(t) (t->cmd_buf_size / CMDQ_INST_SIZE) #define CMDQ_NUM_CMD(t) (t->cmd_buf_size / CMDQ_INST_SIZE)
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include <linux/kfifo.h> #include <linux/kfifo.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of_device.h> #include <linux/of.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/omap-mailbox.h> #include <linux/omap-mailbox.h>
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/mailbox_controller.h> #include <linux/mailbox_controller.h>
...@@ -135,10 +136,8 @@ static int platform_mhu_probe(struct platform_device *pdev) ...@@ -135,10 +136,8 @@ static int platform_mhu_probe(struct platform_device *pdev)
for (i = 0; i < MHU_CHANS; i++) { for (i = 0; i < MHU_CHANS; i++) {
mhu->chan[i].con_priv = &mhu->mlink[i]; mhu->chan[i].con_priv = &mhu->mlink[i];
mhu->mlink[i].irq = platform_get_irq(pdev, i); mhu->mlink[i].irq = platform_get_irq(pdev, i);
if (mhu->mlink[i].irq < 0) { if (mhu->mlink[i].irq < 0)
dev_err(dev, "failed to get irq%d\n", i);
return mhu->mlink[i].irq; return mhu->mlink[i].irq;
}
mhu->mlink[i].rx_reg = mhu->base + platform_mhu_reg[i]; mhu->mlink[i].rx_reg = mhu->base + platform_mhu_reg[i];
mhu->mlink[i].tx_reg = mhu->mlink[i].rx_reg + TX_REG_OFFSET; mhu->mlink[i].tx_reg = mhu->mlink[i].rx_reg + TX_REG_OFFSET;
} }
......
...@@ -227,10 +227,8 @@ static int qcom_ipcc_setup_mbox(struct qcom_ipcc *ipcc, ...@@ -227,10 +227,8 @@ static int qcom_ipcc_setup_mbox(struct qcom_ipcc *ipcc,
ret = of_parse_phandle_with_args(client_dn, "mboxes", ret = of_parse_phandle_with_args(client_dn, "mboxes",
"#mbox-cells", j, &curr_ph); "#mbox-cells", j, &curr_ph);
of_node_put(curr_ph.np); of_node_put(curr_ph.np);
if (!ret && curr_ph.np == controller_dn) { if (!ret && curr_ph.np == controller_dn)
ipcc->num_chans++; ipcc->num_chans++;
break;
}
} }
} }
......
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
#include <linux/io.h> #include <linux/io.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/mailbox_controller.h> #include <linux/mailbox_controller.h>
#include <linux/of.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of_device.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#define MAILBOX_A2B_INTEN 0x00 #define MAILBOX_A2B_INTEN 0x00
...@@ -194,11 +194,7 @@ static int rockchip_mbox_probe(struct platform_device *pdev) ...@@ -194,11 +194,7 @@ static int rockchip_mbox_probe(struct platform_device *pdev)
mb->mbox.ops = &rockchip_mbox_chan_ops; mb->mbox.ops = &rockchip_mbox_chan_ops;
mb->mbox.txdone_irq = true; mb->mbox.txdone_irq = true;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); mb->mbox_base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (!res)
return -ENODEV;
mb->mbox_base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(mb->mbox_base)) if (IS_ERR(mb->mbox_base))
return PTR_ERR(mb->mbox_base); return PTR_ERR(mb->mbox_base);
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include <linux/io.h> #include <linux/io.h>
#include <linux/mailbox_controller.h> #include <linux/mailbox_controller.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of_device.h> #include <linux/of.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/clk.h> #include <linux/clk.h>
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <linux/io.h> #include <linux/io.h>
#include <linux/mailbox_controller.h> #include <linux/mailbox_controller.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/pm_wakeirq.h> #include <linux/pm_wakeirq.h>
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include <linux/io.h> #include <linux/io.h>
#include <linux/mailbox_controller.h> #include <linux/mailbox_controller.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_device.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/pm.h> #include <linux/pm.h>
#include <linux/slab.h> #include <linux/slab.h>
...@@ -728,7 +727,6 @@ static int tegra_hsp_request_shared_irq(struct tegra_hsp *hsp) ...@@ -728,7 +727,6 @@ static int tegra_hsp_request_shared_irq(struct tegra_hsp *hsp)
static int tegra_hsp_probe(struct platform_device *pdev) static int tegra_hsp_probe(struct platform_device *pdev)
{ {
struct tegra_hsp *hsp; struct tegra_hsp *hsp;
struct resource *res;
unsigned int i; unsigned int i;
u32 value; u32 value;
int err; int err;
...@@ -742,8 +740,7 @@ static int tegra_hsp_probe(struct platform_device *pdev) ...@@ -742,8 +740,7 @@ static int tegra_hsp_probe(struct platform_device *pdev)
INIT_LIST_HEAD(&hsp->doorbells); INIT_LIST_HEAD(&hsp->doorbells);
spin_lock_init(&hsp->lock); spin_lock_init(&hsp->lock);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); hsp->regs = devm_platform_ioremap_resource(pdev, 0);
hsp->regs = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(hsp->regs)) if (IS_ERR(hsp->regs))
return PTR_ERR(hsp->regs); return PTR_ERR(hsp->regs);
......
...@@ -812,7 +812,6 @@ static int ti_msgmgr_probe(struct platform_device *pdev) ...@@ -812,7 +812,6 @@ static int ti_msgmgr_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
const struct of_device_id *of_id; const struct of_device_id *of_id;
struct device_node *np; struct device_node *np;
struct resource *res;
const struct ti_msgmgr_desc *desc; const struct ti_msgmgr_desc *desc;
struct ti_msgmgr_inst *inst; struct ti_msgmgr_inst *inst;
struct ti_queue_inst *qinst; struct ti_queue_inst *qinst;
...@@ -843,22 +842,19 @@ static int ti_msgmgr_probe(struct platform_device *pdev) ...@@ -843,22 +842,19 @@ static int ti_msgmgr_probe(struct platform_device *pdev)
inst->dev = dev; inst->dev = dev;
inst->desc = desc; inst->desc = desc;
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, inst->queue_proxy_region =
desc->data_region_name); devm_platform_ioremap_resource_byname(pdev, desc->data_region_name);
inst->queue_proxy_region = devm_ioremap_resource(dev, res);
if (IS_ERR(inst->queue_proxy_region)) if (IS_ERR(inst->queue_proxy_region))
return PTR_ERR(inst->queue_proxy_region); return PTR_ERR(inst->queue_proxy_region);
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, inst->queue_state_debug_region =
desc->status_region_name); devm_platform_ioremap_resource_byname(pdev, desc->status_region_name);
inst->queue_state_debug_region = devm_ioremap_resource(dev, res);
if (IS_ERR(inst->queue_state_debug_region)) if (IS_ERR(inst->queue_state_debug_region))
return PTR_ERR(inst->queue_state_debug_region); return PTR_ERR(inst->queue_state_debug_region);
if (desc->is_sproxy) { if (desc->is_sproxy) {
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, inst->queue_ctrl_region =
desc->ctrl_region_name); devm_platform_ioremap_resource_byname(pdev, desc->ctrl_region_name);
inst->queue_ctrl_region = devm_ioremap_resource(dev, res);
if (IS_ERR(inst->queue_ctrl_region)) if (IS_ERR(inst->queue_ctrl_region))
return PTR_ERR(inst->queue_ctrl_region); return PTR_ERR(inst->queue_ctrl_region);
} }
......
...@@ -16,8 +16,6 @@ ...@@ -16,8 +16,6 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_address.h> #include <linux/of_address.h>
#include <linux/of_device.h>
#include <linux/of_irq.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
/* IPI agent ID any */ /* IPI agent ID any */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment