i3c: master: svc: Add support for Nuvoton npcm845 i3c
[ Upstream commit 98d87600a04e42282797631aa6b98dd43999e274 ] Nuvoton npcm845 SoC uses an older IP version, which has specific hardware issues that need to be addressed with a different compatible string. Add driver data for different compatible strings to define platform specific quirks. Add compatible string for npcm845 to define its own driver data. Signed-off-by: Stanley Chu <yschu@nuvoton.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://lore.kernel.org/r/20250306075429.2265183-3-yschu@nuvoton.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
635be13606
commit
69bb5d420d
@@ -158,6 +158,10 @@ struct svc_i3c_regs_save {
|
|||||||
u32 mdynaddr;
|
u32 mdynaddr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct svc_i3c_drvdata {
|
||||||
|
u32 quirks;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* struct svc_i3c_master - Silvaco I3C Master structure
|
* struct svc_i3c_master - Silvaco I3C Master structure
|
||||||
* @base: I3C master controller
|
* @base: I3C master controller
|
||||||
@@ -183,6 +187,7 @@ struct svc_i3c_regs_save {
|
|||||||
* @ibi.tbq_slot: To be queued IBI slot
|
* @ibi.tbq_slot: To be queued IBI slot
|
||||||
* @ibi.lock: IBI lock
|
* @ibi.lock: IBI lock
|
||||||
* @lock: Transfer lock, protect between IBI work thread and callbacks from master
|
* @lock: Transfer lock, protect between IBI work thread and callbacks from master
|
||||||
|
* @drvdata: Driver data
|
||||||
* @enabled_events: Bit masks for enable events (IBI, HotJoin).
|
* @enabled_events: Bit masks for enable events (IBI, HotJoin).
|
||||||
* @mctrl_config: Configuration value in SVC_I3C_MCTRL for setting speed back.
|
* @mctrl_config: Configuration value in SVC_I3C_MCTRL for setting speed back.
|
||||||
*/
|
*/
|
||||||
@@ -214,6 +219,7 @@ struct svc_i3c_master {
|
|||||||
spinlock_t lock;
|
spinlock_t lock;
|
||||||
} ibi;
|
} ibi;
|
||||||
struct mutex lock;
|
struct mutex lock;
|
||||||
|
const struct svc_i3c_drvdata *drvdata;
|
||||||
u32 enabled_events;
|
u32 enabled_events;
|
||||||
u32 mctrl_config;
|
u32 mctrl_config;
|
||||||
};
|
};
|
||||||
@@ -1768,6 +1774,10 @@ static int svc_i3c_master_probe(struct platform_device *pdev)
|
|||||||
if (!master)
|
if (!master)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
master->drvdata = of_device_get_match_data(dev);
|
||||||
|
if (!master->drvdata)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
master->regs = devm_platform_ioremap_resource(pdev, 0);
|
master->regs = devm_platform_ioremap_resource(pdev, 0);
|
||||||
if (IS_ERR(master->regs))
|
if (IS_ERR(master->regs))
|
||||||
return PTR_ERR(master->regs);
|
return PTR_ERR(master->regs);
|
||||||
@@ -1909,8 +1919,13 @@ static const struct dev_pm_ops svc_i3c_pm_ops = {
|
|||||||
svc_i3c_runtime_resume, NULL)
|
svc_i3c_runtime_resume, NULL)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const struct svc_i3c_drvdata npcm845_drvdata = {};
|
||||||
|
|
||||||
|
static const struct svc_i3c_drvdata svc_default_drvdata = {};
|
||||||
|
|
||||||
static const struct of_device_id svc_i3c_master_of_match_tbl[] = {
|
static const struct of_device_id svc_i3c_master_of_match_tbl[] = {
|
||||||
{ .compatible = "silvaco,i3c-master-v1"},
|
{ .compatible = "nuvoton,npcm845-i3c", .data = &npcm845_drvdata },
|
||||||
|
{ .compatible = "silvaco,i3c-master-v1", .data = &svc_default_drvdata },
|
||||||
{ /* sentinel */ },
|
{ /* sentinel */ },
|
||||||
};
|
};
|
||||||
MODULE_DEVICE_TABLE(of, svc_i3c_master_of_match_tbl);
|
MODULE_DEVICE_TABLE(of, svc_i3c_master_of_match_tbl);
|
||||||
|
|||||||
Reference in New Issue
Block a user