Skip to content

Commit

Permalink
mfd: intel_soc_pmic_mrfld: Convert to use new SCU IPC API
Browse files Browse the repository at this point in the history
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: 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>
  • Loading branch information
Mika Westerberg authored and Lee Jones committed Apr 24, 2020
1 parent 4181bc8 commit 5036208
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions drivers/mfd/intel_soc_pmic_mrfld.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,11 @@ static const struct mfd_cell bcove_dev[] = {
static int bcove_ipc_byte_reg_read(void *context, unsigned int reg,
unsigned int *val)
{
struct intel_soc_pmic *pmic = context;
u8 ipc_out;
int ret;

ret = intel_scu_ipc_ioread8(reg, &ipc_out);
ret = intel_scu_ipc_dev_ioread8(pmic->scu, reg, &ipc_out);
if (ret)
return ret;

Expand All @@ -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,
unsigned int val)
{
struct intel_soc_pmic *pmic = context;
u8 ipc_in = val;
int ret;

ret = intel_scu_ipc_iowrite8(reg, ipc_in);
ret = intel_scu_ipc_dev_iowrite8(pmic->scu, reg, ipc_in);
if (ret)
return ret;

Expand All @@ -117,6 +119,10 @@ static int bcove_probe(struct platform_device *pdev)
if (!pmic)
return -ENOMEM;

pmic->scu = devm_intel_scu_ipc_dev_get(dev);
if (!pmic->scu)
return -ENOMEM;

platform_set_drvdata(pdev, pmic);
pmic->dev = &pdev->dev;

Expand Down

0 comments on commit 5036208

Please sign in to comment.