Skip to content

Commit e7ed343

Browse files
committed
Merge tag 'mailbox-v6.12' of git://git.kernel.org/pub/scm/linux/kernel/git/jassibrar/mailbox
Pull mailbox updates from Jassi Brar: - fix kconfig dependencies (mhu-v3, omap2+) - use devie name instead of genereic imx_mu_chan as interrupt name (imx) - enable sa8255p and qcs8300 ipc controllers (qcom) - Fix timeout during suspend mode (bcm2835) - convert to use use of_property_match_string (mailbox) - enable mt8188 (mediatek) - use devm_clk_get_enabled helpers (spreadtrum) - fix device-id typo (rockchip) * tag 'mailbox-v6.12' of git://git.kernel.org/pub/scm/linux/kernel/git/jassibrar/mailbox: mailbox, remoteproc: omap2+: fix compile testing dt-bindings: mailbox: qcom-ipcc: Document QCS8300 IPCC dt-bindings: mailbox: qcom-ipcc: document the support for SA8255p dt-bindings: mailbox: mtk,adsp-mbox: Add compatible for MT8188 mailbox: Use of_property_match_string() instead of open-coding mailbox: bcm2835: Fix timeout during suspend mode mailbox: sprd: Use devm_clk_get_enabled() helpers mailbox: rockchip: fix a typo in module autoloading mailbox: imx: use device name in interrupt name mailbox: ARM_MHU_V3 should depend on ARM64
2 parents 907537f + 54595f2 commit e7ed343

File tree

10 files changed

+32
-51
lines changed

10 files changed

+32
-51
lines changed

Documentation/devicetree/bindings/mailbox/mtk,adsp-mbox.yaml

+9-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,15 @@ description: |
1717
1818
properties:
1919
compatible:
20-
enum:
21-
- mediatek,mt8195-adsp-mbox
22-
- mediatek,mt8186-adsp-mbox
20+
oneOf:
21+
- enum:
22+
- mediatek,mt8186-adsp-mbox
23+
- mediatek,mt8195-adsp-mbox
24+
- items:
25+
- enum:
26+
- mediatek,mt8188-adsp-mbox
27+
- const: mediatek,mt8186-adsp-mbox
28+
2329

2430
"#mbox-cells":
2531
const: 0

Documentation/devicetree/bindings/mailbox/qcom-ipcc.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ properties:
2424
compatible:
2525
items:
2626
- enum:
27+
- qcom,qcs8300-ipcc
2728
- qcom,qdu1000-ipcc
29+
- qcom,sa8255p-ipcc
2830
- qcom,sa8775p-ipcc
2931
- qcom,sc7280-ipcc
3032
- qcom,sc8280xp-ipcc

drivers/mailbox/Kconfig

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ config ARM_MHU_V2
2525

2626
config ARM_MHU_V3
2727
tristate "ARM MHUv3 Mailbox"
28+
depends on ARM64 || COMPILE_TEST
2829
depends on HAS_IOMEM || COMPILE_TEST
2930
depends on OF
3031
help
@@ -73,7 +74,7 @@ config ARMADA_37XX_RWTM_MBOX
7374

7475
config OMAP2PLUS_MBOX
7576
tristate "OMAP2+ Mailbox framework support"
76-
depends on ARCH_OMAP2PLUS || ARCH_K3
77+
depends on ARCH_OMAP2PLUS || ARCH_K3 || COMPILE_TEST
7778
help
7879
Mailbox implementation for OMAP family chips with hardware for
7980
interprocessor communication involving DSP, IVA1.0 and IVA2 in

drivers/mailbox/bcm2835-mailbox.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ static int bcm2835_mbox_probe(struct platform_device *pdev)
145145
spin_lock_init(&mbox->lock);
146146

147147
ret = devm_request_irq(dev, irq_of_parse_and_map(dev->of_node, 0),
148-
bcm2835_mbox_irq, 0, dev_name(dev), mbox);
148+
bcm2835_mbox_irq, IRQF_NO_SUSPEND, dev_name(dev),
149+
mbox);
149150
if (ret) {
150151
dev_err(dev, "Failed to register a mailbox IRQ handler: %d\n",
151152
ret);

drivers/mailbox/imx-mailbox.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#define IMX_MU_SCU_CHANS 6
3131
/* TX0/RX0 */
3232
#define IMX_MU_S4_CHANS 2
33-
#define IMX_MU_CHAN_NAME_SIZE 20
33+
#define IMX_MU_CHAN_NAME_SIZE 32
3434

3535
#define IMX_MU_V2_PAR_OFF 0x4
3636
#define IMX_MU_V2_TR_MASK GENMASK(7, 0)
@@ -782,7 +782,7 @@ static int imx_mu_init_generic(struct imx_mu_priv *priv)
782782
cp->chan = &priv->mbox_chans[i];
783783
priv->mbox_chans[i].con_priv = cp;
784784
snprintf(cp->irq_desc, sizeof(cp->irq_desc),
785-
"imx_mu_chan[%i-%i]", cp->type, cp->idx);
785+
"%s[%i-%i]", dev_name(priv->dev), cp->type, cp->idx);
786786
}
787787

788788
priv->mbox.num_chans = IMX_MU_CHANS;
@@ -819,7 +819,7 @@ static int imx_mu_init_specific(struct imx_mu_priv *priv)
819819
cp->chan = &priv->mbox_chans[i];
820820
priv->mbox_chans[i].con_priv = cp;
821821
snprintf(cp->irq_desc, sizeof(cp->irq_desc),
822-
"imx_mu_chan[%i-%i]", cp->type, cp->idx);
822+
"%s[%i-%i]", dev_name(priv->dev), cp->type, cp->idx);
823823
}
824824

825825
priv->mbox.num_chans = num_chans;

drivers/mailbox/mailbox.c

+6-16
Original file line numberDiff line numberDiff line change
@@ -450,30 +450,20 @@ struct mbox_chan *mbox_request_channel_byname(struct mbox_client *cl,
450450
const char *name)
451451
{
452452
struct device_node *np = cl->dev->of_node;
453-
struct property *prop;
454-
const char *mbox_name;
455-
int index = 0;
453+
int index;
456454

457455
if (!np) {
458456
dev_err(cl->dev, "%s() currently only supports DT\n", __func__);
459457
return ERR_PTR(-EINVAL);
460458
}
461459

462-
if (!of_get_property(np, "mbox-names", NULL)) {
463-
dev_err(cl->dev,
464-
"%s() requires an \"mbox-names\" property\n", __func__);
460+
index = of_property_match_string(np, "mbox-names", name);
461+
if (index < 0) {
462+
dev_err(cl->dev, "%s() could not locate channel named \"%s\"\n",
463+
__func__, name);
465464
return ERR_PTR(-EINVAL);
466465
}
467-
468-
of_property_for_each_string(np, "mbox-names", prop, mbox_name) {
469-
if (!strncmp(name, mbox_name, strlen(name)))
470-
return mbox_request_channel(cl, index);
471-
index++;
472-
}
473-
474-
dev_err(cl->dev, "%s() could not locate channel named \"%s\"\n",
475-
__func__, name);
476-
return ERR_PTR(-EINVAL);
466+
return mbox_request_channel(cl, index);
477467
}
478468
EXPORT_SYMBOL_GPL(mbox_request_channel_byname);
479469

drivers/mailbox/omap-mailbox.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ static struct platform_driver omap_mbox_driver = {
603603
.driver = {
604604
.name = "omap-mailbox",
605605
.pm = &omap_mbox_pm_ops,
606-
.of_match_table = of_match_ptr(omap_mailbox_of_match),
606+
.of_match_table = omap_mailbox_of_match,
607607
},
608608
};
609609
module_platform_driver(omap_mbox_driver);

drivers/mailbox/rockchip-mailbox.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ static const struct of_device_id rockchip_mbox_of_match[] = {
159159
{ .compatible = "rockchip,rk3368-mailbox", .data = &rk3368_drv_data},
160160
{ },
161161
};
162-
MODULE_DEVICE_TABLE(of, rockchp_mbox_of_match);
162+
MODULE_DEVICE_TABLE(of, rockchip_mbox_of_match);
163163

164164
static int rockchip_mbox_probe(struct platform_device *pdev)
165165
{

drivers/mailbox/sprd-mailbox.c

+4-21
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ struct sprd_mbox_priv {
6262
void __iomem *outbox_base;
6363
/* Base register address for supplementary outbox */
6464
void __iomem *supp_base;
65-
struct clk *clk;
6665
u32 outbox_fifo_depth;
6766

6867
struct mutex lock;
@@ -291,19 +290,13 @@ static const struct mbox_chan_ops sprd_mbox_ops = {
291290
.shutdown = sprd_mbox_shutdown,
292291
};
293292

294-
static void sprd_mbox_disable(void *data)
295-
{
296-
struct sprd_mbox_priv *priv = data;
297-
298-
clk_disable_unprepare(priv->clk);
299-
}
300-
301293
static int sprd_mbox_probe(struct platform_device *pdev)
302294
{
303295
struct device *dev = &pdev->dev;
304296
struct sprd_mbox_priv *priv;
305297
int ret, inbox_irq, outbox_irq, supp_irq;
306298
unsigned long id, supp;
299+
struct clk *clk;
307300

308301
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
309302
if (!priv)
@@ -331,20 +324,10 @@ static int sprd_mbox_probe(struct platform_device *pdev)
331324
if (IS_ERR(priv->outbox_base))
332325
return PTR_ERR(priv->outbox_base);
333326

334-
priv->clk = devm_clk_get(dev, "enable");
335-
if (IS_ERR(priv->clk)) {
327+
clk = devm_clk_get_enabled(dev, "enable");
328+
if (IS_ERR(clk)) {
336329
dev_err(dev, "failed to get mailbox clock\n");
337-
return PTR_ERR(priv->clk);
338-
}
339-
340-
ret = clk_prepare_enable(priv->clk);
341-
if (ret)
342-
return ret;
343-
344-
ret = devm_add_action_or_reset(dev, sprd_mbox_disable, priv);
345-
if (ret) {
346-
dev_err(dev, "failed to add mailbox disable action\n");
347-
return ret;
330+
return PTR_ERR(clk);
348331
}
349332

350333
inbox_irq = platform_get_irq_byname(pdev, "inbox");

drivers/remoteproc/Kconfig

+2-4
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,7 @@ config STM32_RPROC
330330
config TI_K3_DSP_REMOTEPROC
331331
tristate "TI K3 DSP remoteproc support"
332332
depends on ARCH_K3
333-
select MAILBOX
334-
select OMAP2PLUS_MBOX
333+
depends on OMAP2PLUS_MBOX
335334
help
336335
Say m here to support TI's C66x and C71x DSP remote processor
337336
subsystems on various TI K3 family of SoCs through the remote
@@ -356,8 +355,7 @@ config TI_K3_M4_REMOTEPROC
356355
config TI_K3_R5_REMOTEPROC
357356
tristate "TI K3 R5 remoteproc support"
358357
depends on ARCH_K3
359-
select MAILBOX
360-
select OMAP2PLUS_MBOX
358+
depends on OMAP2PLUS_MBOX
361359
help
362360
Say m here to support TI's R5F remote processor subsystems
363361
on various TI K3 family of SoCs through the remote processor

0 commit comments

Comments
 (0)