mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 22:26:55 +00:00
3afcbe0947
Tablet / laptop designs using an Intel Cherry Trail x86 main SoC with an Intel Whiskey Cove PMIC do not use a single standard setup for the charger, fuel-gauge and other chips surrounding the PMIC / charging+data USB port. Unlike what is normal on x86 this diversity in designs is not handled by the ACPI tables. On 2 of the 3 known designs there are no standard (PNP0C0A) ACPI battery devices and on the 3th design the ACPI battery device does not work under Linux due to it requiring non-standard and undocumented ACPI behavior. So to make things work under Linux we use native charger and fuel-gauge drivers on these devices, re-using the native drivers used on ARM boards with the same charger / fuel-gauge ICs. This requires various MFD-cell drivers for the CHT-WC PMIC cells to know which model they are exactly running on so that they can e.g. instantiate an I2C-client for the right model charger-IC (the charger is connected to an I2C-controller which is part of the PMIC). Rather then duplicating DMI-id matching to check which model we are running on in each MFD-cell driver, add a check for this to the shared drivers/mfd/intel_soc_pmic_chtwc.c code by using a DMI table for all 3 known models: 1. The GPD Win and GPD Pocket mini-laptops, these are really 2 models but the Pocket re-uses the GPD Win's design in a different housing: The WC PMIC is connected to a TI BQ24292i charger, paired with a Maxim MAX17047 fuelgauge + a FUSB302 USB Type-C Controller + a PI3USB30532 USB switch, for a fully functional Type-C port. 2. The Xiaomi Mi Pad 2: The WC PMIC is connected to a TI BQ25890 charger, paired with a TI BQ27520 fuelgauge, using the TI BQ25890 for BC1.2 charger type detection, for a USB-2 only Type-C port without PD. 3. The Lenovo Yoga Book YB1-X90 / Lenovo Yoga Book YB1-X91 series: The WC PMIC is connected to a TI BQ25892 charger, paired with a TI BQ27542 fuelgauge, using the WC PMIC for BC1.2 charger type detection and using the BQ25892's Mediatek Pump Express+ (1.0) support to enable charging with up to 12V through a micro-USB port. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
55 lines
1.8 KiB
C
55 lines
1.8 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* Intel SoC PMIC Driver
|
|
*
|
|
* Copyright (C) 2012-2014 Intel Corporation. All rights reserved.
|
|
*
|
|
* Author: Yang, Bin <bin.yang@intel.com>
|
|
* Author: Zhu, Lejun <lejun.zhu@linux.intel.com>
|
|
*/
|
|
|
|
#ifndef __INTEL_SOC_PMIC_H__
|
|
#define __INTEL_SOC_PMIC_H__
|
|
|
|
#include <linux/regmap.h>
|
|
|
|
enum intel_cht_wc_models {
|
|
INTEL_CHT_WC_UNKNOWN,
|
|
INTEL_CHT_WC_GPD_WIN_POCKET,
|
|
INTEL_CHT_WC_XIAOMI_MIPAD2,
|
|
INTEL_CHT_WC_LENOVO_YOGABOOK1,
|
|
};
|
|
|
|
/**
|
|
* struct intel_soc_pmic - Intel SoC PMIC data
|
|
* @irq: Master interrupt number of the parent PMIC device
|
|
* @regmap: Pointer to the parent PMIC device regmap structure
|
|
* @irq_chip_data: IRQ chip data for the PMIC itself
|
|
* @irq_chip_data_pwrbtn: Chained IRQ chip data for the Power Button
|
|
* @irq_chip_data_tmu: Chained IRQ chip data for the Time Management Unit
|
|
* @irq_chip_data_bcu: Chained IRQ chip data for the Burst Control Unit
|
|
* @irq_chip_data_adc: Chained IRQ chip data for the General Purpose ADC
|
|
* @irq_chip_data_chgr: Chained IRQ chip data for the External Charger
|
|
* @irq_chip_data_crit: Chained IRQ chip data for the Critical Event Handler
|
|
* @dev: Pointer to the parent PMIC device
|
|
* @scu: Pointer to the SCU IPC device data structure
|
|
*/
|
|
struct intel_soc_pmic {
|
|
int irq;
|
|
struct regmap *regmap;
|
|
struct regmap_irq_chip_data *irq_chip_data;
|
|
struct regmap_irq_chip_data *irq_chip_data_pwrbtn;
|
|
struct regmap_irq_chip_data *irq_chip_data_tmu;
|
|
struct regmap_irq_chip_data *irq_chip_data_bcu;
|
|
struct regmap_irq_chip_data *irq_chip_data_adc;
|
|
struct regmap_irq_chip_data *irq_chip_data_chgr;
|
|
struct regmap_irq_chip_data *irq_chip_data_crit;
|
|
struct device *dev;
|
|
struct intel_scu_ipc_dev *scu;
|
|
enum intel_cht_wc_models cht_wc_model;
|
|
};
|
|
|
|
int intel_soc_pmic_exec_mipi_pmic_seq_element(u16 i2c_address, u32 reg_address,
|
|
u32 value, u32 mask);
|
|
|
|
#endif /* __INTEL_SOC_PMIC_H__ */
|