Commit 50362083 authored by Mika Westerberg's avatar Mika Westerberg Committed by Lee Jones

mfd: intel_soc_pmic_mrfld: Convert to use new SCU IPC API

This converts the Intel Merrifield PMIC driver over the new SCU IPC API
where the SCU IPC instance is passed to the functions.
Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent 4181bc8f
...@@ -74,10 +74,11 @@ static const struct mfd_cell bcove_dev[] = { ...@@ -74,10 +74,11 @@ static const struct mfd_cell bcove_dev[] = {
static int bcove_ipc_byte_reg_read(void *context, unsigned int reg, static int bcove_ipc_byte_reg_read(void *context, unsigned int reg,
unsigned int *val) unsigned int *val)
{ {
struct intel_soc_pmic *pmic = context;
u8 ipc_out; u8 ipc_out;
int ret; int ret;
ret = intel_scu_ipc_ioread8(reg, &ipc_out); ret = intel_scu_ipc_dev_ioread8(pmic->scu, reg, &ipc_out);
if (ret) if (ret)
return ret; return ret;
...@@ -88,10 +89,11 @@ static int bcove_ipc_byte_reg_read(void *context, unsigned int reg, ...@@ -88,10 +89,11 @@ static int bcove_ipc_byte_reg_read(void *context, unsigned int reg,
static int bcove_ipc_byte_reg_write(void *context, unsigned int reg, static int bcove_ipc_byte_reg_write(void *context, unsigned int reg,
unsigned int val) unsigned int val)
{ {
struct intel_soc_pmic *pmic = context;
u8 ipc_in = val; u8 ipc_in = val;
int ret; int ret;
ret = intel_scu_ipc_iowrite8(reg, ipc_in); ret = intel_scu_ipc_dev_iowrite8(pmic->scu, reg, ipc_in);
if (ret) if (ret)
return ret; return ret;
...@@ -117,6 +119,10 @@ static int bcove_probe(struct platform_device *pdev) ...@@ -117,6 +119,10 @@ static int bcove_probe(struct platform_device *pdev)
if (!pmic) if (!pmic)
return -ENOMEM; return -ENOMEM;
pmic->scu = devm_intel_scu_ipc_dev_get(dev);
if (!pmic->scu)
return -ENOMEM;
platform_set_drvdata(pdev, pmic); platform_set_drvdata(pdev, pmic);
pmic->dev = &pdev->dev; pmic->dev = &pdev->dev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment