Re: [PATCH v2 1/1] x86/platform/iosf_mbi: Remove duplicate definitions

From: Andy Shevchenko
Date: Tue Nov 24 2015 - 04:50:45 EST


On Wed, 2015-11-11 at 19:59 +0200, Andy Shevchenko wrote:
> The read and write opcodes are global for all units on SoC and even
> across
> Intel SoCs. Remove duplication of corresponding constants. At the
> same time
> convert all current users.
>
> No functional change.
>
> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> Cc: Ingo Molnar <mingo@xxxxxxxxxx>
> Cc: Peter Anvin <hpa@xxxxxxxxx>
> Cc: Wolfram Sang <wsa@xxxxxxxxxxxxx>
> Cc: Zhang Rui <rui.zhang@xxxxxxxxx>
> Cc: Eduardo Valentin <edubezval@xxxxxxxxx>
> Cc: Hock Leong Kweh <hock.leong.kweh@xxxxxxxxx>

Any concerns, anyone?

Btw, this patch has been tested on Intel BayTrail and Braswell.

>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
> ---
> Since v1:
> - satisfy kbuild robot
>
> Âarch/x86/include/asm/iosf_mbi.hÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 49 +++++-------------
> ----
> Âarch/x86/platform/atom/punit_atom_debug.cÂÂÂÂ|ÂÂ7 +---
> Âarch/x86/platform/intel-quark/imr.cÂÂÂÂÂÂÂÂÂÂ| 28 +++++--------
> Âdrivers/i2c/busses/i2c-designware-baytrail.c | 17 +++-----
> Âdrivers/powercap/intel_rapl.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 10 ++---
> Âdrivers/thermal/intel_quark_dts_thermal.cÂÂÂÂ| 61 ++++++++++++++--
> ------------
> Âdrivers/thermal/intel_soc_dts_iosf.cÂÂÂÂÂÂÂÂÂ| 43 ++++++++++------
> ----
> Â7 files changed, 85 insertions(+), 130 deletions(-)
>
> diff --git a/arch/x86/include/asm/iosf_mbi.h
> b/arch/x86/include/asm/iosf_mbi.h
> index b72ad0f..cdc5f63 100644
> --- a/arch/x86/include/asm/iosf_mbi.h
> +++ b/arch/x86/include/asm/iosf_mbi.h
> @@ -1,5 +1,5 @@
> Â/*
> - * iosf_mbi.h: Intel OnChip System Fabric MailBox access support
> + * Intel OnChip System Fabric MailBox access support
> Â */
> Â
> Â#ifndef IOSF_MBI_SYMS_H
> @@ -16,6 +16,16 @@
> Â#define MBI_MASK_LO 0x000000FF
> Â#define MBI_ENABLE 0xF0
> Â
> +/* IOSF SB read/write opcodes */
> +#define MBI_MMIO_READ 0x00
> +#define MBI_MMIO_WRITE 0x01
> +#define MBI_CR_READ 0x06
> +#define MBI_CR_WRITE 0x07
> +#define MBI_REG_READ 0x10
> +#define MBI_REG_WRITE 0x11
> +#define MBI_ESRAM_READ 0x12
> +#define MBI_ESRAM_WRITE 0x13
> +
> Â/* Baytrail available units */
> Â#define BT_MBI_UNIT_AUNIT 0x00
> Â#define BT_MBI_UNIT_SMC 0x01
> @@ -28,50 +38,13 @@
> Â#define BT_MBI_UNIT_SATA 0xA3
> Â#define BT_MBI_UNIT_PCIE 0xA6
> Â
> -/* Baytrail read/write opcodes */
> -#define BT_MBI_AUNIT_READ 0x10
> -#define BT_MBI_AUNIT_WRITE 0x11
> -#define BT_MBI_SMC_READ 0x10
> -#define BT_MBI_SMC_WRITE 0x11
> -#define BT_MBI_CPU_READ 0x10
> -#define BT_MBI_CPU_WRITE 0x11
> -#define BT_MBI_BUNIT_READ 0x10
> -#define BT_MBI_BUNIT_WRITE 0x11
> -#define BT_MBI_PMC_READ 0x06
> -#define BT_MBI_PMC_WRITE 0x07
> -#define BT_MBI_GFX_READ 0x00
> -#define BT_MBI_GFX_WRITE 0x01
> -#define BT_MBI_SMIO_READ 0x06
> -#define BT_MBI_SMIO_WRITE 0x07
> -#define BT_MBI_USB_READ 0x06
> -#define BT_MBI_USB_WRITE 0x07
> -#define BT_MBI_SATA_READ 0x00
> -#define BT_MBI_SATA_WRITE 0x01
> -#define BT_MBI_PCIE_READ 0x00
> -#define BT_MBI_PCIE_WRITE 0x01
> -
> Â/* Quark available units */
> Â#define QRK_MBI_UNIT_HBA 0x00
> Â#define QRK_MBI_UNIT_HB 0x03
> Â#define QRK_MBI_UNIT_RMU 0x04
> Â#define QRK_MBI_UNIT_MM 0x05
> -#define QRK_MBI_UNIT_MMESRAM 0x05
> Â#define QRK_MBI_UNIT_SOC 0x31
> Â
> -/* Quark read/write opcodes */
> -#define QRK_MBI_HBA_READ 0x10
> -#define QRK_MBI_HBA_WRITE 0x11
> -#define QRK_MBI_HB_READ 0x10
> -#define QRK_MBI_HB_WRITE 0x11
> -#define QRK_MBI_RMU_READ 0x10
> -#define QRK_MBI_RMU_WRITE 0x11
> -#define QRK_MBI_MM_READ 0x10
> -#define QRK_MBI_MM_WRITE 0x11
> -#define QRK_MBI_MMESRAM_READ 0x12
> -#define QRK_MBI_MMESRAM_WRITE 0x13
> -#define QRK_MBI_SOC_READ 0x06
> -#define QRK_MBI_SOC_WRITE 0x07
> -
> Â#if IS_ENABLED(CONFIG_IOSF_MBI)
> Â
> Âbool iosf_mbi_available(void);
> diff --git a/arch/x86/platform/atom/punit_atom_debug.c
> b/arch/x86/platform/atom/punit_atom_debug.c
> index 5ca8ead..81c769e 100644
> --- a/arch/x86/platform/atom/punit_atom_debug.c
> +++ b/arch/x86/platform/atom/punit_atom_debug.c
> @@ -25,8 +25,6 @@
> Â#include <asm/cpu_device_id.h>
> Â#include <asm/iosf_mbi.h>
> Â
> -/* Side band Interface port */
> -#define PUNIT_PORT 0x04
> Â/* Power gate status reg */
> Â#define PWRGT_STATUS 0x61
> Â/* Subsystem config/status Video processor */
> @@ -85,9 +83,8 @@ static int punit_dev_state_show(struct seq_file
> *seq_file, void *unused)
> Â
> Â seq_puts(seq_file, "\n\nPUNIT NORTH COMPLEX DEVICES :\n");
> Â while (punit_devp->name) {
> - status = iosf_mbi_read(PUNIT_PORT, BT_MBI_PMC_READ,
> - ÂÂÂÂÂÂÂpunit_devp->reg,
> - ÂÂÂÂÂÂÂ&punit_pwr_status);
> + status = iosf_mbi_read(BT_MBI_UNIT_PMC,
> MBI_REG_READ,
> + ÂÂÂÂÂÂÂpunit_devp->reg,
> &punit_pwr_status);
> Â if (status) {
> Â seq_printf(seq_file, "%9s : Read Failed\n",
> Â ÂÂÂpunit_devp->name);
> diff --git a/arch/x86/platform/intel-quark/imr.c
> b/arch/x86/platform/intel-quark/imr.c
> index 0ee619f..c1bdafa 100644
> --- a/arch/x86/platform/intel-quark/imr.c
> +++ b/arch/x86/platform/intel-quark/imr.c
> @@ -111,23 +111,19 @@ static int imr_read(struct imr_device *idev,
> u32 imr_id, struct imr_regs *imr)
> Â u32 reg = imr_id * IMR_NUM_REGS + idev->reg_base;
> Â int ret;
> Â
> - ret = iosf_mbi_read(QRK_MBI_UNIT_MM, QRK_MBI_MM_READ,
> - reg++, &imr->addr_lo);
> + ret = iosf_mbi_read(QRK_MBI_UNIT_MM, MBI_REG_READ, reg++,
> &imr->addr_lo);
> Â if (ret)
> Â return ret;
> Â
> - ret = iosf_mbi_read(QRK_MBI_UNIT_MM, QRK_MBI_MM_READ,
> - reg++, &imr->addr_hi);
> + ret = iosf_mbi_read(QRK_MBI_UNIT_MM, MBI_REG_READ, reg++,
> &imr->addr_hi);
> Â if (ret)
> Â return ret;
> Â
> - ret = iosf_mbi_read(QRK_MBI_UNIT_MM, QRK_MBI_MM_READ,
> - reg++, &imr->rmask);
> + ret = iosf_mbi_read(QRK_MBI_UNIT_MM, MBI_REG_READ, reg++,
> &imr->rmask);
> Â if (ret)
> Â return ret;
> Â
> - return iosf_mbi_read(QRK_MBI_UNIT_MM, QRK_MBI_MM_READ,
> - reg++, &imr->wmask);
> + return iosf_mbi_read(QRK_MBI_UNIT_MM, MBI_REG_READ, reg++,
> &imr->wmask);
> Â}
> Â
> Â/**
> @@ -151,31 +147,27 @@ static int imr_write(struct imr_device *idev,
> u32 imr_id,
> Â
> Â local_irq_save(flags);
> Â
> - ret = iosf_mbi_write(QRK_MBI_UNIT_MM, QRK_MBI_MM_WRITE,
> reg++,
> - imr->addr_lo);
> + ret = iosf_mbi_write(QRK_MBI_UNIT_MM, MBI_REG_WRITE, reg++,
> imr->addr_lo);
> Â if (ret)
> Â goto failed;
> Â
> - ret = iosf_mbi_write(QRK_MBI_UNIT_MM, QRK_MBI_MM_WRITE,
> - reg++, imr->addr_hi);
> + ret = iosf_mbi_write(QRK_MBI_UNIT_MM, MBI_REG_WRITE, reg++,
> imr->addr_hi);
> Â if (ret)
> Â goto failed;
> Â
> - ret = iosf_mbi_write(QRK_MBI_UNIT_MM, QRK_MBI_MM_WRITE,
> - reg++, imr->rmask);
> + ret = iosf_mbi_write(QRK_MBI_UNIT_MM, MBI_REG_WRITE, reg++,
> imr->rmask);
> Â if (ret)
> Â goto failed;
> Â
> - ret = iosf_mbi_write(QRK_MBI_UNIT_MM, QRK_MBI_MM_WRITE,
> - reg++, imr->wmask);
> + ret = iosf_mbi_write(QRK_MBI_UNIT_MM, MBI_REG_WRITE, reg++,
> imr->wmask);
> Â if (ret)
> Â goto failed;
> Â
> Â /* Lock bit must be set separately to addr_lo address bits.
> */
> Â if (lock) {
> Â imr->addr_lo |= IMR_LOCK;
> - ret = iosf_mbi_write(QRK_MBI_UNIT_MM,
> QRK_MBI_MM_WRITE,
> - reg - IMR_NUM_REGS, imr-
> >addr_lo);
> + ret = iosf_mbi_write(QRK_MBI_UNIT_MM, MBI_REG_WRITE,
> + ÂÂÂÂÂreg - IMR_NUM_REGS, imr-
> >addr_lo);
> Â if (ret)
> Â goto failed;
> Â }
> diff --git a/drivers/i2c/busses/i2c-designware-baytrail.c
> b/drivers/i2c/busses/i2c-designware-baytrail.c
> index 7d7ae97..e38c2bb 100644
> --- a/drivers/i2c/busses/i2c-designware-baytrail.c
> +++ b/drivers/i2c/busses/i2c-designware-baytrail.c
> @@ -34,8 +34,7 @@ static int get_sem(struct device *dev, u32 *sem)
> Â u32 data;
> Â int ret;
> Â
> - ret = iosf_mbi_read(BT_MBI_UNIT_PMC, BT_MBI_BUNIT_READ,
> PUNIT_SEMAPHORE,
> - &data);
> + ret = iosf_mbi_read(BT_MBI_UNIT_PMC, MBI_REG_READ,
> PUNIT_SEMAPHORE, &data);
> Â if (ret) {
> Â dev_err(dev, "iosf failed to read punit
> semaphore\n");
> Â return ret;
> @@ -50,21 +49,19 @@ static void reset_semaphore(struct device *dev)
> Â{
> Â u32 data;
> Â
> - if (iosf_mbi_read(BT_MBI_UNIT_PMC, BT_MBI_BUNIT_READ,
> - PUNIT_SEMAPHORE, &data)) {
> + if (iosf_mbi_read(BT_MBI_UNIT_PMC, MBI_REG_READ,
> PUNIT_SEMAPHORE, &data)) {
> Â dev_err(dev, "iosf failed to reset punit semaphore
> during read\n");
> Â return;
> Â }
> Â
> Â data &= ~PUNIT_SEMAPHORE_BIT;
> - if (iosf_mbi_write(BT_MBI_UNIT_PMC, BT_MBI_BUNIT_WRITE,
> - PUNIT_SEMAPHORE, data))
> + if (iosf_mbi_write(BT_MBI_UNIT_PMC, MBI_REG_WRITE,
> PUNIT_SEMAPHORE, data))
> Â dev_err(dev, "iosf failed to reset punit semaphore
> during write\n");
> Â}
> Â
> Âstatic int baytrail_i2c_acquire(struct dw_i2c_dev *dev)
> Â{
> - u32 sem;
> + u32 sem = PUNIT_SEMAPHORE_ACQUIRE;
> Â int ret;
> Â unsigned long start, end;
> Â
> @@ -77,8 +74,7 @@ static int baytrail_i2c_acquire(struct dw_i2c_dev
> *dev)
> Â return 0;
> Â
> Â /* host driver writes to side band semaphore register */
> - ret = iosf_mbi_write(BT_MBI_UNIT_PMC, BT_MBI_BUNIT_WRITE,
> - PUNIT_SEMAPHORE,
> PUNIT_SEMAPHORE_ACQUIRE);
> + ret = iosf_mbi_write(BT_MBI_UNIT_PMC, MBI_REG_WRITE,
> PUNIT_SEMAPHORE, sem);
> Â if (ret) {
> Â dev_err(dev->dev, "iosf punit semaphore request
> failed\n");
> Â return ret;
> @@ -102,8 +98,7 @@ static int baytrail_i2c_acquire(struct dw_i2c_dev
> *dev)
> Â dev_err(dev->dev, "punit semaphore timed out, resetting\n");
> Â reset_semaphore(dev->dev);
> Â
> - ret = iosf_mbi_read(BT_MBI_UNIT_PMC, BT_MBI_BUNIT_READ,
> - PUNIT_SEMAPHORE, &sem);
> + ret = iosf_mbi_read(BT_MBI_UNIT_PMC, MBI_REG_READ,
> PUNIT_SEMAPHORE, &sem);
> Â if (ret)
> Â dev_err(dev->dev, "iosf failed to read punit
> semaphore\n");
> Â else
> diff --git a/drivers/powercap/intel_rapl.c
> b/drivers/powercap/intel_rapl.c
> index cc97f08..fa07809 100644
> --- a/drivers/powercap/intel_rapl.c
> +++ b/drivers/powercap/intel_rapl.c
> @@ -988,16 +988,16 @@ static void set_floor_freq_atom(struct
> rapl_domain *rd, bool enable)
> Â }
> Â
> Â if (!power_ctrl_orig_val)
> - iosf_mbi_read(BT_MBI_UNIT_PMC, BT_MBI_PMC_READ,
> - rapl_defaults->floor_freq_reg_addr,
> - &power_ctrl_orig_val);
> + iosf_mbi_read(BT_MBI_UNIT_PMC, MBI_CR_READ,
> + ÂÂÂÂÂÂrapl_defaults->floor_freq_reg_addr,
> + ÂÂÂÂÂÂ&power_ctrl_orig_val);
> Â mdata = power_ctrl_orig_val;
> Â if (enable) {
> Â mdata &= ~(0x7f << 8);
> Â mdata |= 1 << 8;
> Â }
> - iosf_mbi_write(BT_MBI_UNIT_PMC, BT_MBI_PMC_WRITE,
> - rapl_defaults->floor_freq_reg_addr, mdata);
> + iosf_mbi_write(BT_MBI_UNIT_PMC, MBI_CR_WRITE,
> + ÂÂÂÂÂÂÂrapl_defaults->floor_freq_reg_addr, mdata);
> Â}
> Â
> Âstatic u64 rapl_compute_time_window_core(struct rapl_package *rp,
> u64 value,
> diff --git a/drivers/thermal/intel_quark_dts_thermal.c
> b/drivers/thermal/intel_quark_dts_thermal.c
> index 5ed90e6..5d33b35 100644
> --- a/drivers/thermal/intel_quark_dts_thermal.c
> +++ b/drivers/thermal/intel_quark_dts_thermal.c
> @@ -125,8 +125,8 @@ static int soc_dts_enable(struct
> thermal_zone_device *tzd)
> Â struct soc_sensor_entry *aux_entry = tzd->devdata;
> Â int ret;
> Â
> - ret = iosf_mbi_read(QRK_MBI_UNIT_RMU, QRK_MBI_RMU_READ,
> - QRK_DTS_REG_OFFSET_ENABLE,
> &out);
> + ret = iosf_mbi_read(QRK_MBI_UNIT_RMU, MBI_REG_READ,
> + ÂÂÂÂQRK_DTS_REG_OFFSET_ENABLE, &out);
> Â if (ret)
> Â return ret;
> Â
> @@ -137,8 +137,8 @@ static int soc_dts_enable(struct
> thermal_zone_device *tzd)
> Â
> Â if (!aux_entry->locked) {
> Â out |= QRK_DTS_ENABLE_BIT;
> - ret = iosf_mbi_write(QRK_MBI_UNIT_RMU,
> QRK_MBI_RMU_WRITE,
> - QRK_DTS_REG_OFFSET_ENABLE,
> out);
> + ret = iosf_mbi_write(QRK_MBI_UNIT_RMU,
> MBI_REG_WRITE,
> + ÂÂÂÂÂQRK_DTS_REG_OFFSET_ENABLE,
> out);
> Â if (ret)
> Â return ret;
> Â
> @@ -158,8 +158,8 @@ static int soc_dts_disable(struct
> thermal_zone_device *tzd)
> Â struct soc_sensor_entry *aux_entry = tzd->devdata;
> Â int ret;
> Â
> - ret = iosf_mbi_read(QRK_MBI_UNIT_RMU, QRK_MBI_RMU_READ,
> - QRK_DTS_REG_OFFSET_ENABLE,
> &out);
> + ret = iosf_mbi_read(QRK_MBI_UNIT_RMU, MBI_REG_READ,
> + ÂÂÂÂQRK_DTS_REG_OFFSET_ENABLE, &out);
> Â if (ret)
> Â return ret;
> Â
> @@ -170,8 +170,8 @@ static int soc_dts_disable(struct
> thermal_zone_device *tzd)
> Â
> Â if (!aux_entry->locked) {
> Â out &= ~QRK_DTS_ENABLE_BIT;
> - ret = iosf_mbi_write(QRK_MBI_UNIT_RMU,
> QRK_MBI_RMU_WRITE,
> - QRK_DTS_REG_OFFSET_ENABLE,
> out);
> + ret = iosf_mbi_write(QRK_MBI_UNIT_RMU,
> MBI_REG_WRITE,
> + ÂÂÂÂÂQRK_DTS_REG_OFFSET_ENABLE,
> out);
> Â
> Â if (ret)
> Â return ret;
> @@ -192,8 +192,8 @@ static int _get_trip_temp(int trip, int *temp)
> Â u32 out;
> Â
> Â mutex_lock(&dts_update_mutex);
> - status = iosf_mbi_read(QRK_MBI_UNIT_RMU, QRK_MBI_RMU_READ,
> - QRK_DTS_REG_OFFSET_PTPS, &out);
> + status = iosf_mbi_read(QRK_MBI_UNIT_RMU, MBI_REG_READ,
> + ÂÂÂÂÂÂÂQRK_DTS_REG_OFFSET_PTPS, &out);
> Â mutex_unlock(&dts_update_mutex);
> Â
> Â if (status)
> @@ -236,8 +236,8 @@ static int update_trip_temp(struct
> soc_sensor_entry *aux_entry,
> Â goto failed;
> Â }
> Â
> - ret = iosf_mbi_read(QRK_MBI_UNIT_RMU, QRK_MBI_RMU_READ,
> - QRK_DTS_REG_OFFSET_PTPS,
> &store_ptps);
> + ret = iosf_mbi_read(QRK_MBI_UNIT_RMU, MBI_REG_READ,
> + ÂÂÂÂQRK_DTS_REG_OFFSET_PTPS, &store_ptps);
> Â if (ret)
> Â goto failed;
> Â
> @@ -262,8 +262,8 @@ static int update_trip_temp(struct
> soc_sensor_entry *aux_entry,
> Â out |= (temp_out & QRK_DTS_MASK_TP_THRES) <<
> Â (trip * QRK_DTS_SHIFT_TP);
> Â
> - ret = iosf_mbi_write(QRK_MBI_UNIT_RMU, QRK_MBI_RMU_WRITE,
> - QRK_DTS_REG_OFFSET_PTPS, out);
> + ret = iosf_mbi_write(QRK_MBI_UNIT_RMU, MBI_REG_WRITE,
> + ÂÂÂÂÂQRK_DTS_REG_OFFSET_PTPS, out);
> Â
> Âfailed:
> Â mutex_unlock(&dts_update_mutex);
> @@ -294,8 +294,8 @@ static int sys_get_curr_temp(struct
> thermal_zone_device *tzd,
> Â int ret;
> Â
> Â mutex_lock(&dts_update_mutex);
> - ret = iosf_mbi_read(QRK_MBI_UNIT_RMU, QRK_MBI_RMU_READ,
> - QRK_DTS_REG_OFFSET_TEMP,
> &out);
> + ret = iosf_mbi_read(QRK_MBI_UNIT_RMU, MBI_REG_READ,
> + ÂÂÂÂQRK_DTS_REG_OFFSET_TEMP, &out);
> Â mutex_unlock(&dts_update_mutex);
> Â
> Â if (ret)
> @@ -350,13 +350,13 @@ static void free_soc_dts(struct
> soc_sensor_entry *aux_entry)
> Â if (aux_entry) {
> Â if (!aux_entry->locked) {
> Â mutex_lock(&dts_update_mutex);
> - iosf_mbi_write(QRK_MBI_UNIT_RMU,
> QRK_MBI_RMU_WRITE,
> - QRK_DTS_REG_OFFSET_ENABLE,
> - aux_entry-
> >store_dts_enable);
> + iosf_mbi_write(QRK_MBI_UNIT_RMU,
> MBI_REG_WRITE,
> + ÂÂÂÂÂÂÂQRK_DTS_REG_OFFSET_ENABLE,
> + ÂÂÂÂÂÂÂaux_entry->store_dts_enable);
> Â
> - iosf_mbi_write(QRK_MBI_UNIT_RMU,
> QRK_MBI_RMU_WRITE,
> - QRK_DTS_REG_OFFSET_PTPS,
> - aux_entry->store_ptps);
> + iosf_mbi_write(QRK_MBI_UNIT_RMU,
> MBI_REG_WRITE,
> + ÂÂÂÂÂÂÂQRK_DTS_REG_OFFSET_PTPS,
> + ÂÂÂÂÂÂÂaux_entry->store_ptps);
> Â mutex_unlock(&dts_update_mutex);
> Â }
> Â thermal_zone_device_unregister(aux_entry->tzone);
> @@ -378,9 +378,8 @@ static struct soc_sensor_entry
> *alloc_soc_dts(void)
> Â }
> Â
> Â /* Check if DTS register is locked */
> - err = iosf_mbi_read(QRK_MBI_UNIT_RMU, QRK_MBI_RMU_READ,
> - QRK_DTS_REG_OFFSET_LOCK,
> - &out);
> + err = iosf_mbi_read(QRK_MBI_UNIT_RMU, MBI_REG_READ,
> + ÂÂÂÂQRK_DTS_REG_OFFSET_LOCK, &out);
> Â if (err)
> Â goto err_ret;
> Â
> @@ -395,16 +394,16 @@ static struct soc_sensor_entry
> *alloc_soc_dts(void)
> Â /* Store DTS default state if DTS registers are not locked
> */
> Â if (!aux_entry->locked) {
> Â /* Store DTS default enable for restore on exit */
> - err = iosf_mbi_read(QRK_MBI_UNIT_RMU,
> QRK_MBI_RMU_READ,
> - QRK_DTS_REG_OFFSET_ENABLE,
> - &aux_entry-
> >store_dts_enable);
> + err = iosf_mbi_read(QRK_MBI_UNIT_RMU, MBI_REG_READ,
> + ÂÂÂÂQRK_DTS_REG_OFFSET_ENABLE,
> + ÂÂÂÂ&aux_entry->store_dts_enable);
> Â if (err)
> Â goto err_ret;
> Â
> Â /* Store DTS default PTPS register for restore on
> exit */
> - err = iosf_mbi_read(QRK_MBI_UNIT_RMU,
> QRK_MBI_RMU_READ,
> - QRK_DTS_REG_OFFSET_PTPS,
> - &aux_entry->store_ptps);
> + err = iosf_mbi_read(QRK_MBI_UNIT_RMU, MBI_REG_READ,
> + ÂÂÂÂQRK_DTS_REG_OFFSET_PTPS,
> + ÂÂÂÂ&aux_entry->store_ptps);
> Â if (err)
> Â goto err_ret;
> Â }
> diff --git a/drivers/thermal/intel_soc_dts_iosf.c
> b/drivers/thermal/intel_soc_dts_iosf.c
> index 5841d1d..f72e1db 100644
> --- a/drivers/thermal/intel_soc_dts_iosf.c
> +++ b/drivers/thermal/intel_soc_dts_iosf.c
> @@ -90,7 +90,7 @@ static int sys_get_trip_temp(struct
> thermal_zone_device *tzd, int trip,
> Â dts = tzd->devdata;
> Â sensors = dts->sensors;
> Â mutex_lock(&sensors->dts_update_lock);
> - status = iosf_mbi_read(BT_MBI_UNIT_PMC, BT_MBI_BUNIT_READ,
> + status = iosf_mbi_read(BT_MBI_UNIT_PMC, MBI_REG_READ,
> Â ÂÂÂÂÂÂÂSOC_DTS_OFFSET_PTPS, &out);
> Â mutex_unlock(&sensors->dts_update_lock);
> Â if (status)
> @@ -124,27 +124,27 @@ static int update_trip_temp(struct
> intel_soc_dts_sensor_entry *dts,
> Â
> Â temp_out = (sensors->tj_max - temp) / 1000;
> Â
> - status = iosf_mbi_read(BT_MBI_UNIT_PMC, BT_MBI_BUNIT_READ,
> + status = iosf_mbi_read(BT_MBI_UNIT_PMC, MBI_REG_READ,
> Â ÂÂÂÂÂÂÂSOC_DTS_OFFSET_PTPS, &store_ptps);
> Â if (status)
> Â return status;
> Â
> Â out = (store_ptps & ~(0xFF << (thres_index * 8)));
> Â out |= (temp_out & 0xFF) << (thres_index * 8);
> - status = iosf_mbi_write(BT_MBI_UNIT_PMC, BT_MBI_BUNIT_WRITE,
> + status = iosf_mbi_write(BT_MBI_UNIT_PMC, MBI_REG_WRITE,
> Â SOC_DTS_OFFSET_PTPS, out);
> Â if (status)
> Â return status;
> Â
> Â pr_debug("update_trip_temp PTPS = %x\n", out);
> - status = iosf_mbi_read(BT_MBI_UNIT_PMC, BT_MBI_BUNIT_READ,
> + status = iosf_mbi_read(BT_MBI_UNIT_PMC, MBI_REG_READ,
> Â ÂÂÂÂÂÂÂSOC_DTS_OFFSET_PTMC, &out);
> Â if (status)
> Â goto err_restore_ptps;
> Â
> Â store_ptmc = out;
> Â
> - status = iosf_mbi_read(BT_MBI_UNIT_PMC, BT_MBI_BUNIT_READ,
> + status = iosf_mbi_read(BT_MBI_UNIT_PMC, MBI_REG_READ,
> Â ÂÂÂÂÂÂÂSOC_DTS_TE_AUX0 + thres_index,
> Â ÂÂÂÂÂÂÂ&te_out);
> Â if (status)
> @@ -167,12 +167,12 @@ static int update_trip_temp(struct
> intel_soc_dts_sensor_entry *dts,
> Â out &= ~SOC_DTS_AUX0_ENABLE_BIT;
> Â te_out &= ~int_enable_bit;
> Â }
> - status = iosf_mbi_write(BT_MBI_UNIT_PMC, BT_MBI_BUNIT_WRITE,
> + status = iosf_mbi_write(BT_MBI_UNIT_PMC, MBI_REG_WRITE,
> Â SOC_DTS_OFFSET_PTMC, out);
> Â if (status)
> Â goto err_restore_te_out;
> Â
> - status = iosf_mbi_write(BT_MBI_UNIT_PMC, BT_MBI_BUNIT_WRITE,
> + status = iosf_mbi_write(BT_MBI_UNIT_PMC, MBI_REG_WRITE,
> Â SOC_DTS_TE_AUX0 + thres_index,
> Â te_out);
> Â if (status)
> @@ -182,13 +182,13 @@ static int update_trip_temp(struct
> intel_soc_dts_sensor_entry *dts,
> Â
> Â return 0;
> Âerr_restore_te_out:
> - iosf_mbi_write(BT_MBI_UNIT_PMC, BT_MBI_BUNIT_WRITE,
> + iosf_mbi_write(BT_MBI_UNIT_PMC, MBI_REG_WRITE,
> Â ÂÂÂÂÂÂÂSOC_DTS_OFFSET_PTMC, store_te_out);
> Âerr_restore_ptmc:
> - iosf_mbi_write(BT_MBI_UNIT_PMC, BT_MBI_BUNIT_WRITE,
> + iosf_mbi_write(BT_MBI_UNIT_PMC, MBI_REG_WRITE,
> Â ÂÂÂÂÂÂÂSOC_DTS_OFFSET_PTMC, store_ptmc);
> Âerr_restore_ptps:
> - iosf_mbi_write(BT_MBI_UNIT_PMC, BT_MBI_BUNIT_WRITE,
> + iosf_mbi_write(BT_MBI_UNIT_PMC, MBI_REG_WRITE,
> Â ÂÂÂÂÂÂÂSOC_DTS_OFFSET_PTPS, store_ptps);
> Â /* Nothing we can do if restore fails */
> Â
> @@ -235,7 +235,7 @@ static int sys_get_curr_temp(struct
> thermal_zone_device *tzd,
> Â
> Â dts = tzd->devdata;
> Â sensors = dts->sensors;
> - status = iosf_mbi_read(BT_MBI_UNIT_PMC, BT_MBI_BUNIT_READ,
> + status = iosf_mbi_read(BT_MBI_UNIT_PMC, MBI_REG_READ,
> Â ÂÂÂÂÂÂÂSOC_DTS_OFFSET_TEMP, &out);
> Â if (status)
> Â return status;
> @@ -259,14 +259,14 @@ static int soc_dts_enable(int id)
> Â u32 out;
> Â int ret;
> Â
> - ret = iosf_mbi_read(BT_MBI_UNIT_PMC, BT_MBI_BUNIT_READ,
> + ret = iosf_mbi_read(BT_MBI_UNIT_PMC, MBI_REG_READ,
> Â ÂÂÂÂSOC_DTS_OFFSET_ENABLE, &out);
> Â if (ret)
> Â return ret;
> Â
> Â if (!(out & BIT(id))) {
> Â out |= BIT(id);
> - ret = iosf_mbi_write(BT_MBI_UNIT_PMC,
> BT_MBI_BUNIT_WRITE,
> + ret = iosf_mbi_write(BT_MBI_UNIT_PMC, MBI_REG_WRITE,
> Â ÂÂÂÂÂSOC_DTS_OFFSET_ENABLE, out);
> Â if (ret)
> Â return ret;
> @@ -278,7 +278,7 @@ static int soc_dts_enable(int id)
> Âstatic void remove_dts_thermal_zone(struct
> intel_soc_dts_sensor_entry *dts)
> Â{
> Â if (dts) {
> - iosf_mbi_write(BT_MBI_UNIT_PMC, BT_MBI_BUNIT_WRITE,
> + iosf_mbi_write(BT_MBI_UNIT_PMC, MBI_REG_WRITE,
> Â ÂÂÂÂÂÂÂSOC_DTS_OFFSET_ENABLE, dts-
> >store_status);
> Â thermal_zone_device_unregister(dts->tzone);
> Â }
> @@ -296,9 +296,8 @@ static int add_dts_thermal_zone(int id, struct
> intel_soc_dts_sensor_entry *dts,
> Â int i;
> Â
> Â /* Store status to restor on exit */
> - ret = iosf_mbi_read(BT_MBI_UNIT_PMC, BT_MBI_BUNIT_READ,
> - ÂÂÂÂSOC_DTS_OFFSET_ENABLE,
> - ÂÂÂÂ&dts->store_status);
> + ret = iosf_mbi_read(BT_MBI_UNIT_PMC, MBI_REG_READ,
> + ÂÂÂÂSOC_DTS_OFFSET_ENABLE, &dts-
> >store_status);
> Â if (ret)
> Â goto err_ret;
> Â
> @@ -311,7 +310,7 @@ static int add_dts_thermal_zone(int id, struct
> intel_soc_dts_sensor_entry *dts,
> Â }
> Â
> Â /* Check if the writable trip we provide is not used by BIOS
> */
> - ret = iosf_mbi_read(BT_MBI_UNIT_PMC, BT_MBI_BUNIT_READ,
> + ret = iosf_mbi_read(BT_MBI_UNIT_PMC, MBI_REG_READ,
> Â ÂÂÂÂSOC_DTS_OFFSET_PTPS, &store_ptps);
> Â if (ret)
> Â trip_mask = 0;
> @@ -374,19 +373,19 @@ void
> intel_soc_dts_iosf_interrupt_handler(struct intel_soc_dts_sensors
> *sensors)
> Â
> Â spin_lock_irqsave(&sensors->intr_notify_lock, flags);
> Â
> - status = iosf_mbi_read(BT_MBI_UNIT_PMC, BT_MBI_BUNIT_READ,
> + status = iosf_mbi_read(BT_MBI_UNIT_PMC, MBI_REG_READ,
> Â ÂÂÂÂÂÂÂSOC_DTS_OFFSET_PTMC, &ptmc_out);
> Â ptmc_out |= SOC_DTS_PTMC_APIC_DEASSERT_BIT;
> - status = iosf_mbi_write(BT_MBI_UNIT_PMC, BT_MBI_BUNIT_WRITE,
> + status = iosf_mbi_write(BT_MBI_UNIT_PMC, MBI_REG_WRITE,
> Â SOC_DTS_OFFSET_PTMC, ptmc_out);
> Â
> - status = iosf_mbi_read(BT_MBI_UNIT_PMC, BT_MBI_BUNIT_READ,
> + status = iosf_mbi_read(BT_MBI_UNIT_PMC, MBI_REG_READ,
> Â ÂÂÂÂÂÂÂSOC_DTS_OFFSET_PTTSS, &sticky_out);
> Â pr_debug("status %d PTTSS %x\n", status, sticky_out);
> Â if (sticky_out & SOC_DTS_TRIP_MASK) {
> Â int i;
> Â /* reset sticky bit */
> - status = iosf_mbi_write(BT_MBI_UNIT_PMC,
> BT_MBI_BUNIT_WRITE,
> + status = iosf_mbi_write(BT_MBI_UNIT_PMC,
> MBI_REG_WRITE,
> Â SOC_DTS_OFFSET_PTTSS,
> sticky_out);
> Â spin_unlock_irqrestore(&sensors->intr_notify_lock,
> flags);
> Â

--
Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Intel Finland Oy

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/