Source
x
static int sprd_pmic_spi_write(void *context, const void *data, size_t count)
/*
* Copyright (C) 2017 Spreadtrum Communications Inc.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
struct sprd_pmic {
struct regmap *regmap;
struct device *dev;
struct regmap_irq *irqs;
struct regmap_irq_chip irq_chip;
struct regmap_irq_chip_data *irq_data;
int irq;
};
struct sprd_pmic_data {
u32 irq_base;
u32 num_irqs;
};
/*
* Since different PMICs of SC27xx series can have different interrupt
* base address and irq number, we should save irq number and irq base
* in the device data structure.
*/
static const struct sprd_pmic_data sc2731_data = {
.irq_base = SPRD_SC2731_IRQ_BASE,
.num_irqs = SPRD_SC2731_IRQ_NUMS,
};
static const struct mfd_cell sprd_pmic_devs[] = {
{
.name = "sc27xx-wdt",
.of_compatible = "sprd,sc2731-wdt",
}, {
.name = "sc27xx-rtc",
.of_compatible = "sprd,sc2731-rtc",
}, {
.name = "sc27xx-charger",
.of_compatible = "sprd,sc2731-charger",
}, {
.name = "sc27xx-chg-timer",
.of_compatible = "sprd,sc2731-chg-timer",
}, {
.name = "sc27xx-fast-chg",
.of_compatible = "sprd,sc2731-fast-chg",
}, {
.name = "sc27xx-chg-wdt",
.of_compatible = "sprd,sc2731-chg-wdt",
}, {
.name = "sc27xx-typec",
.of_compatible = "sprd,sc2731-typec",
}, {
.name = "sc27xx-flash",
.of_compatible = "sprd,sc2731-flash",
}, {
.name = "sc27xx-eic",
.of_compatible = "sprd,sc2731-eic",
}, {
.name = "sc27xx-efuse",
.of_compatible = "sprd,sc2731-efuse",
}, {
.name = "sc27xx-thermal",
.of_compatible = "sprd,sc2731-thermal",
}, {
.name = "sc27xx-adc",
.of_compatible = "sprd,sc2731-adc",
}, {
.name = "sc27xx-audio-codec",
.of_compatible = "sprd,sc2731-audio-codec",