Lines Matching refs:ipcdev
51 static inline u32 ipc_read_status(IPC_DEV *ipcdev, IPC_TYPE type) in ipc_read_status() argument
53 return readl(ipcdev->base[type][BASE_IFACE]); in ipc_read_status()
56 static inline void ipc_write_cmd(IPC_DEV *ipcdev, IPC_TYPE type, u32 cmd) in ipc_write_cmd() argument
58 writel(cmd, ipcdev->base[type][BASE_IFACE]); in ipc_write_cmd()
61 static inline u32 ipc_read_data_low(IPC_DEV *ipcdev, IPC_TYPE type) in ipc_read_data_low() argument
63 return readl(ipcdev->base[type][BASE_DATA] + OFFSET_DATA_LOW); in ipc_read_data_low()
66 static inline u32 ipc_read_data_high(IPC_DEV *ipcdev, IPC_TYPE type) in ipc_read_data_high() argument
68 return readl(ipcdev->base[type][BASE_DATA] + OFFSET_DATA_HIGH); in ipc_read_data_high()
71 static inline void ipc_write_data_low(IPC_DEV *ipcdev, IPC_TYPE type, u32 data) in ipc_write_data_low() argument
73 writel(data, ipcdev->base[type][BASE_DATA] + OFFSET_DATA_LOW); in ipc_write_data_low()
76 static inline void ipc_write_data_high(IPC_DEV *ipcdev, IPC_TYPE type, u32 data) in ipc_write_data_high() argument
78 writel(data, ipcdev->base[type][BASE_DATA] + OFFSET_DATA_HIGH); in ipc_write_data_high()
101 static int intel_punit_ipc_check_status(IPC_DEV *ipcdev, IPC_TYPE type) in intel_punit_ipc_check_status() argument
107 if (ipcdev->irq) { in intel_punit_ipc_check_status()
108 if (!wait_for_completion_timeout(&ipcdev->cmd_complete, in intel_punit_ipc_check_status()
110 dev_err(ipcdev->dev, "IPC timed out\n"); in intel_punit_ipc_check_status()
114 while ((ipc_read_status(ipcdev, type) & CMD_RUN) && --loops) in intel_punit_ipc_check_status()
117 dev_err(ipcdev->dev, "IPC timed out\n"); in intel_punit_ipc_check_status()
122 status = ipc_read_status(ipcdev, type); in intel_punit_ipc_check_status()
125 dev_err(ipcdev->dev, "IPC failed: %s, IPC_STS=0x%x\n", in intel_punit_ipc_check_status()
145 IPC_DEV *ipcdev = punit_ipcdev; in intel_punit_ipc_simple_command() local
150 mutex_lock(&ipcdev->lock); in intel_punit_ipc_simple_command()
152 reinit_completion(&ipcdev->cmd_complete); in intel_punit_ipc_simple_command()
157 ipc_write_cmd(ipcdev, type, val); in intel_punit_ipc_simple_command()
158 ret = intel_punit_ipc_check_status(ipcdev, type); in intel_punit_ipc_simple_command()
160 mutex_unlock(&ipcdev->lock); in intel_punit_ipc_simple_command()
180 IPC_DEV *ipcdev = punit_ipcdev; in intel_punit_ipc_command() local
185 mutex_lock(&ipcdev->lock); in intel_punit_ipc_command()
187 reinit_completion(&ipcdev->cmd_complete); in intel_punit_ipc_command()
191 ipc_write_data_low(ipcdev, type, *in); in intel_punit_ipc_command()
193 ipc_write_data_high(ipcdev, type, *++in); in intel_punit_ipc_command()
198 ipc_write_cmd(ipcdev, type, val); in intel_punit_ipc_command()
200 ret = intel_punit_ipc_check_status(ipcdev, type); in intel_punit_ipc_command()
205 *out = ipc_read_data_low(ipcdev, type); in intel_punit_ipc_command()
207 *++out = ipc_read_data_high(ipcdev, type); in intel_punit_ipc_command()
211 mutex_unlock(&ipcdev->lock); in intel_punit_ipc_command()
218 IPC_DEV *ipcdev = dev_id; in intel_punit_ioc() local
220 complete(&ipcdev->cmd_complete); in intel_punit_ioc()