Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

i3c: dw: Add shutdown support to dw_i3c_master driver

Add shutdown handler to the Synopsys DesignWare I3C master driver,
ensuring the device is gracefully disabled during system shutdown.

The shutdown handler cancels any pending hot-join work and disables
interrupts.

Signed-off-by: Manikanta Guntupalli <manikanta.guntupalli@amd.com>
Link: https://lore.kernel.org/r/20250730151207.4113708-1-manikanta.guntupalli@amd.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

authored by

Manikanta Guntupalli and committed by
Alexandre Belloni
17e163f3 bc7dd24c

+23
+23
drivers/i3c/master/dw-i3c-master.c
··· 1737 1737 SET_RUNTIME_PM_OPS(dw_i3c_master_runtime_suspend, dw_i3c_master_runtime_resume, NULL) 1738 1738 }; 1739 1739 1740 + static void dw_i3c_shutdown(struct platform_device *pdev) 1741 + { 1742 + struct dw_i3c_master *master = platform_get_drvdata(pdev); 1743 + int ret; 1744 + 1745 + ret = pm_runtime_resume_and_get(master->dev); 1746 + if (ret < 0) { 1747 + dev_err(master->dev, 1748 + "<%s> cannot resume i3c bus master, err: %d\n", 1749 + __func__, ret); 1750 + return; 1751 + } 1752 + 1753 + cancel_work_sync(&master->hj_work); 1754 + 1755 + /* Disable interrupts */ 1756 + writel((u32)~INTR_ALL, master->regs + INTR_STATUS_EN); 1757 + writel((u32)~INTR_ALL, master->regs + INTR_SIGNAL_EN); 1758 + 1759 + pm_runtime_put_autosuspend(master->dev); 1760 + } 1761 + 1740 1762 static const struct of_device_id dw_i3c_master_of_match[] = { 1741 1763 { .compatible = "snps,dw-i3c-master-1.00a", }, 1742 1764 {}, ··· 1774 1752 static struct platform_driver dw_i3c_driver = { 1775 1753 .probe = dw_i3c_probe, 1776 1754 .remove = dw_i3c_remove, 1755 + .shutdown = dw_i3c_shutdown, 1777 1756 .driver = { 1778 1757 .name = "dw-i3c-master", 1779 1758 .of_match_table = dw_i3c_master_of_match,