Commit 656211b1 authored by Steve Twiss's avatar Steve Twiss Committed by Lee Jones

mfd: Add support for DA9061

MFD support for DA9061 is provided as part of the DA9062 device driver.

The registers header file adds two new chip variant IDs defined in DA9061
and DA9062 hardware. The core header file adds new software enumerations
for listing the valid DA9061 IRQs and a da9062_compatible_types enumeration
for distinguishing between DA9061/62 devices in software.

The core source code adds a new .compatible of_device_id entry. This is
extended from DA9062 to support both "dlg,da9061" and "dlg,da9062". The
.data entry now holds a reference to the enumerated device type.

A new regmap_irq_chip model is added for DA9061 and this supports the new
list of regmap_irq entries. A new mfd_cell da9061_devs[] array lists the
new sub system components for DA9061. Support is added for a new DA9061
regmap_config which lists the correct readable, writable and volatile
ranges for this chip.

The probe function uses the device tree compatible string to switch on the
da9062_compatible_types and configure the correct mfd cells, irq chip and
regmap config.

Kconfig is updated to reflect support for DA9061 and DA9062 PMICs.
Signed-off-by: default avatarSteve Twiss <stwiss.opensource@diasemi.com>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent e1569fb6
......@@ -267,13 +267,14 @@ config MFD_DA9055
called "da9055"
config MFD_DA9062
tristate "Dialog Semiconductor DA9062 PMIC Support"
tristate "Dialog Semiconductor DA9062/61 PMIC Support"
select MFD_CORE
select REGMAP_I2C
select REGMAP_IRQ
depends on I2C
help
Say yes here for support for the Dialog Semiconductor DA9062 PMIC.
Say yes here for support for the Dialog Semiconductor DA9061 and
DA9062 PMICs.
This includes the I2C driver and core APIs.
Additional drivers must be enabled in order to use the functionality
of the device.
......
This diff is collapsed.
/*
* Copyright (C) 2015 Dialog Semiconductor Ltd.
* Copyright (C) 2015-2017 Dialog Semiconductor
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
......@@ -18,7 +18,31 @@
#include <linux/interrupt.h>
#include <linux/mfd/da9062/registers.h>
/* Interrupts */
enum da9062_compatible_types {
COMPAT_TYPE_DA9061 = 1,
COMPAT_TYPE_DA9062,
};
enum da9061_irqs {
/* IRQ A */
DA9061_IRQ_ONKEY,
DA9061_IRQ_WDG_WARN,
DA9061_IRQ_SEQ_RDY,
/* IRQ B*/
DA9061_IRQ_TEMP,
DA9061_IRQ_LDO_LIM,
DA9061_IRQ_DVC_RDY,
DA9061_IRQ_VDD_WARN,
/* IRQ C */
DA9061_IRQ_GPI0,
DA9061_IRQ_GPI1,
DA9061_IRQ_GPI2,
DA9061_IRQ_GPI3,
DA9061_IRQ_GPI4,
DA9061_NUM_IRQ,
};
enum da9062_irqs {
/* IRQ A */
DA9062_IRQ_ONKEY,
......@@ -45,6 +69,7 @@ struct da9062 {
struct device *dev;
struct regmap *regmap;
struct regmap_irq_chip_data *regmap_irq;
enum da9062_compatible_types chip_type;
};
#endif /* __MFD_DA9062_CORE_H__ */
/*
* registers.h - REGISTERS H for DA9062
* Copyright (C) 2015 Dialog Semiconductor Ltd.
* Copyright (C) 2015-2017 Dialog Semiconductor
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
......@@ -18,6 +17,8 @@
#define DA9062_PMIC_DEVICE_ID 0x62
#define DA9062_PMIC_VARIANT_MRC_AA 0x01
#define DA9062_PMIC_VARIANT_VRC_DA9061 0x01
#define DA9062_PMIC_VARIANT_VRC_DA9062 0x02
#define DA9062_I2C_PAGE_SEL_SHIFT 1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment