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

platform/x86: intel_mid_powerbtn: Convert to use new SCU IPC API

This converts the power button driver to use the new SCU IPC API where
the SCU IPC instance is passed to the functions.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Mika Westerberg and committed by
Lee Jones
595694bd f57fa185

+11 -4
+11 -4
drivers/platform/x86/intel_mid_powerbtn.c
··· 46 46 unsigned short mirqlvl1_addr; 47 47 unsigned short pbstat_addr; 48 48 u8 pbstat_mask; 49 + struct intel_scu_ipc_dev *scu; 49 50 int (*setup)(struct mid_pb_ddata *ddata); 50 51 }; 51 52 ··· 56 55 int ret; 57 56 u8 pbstat; 58 57 59 - ret = intel_scu_ipc_ioread8(ddata->pbstat_addr, &pbstat); 58 + ret = intel_scu_ipc_dev_ioread8(ddata->scu, ddata->pbstat_addr, 59 + &pbstat); 60 60 if (ret) 61 61 return ret; 62 62 ··· 69 67 70 68 static int mid_irq_ack(struct mid_pb_ddata *ddata) 71 69 { 72 - return intel_scu_ipc_update_register(ddata->mirqlvl1_addr, 0, MSIC_PWRBTNM); 70 + return intel_scu_ipc_dev_update(ddata->scu, ddata->mirqlvl1_addr, 0, 71 + MSIC_PWRBTNM); 73 72 } 74 73 75 74 static int mrfld_setup(struct mid_pb_ddata *ddata) 76 75 { 77 76 /* Unmask the PBIRQ and MPBIRQ on Tangier */ 78 - intel_scu_ipc_update_register(BCOVE_PBIRQ, 0, MSIC_PWRBTNM); 79 - intel_scu_ipc_update_register(BCOVE_PBIRQMASK, 0, MSIC_PWRBTNM); 77 + intel_scu_ipc_dev_update(ddata->scu, BCOVE_PBIRQ, 0, MSIC_PWRBTNM); 78 + intel_scu_ipc_dev_update(ddata->scu, BCOVE_PBIRQMASK, 0, MSIC_PWRBTNM); 80 79 81 80 return 0; 82 81 } ··· 163 160 if (error) 164 161 return error; 165 162 } 163 + 164 + ddata->scu = devm_intel_scu_ipc_dev_get(&pdev->dev); 165 + if (!ddata->scu) 166 + return -EPROBE_DEFER; 166 167 167 168 error = devm_request_threaded_irq(&pdev->dev, irq, NULL, mid_pb_isr, 168 169 IRQF_ONESHOT, DRIVER_NAME, ddata);