Merge tag 'mfd-for-linus-3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd into next
Pull MFD updates from Lee Jones: "Changes to existing drivers: - increase DT coverage: arizona, mc13xxx, stmpe-i2c, syscon, sun6i-prcm - regmap use of and/or clean-up: tps65090, twl6040 - basic renaming: max14577 - use new cpufreq helpers: db8500-prcmu - increase regulator support: stmpe, arizona, wm5102 - reduce legacy GPIO overhead: stmpe - provide necessary remove path: bcm590xx - expand sysfs presence: kempld - move driver specific code out to drivers: rtc-s5m, arizona - clk handling: twl6040 - use managed (devm_*) resources: ipaq-micro - clean-up/remove unused/duplicated code: tps65218, sec, pm8921, abx500-core, db8500-prcmu, menelaus - build/boot/sematic bug fixes: rtsx_usb, stmpe, bcm590xx, abx500, mc13xxx, rdc321x-southbridge, mfd-core, sec, max14577, syscon, cros_ec_spi - constify stuff: sm501, tps65910, tps6507x, tps6586x, max77686, max8997, kempld, max77693, max8907, rtsx_usb, db8500-prcmu, max8998, wm8400, sec, lp3943, max14577, as3711, omap-usb-host, ipaq-micro Support for new devices: - add support for max77836 into max14577 - add support for tps658640 into tps6586x - add support for cros-ec-i2c-tunnel into cros_ec - add new driver for rtsx_usb_sdmmc and rtsx_usb_ms - add new driver for axp20x - add new driver for sun6i-prcm - add new driver for ipaq-micro" * tag 'mfd-for-linus-3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (77 commits) mfd: wm5102: Correct default for LDO Control 2 register mfd: menelaus: Use module_i2c_driver mfd: tps65218: Terminate of match table mfd: db8500-prcmu: Remove check for CONFIG_DBX500_PRCMU_DEBUG mfd: ti-keystone-devctrl: Add bindings for device state control mfd: palmas: Format the header file mfd: abx500-core: Remove unused function abx500_dump_all_banks() mfd: arizona: Correct addresses of always-on trigger registers mfd: max14577: Cast to architecture agnostic data type i2c: ChromeOS EC tunnel driver mfd: cros_ec: Sync to the latest cros_ec_commands.h from EC sources mfd: cros_ec: spi: Increase cros_ec_spi deadline from 5ms to 100ms mfd: cros_ec: spi: Make the cros_ec_spi timeout more reliable mfd: cros_ec: spi: Add mutex to cros_ec_spi mfd: cros_ec: spi: Calculate delay between transfers correctly mfd: arizona: Correct error message for addition of main IRQ chip mfd: wm8997: Add registers for high power mode mfd: arizona: Add MICVDD to mapped regulators mfd: ipaq-micro: Make mfd_cell array const mfd: ipaq-micro: Use devm_ioremap_resource() ...
This commit is contained in:
@@ -330,7 +330,6 @@ int abx500_mask_and_set_register_interruptible(struct device *dev, u8 bank,
|
||||
int abx500_get_chip_id(struct device *dev);
|
||||
int abx500_event_registers_startup_state_get(struct device *dev, u8 *event);
|
||||
int abx500_startup_irq_enabled(struct device *dev, unsigned int irq);
|
||||
void abx500_dump_all_banks(void);
|
||||
|
||||
struct abx500_ops {
|
||||
int (*get_chip_id) (struct device *);
|
||||
|
@@ -42,12 +42,14 @@
|
||||
#define ARIZONA_SAMPLE_RATE_SEQUENCE_SELECT_2 0x62
|
||||
#define ARIZONA_SAMPLE_RATE_SEQUENCE_SELECT_3 0x63
|
||||
#define ARIZONA_SAMPLE_RATE_SEQUENCE_SELECT_4 0x64
|
||||
#define ARIZONA_ALWAYS_ON_TRIGGERS_SEQUENCE_SELECT_1 0x68
|
||||
#define ARIZONA_ALWAYS_ON_TRIGGERS_SEQUENCE_SELECT_2 0x69
|
||||
#define ARIZONA_ALWAYS_ON_TRIGGERS_SEQUENCE_SELECT_3 0x6A
|
||||
#define ARIZONA_ALWAYS_ON_TRIGGERS_SEQUENCE_SELECT_4 0x6B
|
||||
#define ARIZONA_ALWAYS_ON_TRIGGERS_SEQUENCE_SELECT_5 0x6C
|
||||
#define ARIZONA_ALWAYS_ON_TRIGGERS_SEQUENCE_SELECT_6 0x6D
|
||||
#define ARIZONA_ALWAYS_ON_TRIGGERS_SEQUENCE_SELECT_1 0x66
|
||||
#define ARIZONA_ALWAYS_ON_TRIGGERS_SEQUENCE_SELECT_2 0x67
|
||||
#define ARIZONA_ALWAYS_ON_TRIGGERS_SEQUENCE_SELECT_3 0x68
|
||||
#define ARIZONA_ALWAYS_ON_TRIGGERS_SEQUENCE_SELECT_4 0x69
|
||||
#define ARIZONA_ALWAYS_ON_TRIGGERS_SEQUENCE_SELECT_5 0x6A
|
||||
#define ARIZONA_ALWAYS_ON_TRIGGERS_SEQUENCE_SELECT_6 0x6B
|
||||
#define ARIZONA_ALWAYS_ON_TRIGGERS_SEQUENCE_SELECT_7 0x6C
|
||||
#define ARIZONA_ALWAYS_ON_TRIGGERS_SEQUENCE_SELECT_8 0x6D
|
||||
#define ARIZONA_COMFORT_NOISE_GENERATOR 0x70
|
||||
#define ARIZONA_HAPTICS_CONTROL_1 0x90
|
||||
#define ARIZONA_HAPTICS_CONTROL_2 0x91
|
||||
|
180
include/linux/mfd/axp20x.h
Normal file
180
include/linux/mfd/axp20x.h
Normal file
@@ -0,0 +1,180 @@
|
||||
/*
|
||||
* Functions and registers to access AXP20X power management chip.
|
||||
*
|
||||
* Copyright (C) 2013, Carlo Caione <carlo@caione.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#ifndef __LINUX_MFD_AXP20X_H
|
||||
#define __LINUX_MFD_AXP20X_H
|
||||
|
||||
enum {
|
||||
AXP202_ID = 0,
|
||||
AXP209_ID,
|
||||
};
|
||||
|
||||
#define AXP20X_DATACACHE(m) (0x04 + (m))
|
||||
|
||||
/* Power supply */
|
||||
#define AXP20X_PWR_INPUT_STATUS 0x00
|
||||
#define AXP20X_PWR_OP_MODE 0x01
|
||||
#define AXP20X_USB_OTG_STATUS 0x02
|
||||
#define AXP20X_PWR_OUT_CTRL 0x12
|
||||
#define AXP20X_DCDC2_V_OUT 0x23
|
||||
#define AXP20X_DCDC2_LDO3_V_SCAL 0x25
|
||||
#define AXP20X_DCDC3_V_OUT 0x27
|
||||
#define AXP20X_LDO24_V_OUT 0x28
|
||||
#define AXP20X_LDO3_V_OUT 0x29
|
||||
#define AXP20X_VBUS_IPSOUT_MGMT 0x30
|
||||
#define AXP20X_V_OFF 0x31
|
||||
#define AXP20X_OFF_CTRL 0x32
|
||||
#define AXP20X_CHRG_CTRL1 0x33
|
||||
#define AXP20X_CHRG_CTRL2 0x34
|
||||
#define AXP20X_CHRG_BAK_CTRL 0x35
|
||||
#define AXP20X_PEK_KEY 0x36
|
||||
#define AXP20X_DCDC_FREQ 0x37
|
||||
#define AXP20X_V_LTF_CHRG 0x38
|
||||
#define AXP20X_V_HTF_CHRG 0x39
|
||||
#define AXP20X_APS_WARN_L1 0x3a
|
||||
#define AXP20X_APS_WARN_L2 0x3b
|
||||
#define AXP20X_V_LTF_DISCHRG 0x3c
|
||||
#define AXP20X_V_HTF_DISCHRG 0x3d
|
||||
|
||||
/* Interrupt */
|
||||
#define AXP20X_IRQ1_EN 0x40
|
||||
#define AXP20X_IRQ2_EN 0x41
|
||||
#define AXP20X_IRQ3_EN 0x42
|
||||
#define AXP20X_IRQ4_EN 0x43
|
||||
#define AXP20X_IRQ5_EN 0x44
|
||||
#define AXP20X_IRQ1_STATE 0x48
|
||||
#define AXP20X_IRQ2_STATE 0x49
|
||||
#define AXP20X_IRQ3_STATE 0x4a
|
||||
#define AXP20X_IRQ4_STATE 0x4b
|
||||
#define AXP20X_IRQ5_STATE 0x4c
|
||||
|
||||
/* ADC */
|
||||
#define AXP20X_ACIN_V_ADC_H 0x56
|
||||
#define AXP20X_ACIN_V_ADC_L 0x57
|
||||
#define AXP20X_ACIN_I_ADC_H 0x58
|
||||
#define AXP20X_ACIN_I_ADC_L 0x59
|
||||
#define AXP20X_VBUS_V_ADC_H 0x5a
|
||||
#define AXP20X_VBUS_V_ADC_L 0x5b
|
||||
#define AXP20X_VBUS_I_ADC_H 0x5c
|
||||
#define AXP20X_VBUS_I_ADC_L 0x5d
|
||||
#define AXP20X_TEMP_ADC_H 0x5e
|
||||
#define AXP20X_TEMP_ADC_L 0x5f
|
||||
#define AXP20X_TS_IN_H 0x62
|
||||
#define AXP20X_TS_IN_L 0x63
|
||||
#define AXP20X_GPIO0_V_ADC_H 0x64
|
||||
#define AXP20X_GPIO0_V_ADC_L 0x65
|
||||
#define AXP20X_GPIO1_V_ADC_H 0x66
|
||||
#define AXP20X_GPIO1_V_ADC_L 0x67
|
||||
#define AXP20X_PWR_BATT_H 0x70
|
||||
#define AXP20X_PWR_BATT_M 0x71
|
||||
#define AXP20X_PWR_BATT_L 0x72
|
||||
#define AXP20X_BATT_V_H 0x78
|
||||
#define AXP20X_BATT_V_L 0x79
|
||||
#define AXP20X_BATT_CHRG_I_H 0x7a
|
||||
#define AXP20X_BATT_CHRG_I_L 0x7b
|
||||
#define AXP20X_BATT_DISCHRG_I_H 0x7c
|
||||
#define AXP20X_BATT_DISCHRG_I_L 0x7d
|
||||
#define AXP20X_IPSOUT_V_HIGH_H 0x7e
|
||||
#define AXP20X_IPSOUT_V_HIGH_L 0x7f
|
||||
|
||||
/* Power supply */
|
||||
#define AXP20X_DCDC_MODE 0x80
|
||||
#define AXP20X_ADC_EN1 0x82
|
||||
#define AXP20X_ADC_EN2 0x83
|
||||
#define AXP20X_ADC_RATE 0x84
|
||||
#define AXP20X_GPIO10_IN_RANGE 0x85
|
||||
#define AXP20X_GPIO1_ADC_IRQ_RIS 0x86
|
||||
#define AXP20X_GPIO1_ADC_IRQ_FAL 0x87
|
||||
#define AXP20X_TIMER_CTRL 0x8a
|
||||
#define AXP20X_VBUS_MON 0x8b
|
||||
#define AXP20X_OVER_TMP 0x8f
|
||||
|
||||
/* GPIO */
|
||||
#define AXP20X_GPIO0_CTRL 0x90
|
||||
#define AXP20X_LDO5_V_OUT 0x91
|
||||
#define AXP20X_GPIO1_CTRL 0x92
|
||||
#define AXP20X_GPIO2_CTRL 0x93
|
||||
#define AXP20X_GPIO20_SS 0x94
|
||||
#define AXP20X_GPIO3_CTRL 0x95
|
||||
|
||||
/* Battery */
|
||||
#define AXP20X_CHRG_CC_31_24 0xb0
|
||||
#define AXP20X_CHRG_CC_23_16 0xb1
|
||||
#define AXP20X_CHRG_CC_15_8 0xb2
|
||||
#define AXP20X_CHRG_CC_7_0 0xb3
|
||||
#define AXP20X_DISCHRG_CC_31_24 0xb4
|
||||
#define AXP20X_DISCHRG_CC_23_16 0xb5
|
||||
#define AXP20X_DISCHRG_CC_15_8 0xb6
|
||||
#define AXP20X_DISCHRG_CC_7_0 0xb7
|
||||
#define AXP20X_CC_CTRL 0xb8
|
||||
#define AXP20X_FG_RES 0xb9
|
||||
|
||||
/* Regulators IDs */
|
||||
enum {
|
||||
AXP20X_LDO1 = 0,
|
||||
AXP20X_LDO2,
|
||||
AXP20X_LDO3,
|
||||
AXP20X_LDO4,
|
||||
AXP20X_LDO5,
|
||||
AXP20X_DCDC2,
|
||||
AXP20X_DCDC3,
|
||||
AXP20X_REG_ID_MAX,
|
||||
};
|
||||
|
||||
/* IRQs */
|
||||
enum {
|
||||
AXP20X_IRQ_ACIN_OVER_V = 1,
|
||||
AXP20X_IRQ_ACIN_PLUGIN,
|
||||
AXP20X_IRQ_ACIN_REMOVAL,
|
||||
AXP20X_IRQ_VBUS_OVER_V,
|
||||
AXP20X_IRQ_VBUS_PLUGIN,
|
||||
AXP20X_IRQ_VBUS_REMOVAL,
|
||||
AXP20X_IRQ_VBUS_V_LOW,
|
||||
AXP20X_IRQ_BATT_PLUGIN,
|
||||
AXP20X_IRQ_BATT_REMOVAL,
|
||||
AXP20X_IRQ_BATT_ENT_ACT_MODE,
|
||||
AXP20X_IRQ_BATT_EXIT_ACT_MODE,
|
||||
AXP20X_IRQ_CHARG,
|
||||
AXP20X_IRQ_CHARG_DONE,
|
||||
AXP20X_IRQ_BATT_TEMP_HIGH,
|
||||
AXP20X_IRQ_BATT_TEMP_LOW,
|
||||
AXP20X_IRQ_DIE_TEMP_HIGH,
|
||||
AXP20X_IRQ_CHARG_I_LOW,
|
||||
AXP20X_IRQ_DCDC1_V_LONG,
|
||||
AXP20X_IRQ_DCDC2_V_LONG,
|
||||
AXP20X_IRQ_DCDC3_V_LONG,
|
||||
AXP20X_IRQ_PEK_SHORT = 22,
|
||||
AXP20X_IRQ_PEK_LONG,
|
||||
AXP20X_IRQ_N_OE_PWR_ON,
|
||||
AXP20X_IRQ_N_OE_PWR_OFF,
|
||||
AXP20X_IRQ_VBUS_VALID,
|
||||
AXP20X_IRQ_VBUS_NOT_VALID,
|
||||
AXP20X_IRQ_VBUS_SESS_VALID,
|
||||
AXP20X_IRQ_VBUS_SESS_END,
|
||||
AXP20X_IRQ_LOW_PWR_LVL1,
|
||||
AXP20X_IRQ_LOW_PWR_LVL2,
|
||||
AXP20X_IRQ_TIMER,
|
||||
AXP20X_IRQ_PEK_RIS_EDGE,
|
||||
AXP20X_IRQ_PEK_FAL_EDGE,
|
||||
AXP20X_IRQ_GPIO3_INPUT,
|
||||
AXP20X_IRQ_GPIO2_INPUT,
|
||||
AXP20X_IRQ_GPIO1_INPUT,
|
||||
AXP20X_IRQ_GPIO0_INPUT,
|
||||
};
|
||||
|
||||
struct axp20x_dev {
|
||||
struct device *dev;
|
||||
struct i2c_client *i2c_client;
|
||||
struct regmap *regmap;
|
||||
struct regmap_irq_chip_data *regmap_irqc;
|
||||
long variant;
|
||||
};
|
||||
|
||||
#endif /* __LINUX_MFD_AXP20X_H */
|
@@ -29,8 +29,8 @@ enum {
|
||||
EC_MSG_RX_PROTO_BYTES = 3,
|
||||
|
||||
/* Max length of messages */
|
||||
EC_MSG_BYTES = EC_HOST_PARAM_SIZE + EC_MSG_TX_PROTO_BYTES,
|
||||
|
||||
EC_MSG_BYTES = EC_PROTO2_MAX_PARAM_SIZE +
|
||||
EC_MSG_TX_PROTO_BYTES,
|
||||
};
|
||||
|
||||
/**
|
||||
|
File diff suppressed because it is too large
Load Diff
148
include/linux/mfd/ipaq-micro.h
Normal file
148
include/linux/mfd/ipaq-micro.h
Normal file
@@ -0,0 +1,148 @@
|
||||
/*
|
||||
* Header file for the compaq Micro MFD
|
||||
*/
|
||||
|
||||
#ifndef _MFD_IPAQ_MICRO_H_
|
||||
#define _MFD_IPAQ_MICRO_H_
|
||||
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/completion.h>
|
||||
#include <linux/list.h>
|
||||
|
||||
#define TX_BUF_SIZE 32
|
||||
#define RX_BUF_SIZE 16
|
||||
#define CHAR_SOF 0x02
|
||||
|
||||
/*
|
||||
* These are the different messages that can be sent to the microcontroller
|
||||
* to control various aspects.
|
||||
*/
|
||||
#define MSG_VERSION 0x0
|
||||
#define MSG_KEYBOARD 0x2
|
||||
#define MSG_TOUCHSCREEN 0x3
|
||||
#define MSG_EEPROM_READ 0x4
|
||||
#define MSG_EEPROM_WRITE 0x5
|
||||
#define MSG_THERMAL_SENSOR 0x6
|
||||
#define MSG_NOTIFY_LED 0x8
|
||||
#define MSG_BATTERY 0x9
|
||||
#define MSG_SPI_READ 0xb
|
||||
#define MSG_SPI_WRITE 0xc
|
||||
#define MSG_BACKLIGHT 0xd /* H3600 only */
|
||||
#define MSG_CODEC_CTRL 0xe /* H3100 only */
|
||||
#define MSG_DISPLAY_CTRL 0xf /* H3100 only */
|
||||
|
||||
/* state of receiver parser */
|
||||
enum rx_state {
|
||||
STATE_SOF = 0, /* Next byte should be start of frame */
|
||||
STATE_ID, /* Next byte is ID & message length */
|
||||
STATE_DATA, /* Next byte is a data byte */
|
||||
STATE_CHKSUM /* Next byte should be checksum */
|
||||
};
|
||||
|
||||
/**
|
||||
* struct ipaq_micro_txdev - TX state
|
||||
* @len: length of message in TX buffer
|
||||
* @index: current index into TX buffer
|
||||
* @buf: TX buffer
|
||||
*/
|
||||
struct ipaq_micro_txdev {
|
||||
u8 len;
|
||||
u8 index;
|
||||
u8 buf[TX_BUF_SIZE];
|
||||
};
|
||||
|
||||
/**
|
||||
* struct ipaq_micro_rxdev - RX state
|
||||
* @state: context of RX state machine
|
||||
* @chksum: calculated checksum
|
||||
* @id: message ID from packet
|
||||
* @len: RX buffer length
|
||||
* @index: RX buffer index
|
||||
* @buf: RX buffer
|
||||
*/
|
||||
struct ipaq_micro_rxdev {
|
||||
enum rx_state state;
|
||||
unsigned char chksum;
|
||||
u8 id;
|
||||
unsigned int len;
|
||||
unsigned int index;
|
||||
u8 buf[RX_BUF_SIZE];
|
||||
};
|
||||
|
||||
/**
|
||||
* struct ipaq_micro_msg - message to the iPAQ microcontroller
|
||||
* @id: 4-bit ID of the message
|
||||
* @tx_len: length of TX data
|
||||
* @tx_data: TX data to send
|
||||
* @rx_len: length of receieved RX data
|
||||
* @rx_data: RX data to recieve
|
||||
* @ack: a completion that will be completed when RX is complete
|
||||
* @node: list node if message gets queued
|
||||
*/
|
||||
struct ipaq_micro_msg {
|
||||
u8 id;
|
||||
u8 tx_len;
|
||||
u8 tx_data[TX_BUF_SIZE];
|
||||
u8 rx_len;
|
||||
u8 rx_data[RX_BUF_SIZE];
|
||||
struct completion ack;
|
||||
struct list_head node;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct ipaq_micro - iPAQ microcontroller state
|
||||
* @dev: corresponding platform device
|
||||
* @base: virtual memory base for underlying serial device
|
||||
* @sdlc: virtual memory base for Synchronous Data Link Controller
|
||||
* @version: version string
|
||||
* @tx: TX state
|
||||
* @rx: RX state
|
||||
* @lock: lock for this state container
|
||||
* @msg: current message
|
||||
* @queue: message queue
|
||||
* @key: callback for asynchronous key events
|
||||
* @key_data: data to pass along with key events
|
||||
* @ts: callback for asynchronous touchscreen events
|
||||
* @ts_data: data to pass along with key events
|
||||
*/
|
||||
struct ipaq_micro {
|
||||
struct device *dev;
|
||||
void __iomem *base;
|
||||
void __iomem *sdlc;
|
||||
char version[5];
|
||||
struct ipaq_micro_txdev tx; /* transmit ISR state */
|
||||
struct ipaq_micro_rxdev rx; /* receive ISR state */
|
||||
spinlock_t lock;
|
||||
struct ipaq_micro_msg *msg;
|
||||
struct list_head queue;
|
||||
void (*key) (void *data, int len, unsigned char *rxdata);
|
||||
void *key_data;
|
||||
void (*ts) (void *data, int len, unsigned char *rxdata);
|
||||
void *ts_data;
|
||||
};
|
||||
|
||||
extern int
|
||||
ipaq_micro_tx_msg(struct ipaq_micro *micro, struct ipaq_micro_msg *msg);
|
||||
|
||||
static inline int
|
||||
ipaq_micro_tx_msg_sync(struct ipaq_micro *micro,
|
||||
struct ipaq_micro_msg *msg)
|
||||
{
|
||||
int ret;
|
||||
|
||||
init_completion(&msg->ack);
|
||||
ret = ipaq_micro_tx_msg(micro, msg);
|
||||
wait_for_completion(&msg->ack);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline int
|
||||
ipaq_micro_tx_msg_async(struct ipaq_micro *micro,
|
||||
struct ipaq_micro_msg *msg)
|
||||
{
|
||||
init_completion(&msg->ack);
|
||||
return ipaq_micro_tx_msg(micro, msg);
|
||||
}
|
||||
|
||||
#endif /* _MFD_IPAQ_MICRO_H_ */
|
@@ -51,6 +51,8 @@
|
||||
#define KEMPLD_TYPE_DEBUG 0x1
|
||||
#define KEMPLD_TYPE_CUSTOM 0x2
|
||||
|
||||
#define KEMPLD_VERSION_LEN 10
|
||||
|
||||
/**
|
||||
* struct kempld_info - PLD device information structure
|
||||
* @major: PLD major revision
|
||||
@@ -60,6 +62,7 @@
|
||||
* @type: PLD type
|
||||
* @spec_major: PLD FW specification major revision
|
||||
* @spec_minor: PLD FW specification minor revision
|
||||
* @version: PLD version string
|
||||
*/
|
||||
struct kempld_info {
|
||||
unsigned int major;
|
||||
@@ -69,6 +72,7 @@ struct kempld_info {
|
||||
unsigned int type;
|
||||
unsigned int spec_major;
|
||||
unsigned int spec_minor;
|
||||
char version[KEMPLD_VERSION_LEN];
|
||||
};
|
||||
|
||||
/**
|
||||
|
@@ -117,10 +117,6 @@ struct mc13xxx_led_platform_data {
|
||||
|
||||
#define MAX_LED_CONTROL_REGS 6
|
||||
|
||||
struct mc13xxx_leds_platform_data {
|
||||
struct mc13xxx_led_platform_data *led;
|
||||
int num_leds;
|
||||
|
||||
/* MC13783 LED Control 0 */
|
||||
#define MC13783_LED_C0_ENABLE (1 << 0)
|
||||
#define MC13783_LED_C0_TRIODE_MD (1 << 7)
|
||||
@@ -169,10 +165,13 @@ struct mc13xxx_leds_platform_data {
|
||||
/* MC34708 LED Control 0 */
|
||||
#define MC34708_LED_C0_CURRENT_R(x) (((x) & 0x3) << 9)
|
||||
#define MC34708_LED_C0_CURRENT_G(x) (((x) & 0x3) << 21)
|
||||
|
||||
struct mc13xxx_leds_platform_data {
|
||||
struct mc13xxx_led_platform_data *led;
|
||||
int num_leds;
|
||||
u32 led_control[MAX_LED_CONTROL_REGS];
|
||||
};
|
||||
|
||||
struct mc13xxx_buttons_platform_data {
|
||||
#define MC13783_BUTTON_DBNC_0MS 0
|
||||
#define MC13783_BUTTON_DBNC_30MS 1
|
||||
#define MC13783_BUTTON_DBNC_150MS 2
|
||||
@@ -180,6 +179,8 @@ struct mc13xxx_buttons_platform_data {
|
||||
#define MC13783_BUTTON_ENABLE (1 << 2)
|
||||
#define MC13783_BUTTON_POL_INVERT (1 << 3)
|
||||
#define MC13783_BUTTON_RESET_EN (1 << 4)
|
||||
|
||||
struct mc13xxx_buttons_platform_data {
|
||||
int b1on_flags;
|
||||
unsigned short b1on_key;
|
||||
int b2on_flags;
|
||||
@@ -188,14 +189,14 @@ struct mc13xxx_buttons_platform_data {
|
||||
unsigned short b3on_key;
|
||||
};
|
||||
|
||||
#define MC13783_TS_ATO_FIRST false
|
||||
#define MC13783_TS_ATO_EACH true
|
||||
|
||||
struct mc13xxx_ts_platform_data {
|
||||
/* Delay between Touchscreen polarization and ADC Conversion.
|
||||
* Given in clock ticks of a 32 kHz clock which gives a granularity of
|
||||
* about 30.5ms */
|
||||
u8 ato;
|
||||
|
||||
#define MC13783_TS_ATO_FIRST false
|
||||
#define MC13783_TS_ATO_EACH true
|
||||
/* Use the ATO delay only for the first conversion or for each one */
|
||||
bool atox;
|
||||
};
|
||||
@@ -210,11 +211,12 @@ struct mc13xxx_codec_platform_data {
|
||||
enum mc13783_ssi_port dac_ssi_port;
|
||||
};
|
||||
|
||||
struct mc13xxx_platform_data {
|
||||
#define MC13XXX_USE_TOUCHSCREEN (1 << 0)
|
||||
#define MC13XXX_USE_TOUCHSCREEN (1 << 0)
|
||||
#define MC13XXX_USE_CODEC (1 << 1)
|
||||
#define MC13XXX_USE_ADC (1 << 2)
|
||||
#define MC13XXX_USE_RTC (1 << 3)
|
||||
|
||||
struct mc13xxx_platform_data {
|
||||
unsigned int flags;
|
||||
|
||||
struct mc13xxx_regulator_platform_data regulators;
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,81 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2011, 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 8xxx driver header file
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __MFD_PM8XXX_CORE_H
|
||||
#define __MFD_PM8XXX_CORE_H
|
||||
|
||||
#include <linux/mfd/core.h>
|
||||
|
||||
struct pm8xxx_drvdata {
|
||||
int (*pmic_readb) (const struct device *dev, u16 addr, u8 *val);
|
||||
int (*pmic_writeb) (const struct device *dev, u16 addr, u8 val);
|
||||
int (*pmic_read_buf) (const struct device *dev, u16 addr, u8 *buf,
|
||||
int n);
|
||||
int (*pmic_write_buf) (const struct device *dev, u16 addr, u8 *buf,
|
||||
int n);
|
||||
int (*pmic_read_irq_stat) (const struct device *dev, int irq);
|
||||
void *pm_chip_data;
|
||||
};
|
||||
|
||||
static inline int pm8xxx_readb(const struct device *dev, u16 addr, u8 *val)
|
||||
{
|
||||
struct pm8xxx_drvdata *dd = dev_get_drvdata(dev);
|
||||
|
||||
if (!dd)
|
||||
return -EINVAL;
|
||||
return dd->pmic_readb(dev, addr, val);
|
||||
}
|
||||
|
||||
static inline int pm8xxx_writeb(const struct device *dev, u16 addr, u8 val)
|
||||
{
|
||||
struct pm8xxx_drvdata *dd = dev_get_drvdata(dev);
|
||||
|
||||
if (!dd)
|
||||
return -EINVAL;
|
||||
return dd->pmic_writeb(dev, addr, val);
|
||||
}
|
||||
|
||||
static inline int pm8xxx_read_buf(const struct device *dev, u16 addr, u8 *buf,
|
||||
int n)
|
||||
{
|
||||
struct pm8xxx_drvdata *dd = dev_get_drvdata(dev);
|
||||
|
||||
if (!dd)
|
||||
return -EINVAL;
|
||||
return dd->pmic_read_buf(dev, addr, buf, n);
|
||||
}
|
||||
|
||||
static inline int pm8xxx_write_buf(const struct device *dev, u16 addr, u8 *buf,
|
||||
int n)
|
||||
{
|
||||
struct pm8xxx_drvdata *dd = dev_get_drvdata(dev);
|
||||
|
||||
if (!dd)
|
||||
return -EINVAL;
|
||||
return dd->pmic_write_buf(dev, addr, buf, n);
|
||||
}
|
||||
|
||||
static inline int pm8xxx_read_irq_stat(const struct device *dev, int irq)
|
||||
{
|
||||
struct pm8xxx_drvdata *dd = dev_get_drvdata(dev);
|
||||
|
||||
if (!dd)
|
||||
return -EINVAL;
|
||||
return dd->pmic_read_irq_stat(dev, irq);
|
||||
}
|
||||
|
||||
#endif
|
@@ -12,7 +12,7 @@
|
||||
#define RDC321X_GPIO_CTRL_REG2 0x84
|
||||
#define RDC321X_GPIO_DATA_REG2 0x88
|
||||
|
||||
#define RDC321X_MAX_GPIO 58
|
||||
#define RDC321X_NUM_GPIO 59
|
||||
|
||||
struct rdc321x_gpio_pdata {
|
||||
struct pci_dev *sb_pdev;
|
||||
|
@@ -24,35 +24,36 @@ enum sec_device_type {
|
||||
};
|
||||
|
||||
/**
|
||||
* struct sec_pmic_dev - s5m87xx master device for sub-drivers
|
||||
* @dev: master device of the chip (can be used to access platform data)
|
||||
* @pdata: pointer to private data used to pass platform data to child
|
||||
* @i2c: i2c client private data for regulator
|
||||
* @rtc: i2c client private data for rtc
|
||||
* @iolock: mutex for serializing io access
|
||||
* @irqlock: mutex for buslock
|
||||
* @irq_base: base IRQ number for sec-pmic, required for IRQs
|
||||
* @irq: generic IRQ number for s5m87xx
|
||||
* @ono: power onoff IRQ number for s5m87xx
|
||||
* @irq_masks_cur: currently active value
|
||||
* @irq_masks_cache: cached hardware value
|
||||
* @type: indicate which s5m87xx "variant" is used
|
||||
* struct sec_pmic_dev - s2m/s5m master device for sub-drivers
|
||||
* @dev: Master device of the chip
|
||||
* @pdata: Platform data populated with data from DTS
|
||||
* or board files
|
||||
* @regmap_pmic: Regmap associated with PMIC's I2C address
|
||||
* @i2c: I2C client of the main driver
|
||||
* @device_type: Type of device, matches enum sec_device_type
|
||||
* @irq_base: Base IRQ number for device, required for IRQs
|
||||
* @irq: Generic IRQ number for device
|
||||
* @irq_data: Runtime data structure for IRQ controller
|
||||
* @ono: Power onoff IRQ number for s5m87xx
|
||||
* @wakeup: Whether or not this is a wakeup device
|
||||
* @wtsr_smpl: Whether or not to enable in RTC driver the Watchdog
|
||||
* Timer Software Reset (registers set to default value
|
||||
* after PWRHOLD falling) and Sudden Momentary Power Loss
|
||||
* (PMIC will enter power on sequence after short drop in
|
||||
* VBATT voltage).
|
||||
*/
|
||||
struct sec_pmic_dev {
|
||||
struct device *dev;
|
||||
struct sec_platform_data *pdata;
|
||||
struct regmap *regmap_pmic;
|
||||
struct regmap *regmap_rtc;
|
||||
struct i2c_client *i2c;
|
||||
struct i2c_client *rtc;
|
||||
|
||||
int device_type;
|
||||
unsigned long device_type;
|
||||
int irq_base;
|
||||
int irq;
|
||||
struct regmap_irq_chip_data *irq_data;
|
||||
|
||||
int ono;
|
||||
unsigned long type;
|
||||
bool wakeup;
|
||||
bool wtsr_smpl;
|
||||
};
|
||||
|
@@ -11,6 +11,7 @@
|
||||
#include <linux/mutex.h>
|
||||
|
||||
struct device;
|
||||
struct regulator;
|
||||
|
||||
enum stmpe_block {
|
||||
STMPE_BLOCK_GPIO = 1 << 0,
|
||||
@@ -62,6 +63,8 @@ struct stmpe_client_info;
|
||||
|
||||
/**
|
||||
* struct stmpe - STMPE MFD structure
|
||||
* @vcc: optional VCC regulator
|
||||
* @vio: optional VIO regulator
|
||||
* @lock: lock protecting I/O operations
|
||||
* @irq_lock: IRQ bus lock
|
||||
* @dev: device, mostly for dev_dbg()
|
||||
@@ -73,13 +76,14 @@ struct stmpe_client_info;
|
||||
* @regs: list of addresses of registers which are at different addresses on
|
||||
* different variants. Indexed by one of STMPE_IDX_*.
|
||||
* @irq: irq number for stmpe
|
||||
* @irq_base: starting IRQ number for internal IRQs
|
||||
* @num_gpios: number of gpios, differs for variants
|
||||
* @ier: cache of IER registers for bus_lock
|
||||
* @oldier: cache of IER registers for bus_lock
|
||||
* @pdata: platform data
|
||||
*/
|
||||
struct stmpe {
|
||||
struct regulator *vcc;
|
||||
struct regulator *vio;
|
||||
struct mutex lock;
|
||||
struct mutex irq_lock;
|
||||
struct device *dev;
|
||||
@@ -91,7 +95,6 @@ struct stmpe {
|
||||
const u8 *regs;
|
||||
|
||||
int irq;
|
||||
int irq_base;
|
||||
int num_gpios;
|
||||
u8 ier[2];
|
||||
u8 oldier[2];
|
||||
@@ -132,8 +135,6 @@ struct stmpe_keypad_platform_data {
|
||||
|
||||
/**
|
||||
* struct stmpe_gpio_platform_data - STMPE GPIO platform data
|
||||
* @gpio_base: first gpio number assigned. A maximum of
|
||||
* %STMPE_NR_GPIOS GPIOs will be allocated.
|
||||
* @norequest_mask: bitmask specifying which GPIOs should _not_ be
|
||||
* requestable due to different usage (e.g. touch, keypad)
|
||||
* STMPE_GPIO_NOREQ_* macros can be used here.
|
||||
@@ -141,7 +142,6 @@ struct stmpe_keypad_platform_data {
|
||||
* @remove: board specific remove callback
|
||||
*/
|
||||
struct stmpe_gpio_platform_data {
|
||||
int gpio_base;
|
||||
unsigned norequest_mask;
|
||||
void (*setup)(struct stmpe *stmpe, unsigned gpio_base);
|
||||
void (*remove)(struct stmpe *stmpe, unsigned gpio_base);
|
||||
@@ -195,8 +195,6 @@ struct stmpe_ts_platform_data {
|
||||
* @irq_trigger: IRQ trigger to use for the interrupt to the host
|
||||
* @autosleep: bool to enable/disable stmpe autosleep
|
||||
* @autosleep_timeout: inactivity timeout in milliseconds for autosleep
|
||||
* @irq_base: base IRQ number. %STMPE_NR_IRQS irqs will be used, or
|
||||
* %STMPE_NR_INTERNAL_IRQS if the GPIO driver is not used.
|
||||
* @irq_over_gpio: true if gpio is used to get irq
|
||||
* @irq_gpio: gpio number over which irq will be requested (significant only if
|
||||
* irq_over_gpio is true)
|
||||
@@ -207,7 +205,6 @@ struct stmpe_ts_platform_data {
|
||||
struct stmpe_platform_data {
|
||||
int id;
|
||||
unsigned int blocks;
|
||||
int irq_base;
|
||||
unsigned int irq_trigger;
|
||||
bool autosleep;
|
||||
bool irq_over_gpio;
|
||||
@@ -219,10 +216,4 @@ struct stmpe_platform_data {
|
||||
struct stmpe_ts_platform_data *ts;
|
||||
};
|
||||
|
||||
#define STMPE_NR_INTERNAL_IRQS 9
|
||||
#define STMPE_INT_GPIO(x) (STMPE_NR_INTERNAL_IRQS + (x))
|
||||
|
||||
#define STMPE_NR_GPIOS 24
|
||||
#define STMPE_NR_IRQS STMPE_INT_GPIO(STMPE_NR_GPIOS)
|
||||
|
||||
#endif
|
||||
|
@@ -15,6 +15,8 @@
|
||||
#ifndef __LINUX_MFD_SYSCON_H__
|
||||
#define __LINUX_MFD_SYSCON_H__
|
||||
|
||||
#include <linux/err.h>
|
||||
|
||||
struct device_node;
|
||||
|
||||
#ifdef CONFIG_MFD_SYSCON
|
||||
|
@@ -267,7 +267,6 @@ struct tps65218 {
|
||||
u32 irq_mask;
|
||||
struct regmap_irq_chip_data *irq_data;
|
||||
struct regulator_desc desc[TPS65218_NUM_REGULATOR];
|
||||
struct regulator_dev *rdev[TPS65218_NUM_REGULATOR];
|
||||
struct tps_info *info[TPS65218_NUM_REGULATOR];
|
||||
struct regmap *regmap;
|
||||
};
|
||||
|
@@ -28,6 +28,7 @@
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/mfd/core.h>
|
||||
#include <linux/regulator/consumer.h>
|
||||
#include <linux/clk.h>
|
||||
|
||||
#define TWL6040_REG_ASICID 0x01
|
||||
#define TWL6040_REG_ASICREV 0x02
|
||||
@@ -157,6 +158,7 @@
|
||||
#define TWL6040_I2CSEL 0x01
|
||||
#define TWL6040_RESETSPLIT 0x04
|
||||
#define TWL6040_INTCLRMODE 0x08
|
||||
#define TWL6040_I2CMODE(x) ((x & 0x3) << 4)
|
||||
|
||||
/* STATUS (0x2E) fields */
|
||||
|
||||
@@ -222,6 +224,7 @@ struct twl6040 {
|
||||
struct regmap *regmap;
|
||||
struct regmap_irq_chip_data *irq_data;
|
||||
struct regulator_bulk_data supplies[2]; /* supplies for vio, v2v1 */
|
||||
struct clk *clk32k;
|
||||
struct mutex mutex;
|
||||
struct mutex irq_mutex;
|
||||
struct mfd_cell cells[TWL6040_CELLS];
|
||||
|
Reference in New Issue
Block a user