mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-28 07:04:00 +08:00
4b78147468
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAABAgAGBQJPw2QKAAoJEIqAPN1PVmxKfv8P/2L5d38tc3+9wYuGI1l+k7Mz xQt2PdAx/kHQGTjLE1DSoeOD6dn4aodFbPaTcsLsU9Eo4IiJnT68b8adr/bqYHKU Cod6NSPJMaBxLBJZxXsA7nY69Z6O5SMjXxEQsiDc24gaP0jjwaeY35KJSfMug8nF DA6rvEpchkF8QXzBmkO2t2/uPYr1YWqDZQkauLDnLRG01JnGXFz5ajv9N5pYhiFt QyYtheg8yEnfwnQ6AlmRtGK75jZRVmrj0kOzRjE9UL7ZwtzswWJes+RE3tlgk89m JQ7KASRmmqLpvcVJ9fG9SlGX//yBO6OEp5Km06RTxgmt0XftBDVqBTjk1EG2tfMR SR0NIz6gJ0twKAe6U0d+5HMYalOU45H5ha9e3vCqZ8vl9JfmM95RS+TmWbGcRIqj 04Y5x3I4zq6e9D0u+211BeuRfzkQiefwWJmdPpn0oac3u5LeYbRj/aQ85fqwJWzG f99D9VU5xgfFHPAtL3SLFiwgd9yOiMBar6eeIva+okDyOW3KaEUzs8Y4dgDyvYcg IU//JGK51vLVmI5kXtGCwYkgRLF/Y7WKZ8TwypT+SY6iv6tPQVvApOZljq7RC9GI mXx2z2slA90jlg3TlEFZfxr1WqbZ3TCbonU1riLeMEtkiXUpLtmKC8gbhOqfGvvn Nzgt+YqRJXafZdELb/S+ =Rh0r -----END PGP SIGNATURE----- Merge tag 'mfd-3.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6 Pull MFD changes from Samuel Ortiz: "Besides the usual cleanups, this one brings: * Support for 5 new chipsets: Intel's ICH LPC and SCH Centerton, ST-E's STAX211, Samsung's MAX77693 and TI's LM3533. * Device tree support for the twl6040, tps65910, da9502 and ab8500 drivers. * Fairly big tps56910, ab8500 and db8500 updates. * i2c support for mc13xxx. * Our regular update for the wm8xxx driver from Mark." Fix up various conflicts with other trees, largely due to ab5500 removal etc. * tag 'mfd-3.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: (106 commits) mfd: Fix build break of max77693 by adding REGMAP_I2C option mfd: Fix twl6040 build failure mfd: Fix max77693 build failure mfd: ab8500-core should depend on MFD_DB8500_PRCMU gpio: tps65910: dt: process gpio specific device node info mfd: Remove the parsing of dt info for tps65910 gpio mfd: Save device node parsed platform data for tps65910 sub devices mfd: Add r_select to lm3533 platform data gpio: Add Intel Centerton support to gpio-sch mfd: Emulate active low IRQs as well as active high IRQs for wm831x mfd: Mark two lm3533 zone registers as volatile mfd: Fix return type of lm533 attribute is_visible mfd: Enable Device Tree support in the ab8500-pwm driver mfd: Enable Device Tree support in the ab8500-sysctrl driver mfd: Add support for Device Tree to twl6040 mfd: Register the twl6040 child for the ASoC codec unconditionally mfd: Allocate twl6040 IRQ numbers dynamically mfd: twl6040 code cleanup in interrupt initialization part mfd: Enable ab8500-gpadc driver for Device Tree mfd: Prevent unassigned pointer from being used in ab8500-gpadc driver ...
115 lines
2.9 KiB
C
115 lines
2.9 KiB
C
/*
|
|
* include/linux/mfd/wm8994/core.h -- Core interface for WM8994
|
|
*
|
|
* Copyright 2009 Wolfson Microelectronics PLC.
|
|
*
|
|
* Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
* under the terms of the GNU General Public License as published by the
|
|
* Free Software Foundation; either version 2 of the License, or (at your
|
|
* option) any later version.
|
|
*
|
|
*/
|
|
|
|
#ifndef __MFD_WM8994_CORE_H__
|
|
#define __MFD_WM8994_CORE_H__
|
|
|
|
#include <linux/mutex.h>
|
|
#include <linux/interrupt.h>
|
|
#include <linux/regmap.h>
|
|
|
|
enum wm8994_type {
|
|
WM8994 = 0,
|
|
WM8958 = 1,
|
|
WM1811 = 2,
|
|
};
|
|
|
|
struct regulator_dev;
|
|
struct regulator_bulk_data;
|
|
|
|
#define WM8994_NUM_GPIO_REGS 11
|
|
#define WM8994_NUM_LDO_REGS 2
|
|
#define WM8994_NUM_IRQ_REGS 2
|
|
|
|
#define WM8994_IRQ_TEMP_SHUT 0
|
|
#define WM8994_IRQ_MIC1_DET 1
|
|
#define WM8994_IRQ_MIC1_SHRT 2
|
|
#define WM8994_IRQ_MIC2_DET 3
|
|
#define WM8994_IRQ_MIC2_SHRT 4
|
|
#define WM8994_IRQ_FLL1_LOCK 5
|
|
#define WM8994_IRQ_FLL2_LOCK 6
|
|
#define WM8994_IRQ_SRC1_LOCK 7
|
|
#define WM8994_IRQ_SRC2_LOCK 8
|
|
#define WM8994_IRQ_AIF1DRC1_SIG_DET 9
|
|
#define WM8994_IRQ_AIF1DRC2_SIG_DET 10
|
|
#define WM8994_IRQ_AIF2DRC_SIG_DET 11
|
|
#define WM8994_IRQ_FIFOS_ERR 12
|
|
#define WM8994_IRQ_WSEQ_DONE 13
|
|
#define WM8994_IRQ_DCS_DONE 14
|
|
#define WM8994_IRQ_TEMP_WARN 15
|
|
|
|
/* GPIOs in the chip are numbered from 1-11 */
|
|
#define WM8994_IRQ_GPIO(x) (x + WM8994_IRQ_TEMP_WARN)
|
|
|
|
struct wm8994 {
|
|
struct mutex irq_lock;
|
|
|
|
enum wm8994_type type;
|
|
int revision;
|
|
int cust_id;
|
|
|
|
struct device *dev;
|
|
struct regmap *regmap;
|
|
|
|
bool ldo_ena_always_driven;
|
|
|
|
int gpio_base;
|
|
int irq_base;
|
|
|
|
int irq;
|
|
struct regmap_irq_chip_data *irq_data;
|
|
|
|
/* Used over suspend/resume */
|
|
bool suspended;
|
|
|
|
struct regulator_dev *dbvdd;
|
|
int num_supplies;
|
|
struct regulator_bulk_data *supplies;
|
|
};
|
|
|
|
/* Device I/O API */
|
|
int wm8994_reg_read(struct wm8994 *wm8994, unsigned short reg);
|
|
int wm8994_reg_write(struct wm8994 *wm8994, unsigned short reg,
|
|
unsigned short val);
|
|
int wm8994_set_bits(struct wm8994 *wm8994, unsigned short reg,
|
|
unsigned short mask, unsigned short val);
|
|
int wm8994_bulk_read(struct wm8994 *wm8994, unsigned short reg,
|
|
int count, u16 *buf);
|
|
int wm8994_bulk_write(struct wm8994 *wm8994, unsigned short reg,
|
|
int count, const u16 *buf);
|
|
|
|
|
|
/* Helper to save on boilerplate */
|
|
static inline int wm8994_request_irq(struct wm8994 *wm8994, int irq,
|
|
irq_handler_t handler, const char *name,
|
|
void *data)
|
|
{
|
|
if (!wm8994->irq_data)
|
|
return -EINVAL;
|
|
return request_threaded_irq(regmap_irq_get_virq(wm8994->irq_data, irq),
|
|
NULL, handler, IRQF_TRIGGER_RISING, name,
|
|
data);
|
|
}
|
|
static inline void wm8994_free_irq(struct wm8994 *wm8994, int irq, void *data)
|
|
{
|
|
if (!wm8994->irq_data)
|
|
return;
|
|
free_irq(regmap_irq_get_virq(wm8994->irq_data, irq), data);
|
|
}
|
|
|
|
int wm8994_irq_init(struct wm8994 *wm8994);
|
|
void wm8994_irq_exit(struct wm8994 *wm8994);
|
|
|
|
#endif
|