Lines Matching refs:ipcdev

52 static inline u32 ipc_read_status(IPC_DEV *ipcdev, IPC_TYPE type)  in ipc_read_status()  argument
54 return readl(ipcdev->base[type][BASE_IFACE]); in ipc_read_status()
57 static inline void ipc_write_cmd(IPC_DEV *ipcdev, IPC_TYPE type, u32 cmd) in ipc_write_cmd() argument
59 writel(cmd, ipcdev->base[type][BASE_IFACE]); in ipc_write_cmd()
62 static inline u32 ipc_read_data_low(IPC_DEV *ipcdev, IPC_TYPE type) in ipc_read_data_low() argument
64 return readl(ipcdev->base[type][BASE_DATA] + OFFSET_DATA_LOW); in ipc_read_data_low()
67 static inline u32 ipc_read_data_high(IPC_DEV *ipcdev, IPC_TYPE type) in ipc_read_data_high() argument
69 return readl(ipcdev->base[type][BASE_DATA] + OFFSET_DATA_HIGH); in ipc_read_data_high()
72 static inline void ipc_write_data_low(IPC_DEV *ipcdev, IPC_TYPE type, u32 data) in ipc_write_data_low() argument
74 writel(data, ipcdev->base[type][BASE_DATA] + OFFSET_DATA_LOW); in ipc_write_data_low()
77 static inline void ipc_write_data_high(IPC_DEV *ipcdev, IPC_TYPE type, u32 data) in ipc_write_data_high() argument
79 writel(data, ipcdev->base[type][BASE_DATA] + OFFSET_DATA_HIGH); in ipc_write_data_high()
102 static int intel_punit_ipc_check_status(IPC_DEV *ipcdev, IPC_TYPE type) in intel_punit_ipc_check_status() argument
108 if (ipcdev->irq) { in intel_punit_ipc_check_status()
109 if (!wait_for_completion_timeout(&ipcdev->cmd_complete, in intel_punit_ipc_check_status()
111 dev_err(ipcdev->dev, "IPC timed out\n"); in intel_punit_ipc_check_status()
115 while ((ipc_read_status(ipcdev, type) & CMD_RUN) && --loops) in intel_punit_ipc_check_status()
118 dev_err(ipcdev->dev, "IPC timed out\n"); in intel_punit_ipc_check_status()
123 status = ipc_read_status(ipcdev, type); in intel_punit_ipc_check_status()
126 dev_err(ipcdev->dev, "IPC failed: %s, IPC_STS=0x%x\n", in intel_punit_ipc_check_status()
146 IPC_DEV *ipcdev = punit_ipcdev; in intel_punit_ipc_simple_command() local
151 mutex_lock(&ipcdev->lock); in intel_punit_ipc_simple_command()
153 reinit_completion(&ipcdev->cmd_complete); in intel_punit_ipc_simple_command()
158 ipc_write_cmd(ipcdev, type, val); in intel_punit_ipc_simple_command()
159 ret = intel_punit_ipc_check_status(ipcdev, type); in intel_punit_ipc_simple_command()
161 mutex_unlock(&ipcdev->lock); in intel_punit_ipc_simple_command()
181 IPC_DEV *ipcdev = punit_ipcdev; in intel_punit_ipc_command() local
186 mutex_lock(&ipcdev->lock); in intel_punit_ipc_command()
188 reinit_completion(&ipcdev->cmd_complete); in intel_punit_ipc_command()
192 ipc_write_data_low(ipcdev, type, *in); in intel_punit_ipc_command()
194 ipc_write_data_high(ipcdev, type, *++in); in intel_punit_ipc_command()
199 ipc_write_cmd(ipcdev, type, val); in intel_punit_ipc_command()
201 ret = intel_punit_ipc_check_status(ipcdev, type); in intel_punit_ipc_command()
206 *out = ipc_read_data_low(ipcdev, type); in intel_punit_ipc_command()
208 *++out = ipc_read_data_high(ipcdev, type); in intel_punit_ipc_command()
212 mutex_unlock(&ipcdev->lock); in intel_punit_ipc_command()
219 IPC_DEV *ipcdev = dev_id; in intel_punit_ioc() local
221 complete(&ipcdev->cmd_complete); in intel_punit_ioc()