mfd: 8821: Add support for pm8821 core driver
Add support for the Qualcomm PM8821 PMIC chip. The core driver will communicate with the PMIC chip via the MSM SSBI bus. Initial support is provided for: IRQ, MPP, and Debug Change-Id: Ic072e634c55925292196a3e710d2dc628cbf2780 Signed-off-by: Jay Chokshi <jchokshi@codeaurora.org>
This commit is contained in:
committed by
Stephen Boyd
parent
494bb51ec7
commit
208dea470f
@@ -24,6 +24,7 @@ enum pm8xxx_version {
|
||||
PM8XXX_VERSION_8058,
|
||||
PM8XXX_VERSION_8901,
|
||||
PM8XXX_VERSION_8921,
|
||||
PM8XXX_VERSION_8821,
|
||||
};
|
||||
|
||||
/* PMIC version specific silicon revisions */
|
||||
@@ -43,6 +44,11 @@ enum pm8xxx_version {
|
||||
#define PM8XXX_REVISION_8921_1p1 2
|
||||
#define PM8XXX_REVISION_8921_2p0 3
|
||||
|
||||
#define PM8XXX_REVISION_8821_TEST 0
|
||||
#define PM8XXX_REVISION_8821_1p0 1
|
||||
#define PM8XXX_REVISION_8821_2p0 2
|
||||
#define PM8XXX_REVISION_8821_2p1 3
|
||||
|
||||
struct pm8xxx_drvdata {
|
||||
int (*pmic_readb) (const struct device *dev,
|
||||
u16 addr, u8 *val);
|
||||
|
||||
@@ -158,6 +158,10 @@ static inline int pm8xxx_mpp_config(unsigned mpp, unsigned type, unsigned level,
|
||||
#define PM8921_MPP_DIG_LEVEL_L17 4
|
||||
#define PM8921_MPP_DIG_LEVEL_VPH 7
|
||||
|
||||
/* Digital Input/Output: level [PM8821] */
|
||||
#define PM8821_MPP_DIG_LEVEL_1P8 1
|
||||
#define PM8821_MPP_DIG_LEVEL_VPH 7
|
||||
|
||||
/* Digital Input: control */
|
||||
#define PM8XXX_MPP_DIN_TO_INT 0
|
||||
#define PM8XXX_MPP_DIN_TO_DBUS1 1
|
||||
|
||||
48
include/linux/mfd/pm8xxx/pm8821.h
Normal file
48
include/linux/mfd/pm8xxx/pm8821.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 and
|
||||
* only version 2 as published by the Free Software Foundation.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
/*
|
||||
* Qualcomm PMIC 8821 driver header file
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __MFD_PM8821_H
|
||||
#define __MFD_PM8821_H
|
||||
|
||||
#include <linux/device.h>
|
||||
#include <linux/mfd/pm8xxx/pm8821-irq.h>
|
||||
#include <linux/mfd/pm8xxx/mpp.h>
|
||||
|
||||
#define PM8821_NR_IRQS (112)
|
||||
#define PM8821_NR_MPPS (4)
|
||||
|
||||
#define PM8821_MPP_BLOCK_START (4)
|
||||
|
||||
/*
|
||||
* Block 0 does not exist in PM8821 IRQ SSBI address space,
|
||||
* IRQ0 is assigned to bit0 of block1
|
||||
*/
|
||||
#define PM8821_IRQ_BLOCK_BIT(block, bit) ((block-1) * 8 + (bit))
|
||||
|
||||
/* MPPs [1,N] */
|
||||
#define PM8821_MPP_IRQ(base, mpp) ((base) + \
|
||||
PM8821_IRQ_BLOCK_BIT(PM8821_MPP_BLOCK_START, (mpp)-1))
|
||||
|
||||
/* PMIC Interrupts */
|
||||
|
||||
struct pm8821_platform_data {
|
||||
int irq_base;
|
||||
struct pm8xxx_irq_platform_data *irq_pdata;
|
||||
struct pm8xxx_mpp_platform_data *mpp_pdata;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user