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: mipi-i3c-hci-pci: Factor out intel_reset()

For neatness, factor out intel_reset().

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20251128064038.55158-8-adrian.hunter@intel.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

authored by

Adrian Hunter and committed by
Alexandre Belloni
6f6efdd1 9dfa23c4

+13 -7
+13 -7
drivers/i3c/master/mipi-i3c-hci/mipi-i3c-hci-pci.c
··· 27 27 #define INTEL_RESETS_RESET_DONE BIT(1) 28 28 #define INTEL_RESETS_TIMEOUT_US (10 * USEC_PER_MSEC) 29 29 30 + static void intel_reset(void __iomem *priv) 31 + { 32 + u32 reg; 33 + 34 + /* Assert reset, wait for completion and release reset */ 35 + writel(0, priv + INTEL_RESETS); 36 + readl_poll_timeout(priv + INTEL_RESETS, reg, 37 + reg & INTEL_RESETS_RESET_DONE, 0, 38 + INTEL_RESETS_TIMEOUT_US); 39 + writel(INTEL_RESETS_RESET, priv + INTEL_RESETS); 40 + } 41 + 30 42 static void __iomem *intel_priv(struct pci_dev *pci) 31 43 { 32 44 resource_size_t base = pci_resource_start(pci, 0); ··· 49 37 static int intel_i3c_init(struct pci_dev *pci) 50 38 { 51 39 void __iomem *priv = intel_priv(pci); 52 - u32 reg; 53 40 54 41 if (!priv) 55 42 return -ENOMEM; 56 43 57 44 dma_set_mask_and_coherent(&pci->dev, DMA_BIT_MASK(64)); 58 45 59 - /* Assert reset, wait for completion and release reset */ 60 - writel(0, priv + INTEL_RESETS); 61 - readl_poll_timeout(priv + INTEL_RESETS, reg, 62 - reg & INTEL_RESETS_RESET_DONE, 0, 63 - INTEL_RESETS_TIMEOUT_US); 64 - writel(INTEL_RESETS_RESET, priv + INTEL_RESETS); 46 + intel_reset(priv); 65 47 66 48 return 0; 67 49 }