From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg Kroah-Hartman Subject: Re: [PATCH v4 27/38] mfd: intel_soc_pmic_bxtwc: Convert to use new SCU IPC API Date: Wed, 22 Jan 2020 14:46:21 +0100 Message-ID: <20200122134621.GF4963@kroah.com> References: <20200121160114.60007-1-mika.westerberg@linux.intel.com> <20200121160114.60007-28-mika.westerberg@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20200121160114.60007-28-mika.westerberg@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org To: Mika Westerberg Cc: Andy Shevchenko , Darren Hart , Lee Jones , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , x86@kernel.org, Zha Qipeng , "David E . Box" , Guenter Roeck , Heikki Krogerus , Wim Van Sebroeck , Mark Brown , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org List-Id: platform-driver-x86.vger.kernel.org On Tue, Jan 21, 2020 at 07:01:03PM +0300, Mika Westerberg wrote: > Convert the Intel Broxton Whiskey Cover PMIC driver to use the new SCU > IPC API. This allows us to get rid of the PMC IPC implementation which > is now covered in SCU IPC driver. > > Also move PMIC specific IPC message constants to the PMIC driver from > the intel_pmc_ipc.h header. > > Signed-off-by: Mika Westerberg > Reviewed-by: Andy Shevchenko > --- > arch/x86/include/asm/intel_pmc_ipc.h | 3 --- > drivers/mfd/intel_soc_pmic_bxtwc.c | 22 +++++++++++++++------- > 2 files changed, 15 insertions(+), 10 deletions(-) > > diff --git a/arch/x86/include/asm/intel_pmc_ipc.h b/arch/x86/include/asm/intel_pmc_ipc.h > index e6da1ce26256..b438a488f613 100644 > --- a/arch/x86/include/asm/intel_pmc_ipc.h > +++ b/arch/x86/include/asm/intel_pmc_ipc.h > @@ -3,9 +3,6 @@ > #define _ASM_X86_INTEL_PMC_IPC_H_ > > /* Commands */ > -#define PMC_IPC_PMIC_ACCESS 0xFF > -#define PMC_IPC_PMIC_ACCESS_READ 0x0 > -#define PMC_IPC_PMIC_ACCESS_WRITE 0x1 > #define PMC_IPC_USB_PWR_CTRL 0xF0 > #define PMC_IPC_PMIC_BLACKLIST_SEL 0xEF > #define PMC_IPC_PHY_CONFIG 0xEE > diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c > index 739cfb5b69fe..60aba2a1561c 100644 > --- a/drivers/mfd/intel_soc_pmic_bxtwc.c > +++ b/drivers/mfd/intel_soc_pmic_bxtwc.c > @@ -15,7 +15,7 @@ > #include > #include > > -#include > +#include > > /* PMIC device registers */ > #define REG_ADDR_MASK 0xFF00 > @@ -58,6 +58,10 @@ > /* Whiskey Cove PMIC share same ACPI ID between different platforms */ > #define BROXTON_PMIC_WC_HRV 4 > > +#define PMC_PMIC_ACCESS 0xFF > +#define PMC_PMIC_READ 0x0 > +#define PMC_PMIC_WRITE 0x1 > + > enum bxtwc_irqs { > BXTWC_PWRBTN_LVL1_IRQ = 0, > BXTWC_TMU_LVL1_IRQ, > @@ -288,9 +292,9 @@ static int regmap_ipc_byte_reg_read(void *context, unsigned int reg, > > ipc_in[0] = reg; > ipc_in[1] = i2c_addr; > - ret = intel_pmc_ipc_command(PMC_IPC_PMIC_ACCESS, > - PMC_IPC_PMIC_ACCESS_READ, > - ipc_in, sizeof(ipc_in), (u32 *)ipc_out, 1); > + ret = intel_scu_ipc_dev_command(pmic->scu, PMC_PMIC_ACCESS, > + PMC_PMIC_READ, ipc_in, sizeof(ipc_in), > + ipc_out, sizeof(ipc_out)); > if (ret) { > dev_err(pmic->dev, "Failed to read from PMIC\n"); Meta-comment, the call should be the thing making that error message, do not force all callers to log it again, or in some other way. That just makes for a larger mess. thanks, greg k-h