diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/bitops.h | 6 | ||||
-rw-r--r-- | include/linux/clk.h | 32 | ||||
-rw-r--r-- | include/linux/cpufreq.h | 1 | ||||
-rw-r--r-- | include/linux/device.h | 21 | ||||
-rw-r--r-- | include/linux/i2c.h | 13 | ||||
-rw-r--r-- | include/linux/i2c/twl.h | 16 | ||||
-rwxr-xr-x | include/linux/interrupt_keys.h | 47 | ||||
-rw-r--r-- | include/linux/nct1008.h | 3 | ||||
-rw-r--r-- | include/linux/nvhost.h | 62 | ||||
-rw-r--r-- | include/linux/nvmap.h | 161 | ||||
-rw-r--r-- | include/linux/platform_device.h | 9 | ||||
-rw-r--r-- | include/linux/regmap.h | 31 | ||||
-rw-r--r-- | include/linux/regulator/gpio-switch-regulator.h | 69 | ||||
-rw-r--r-- | include/linux/regulator/max8973-regulator.h | 77 | ||||
-rw-r--r-- | include/linux/regulator/tps6238x0-regulator.h | 46 | ||||
-rw-r--r-- | include/linux/smb349-charger.h | 2 | ||||
-rw-r--r-- | include/linux/tegra_audio.h | 2 | ||||
-rw-r--r-- | include/linux/wl12xx.h | 4 |
18 files changed, 443 insertions, 159 deletions
diff --git a/include/linux/bitops.h b/include/linux/bitops.h index a3ef66a2a083..be18556b84d0 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h @@ -26,6 +26,12 @@ extern unsigned long __sw_hweight64(__u64 w); (bit) < (size); \ (bit) = find_next_bit((addr), (size), (bit) + 1)) +/* same as for_each_set_bit() but use bit as value to start with */ +#define for_each_set_bit_from(bit, addr, size) \ + for ((bit) = find_next_bit((addr), (size), (bit)); \ + (bit) < (size); \ + (bit) = find_next_bit((addr), (size), (bit) + 1)) + static __inline__ int get_bitmask_order(unsigned int count) { int order; diff --git a/include/linux/clk.h b/include/linux/clk.h index 1d37f42ac294..59b428e5fbc5 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h @@ -41,6 +41,26 @@ struct clk; struct clk *clk_get(struct device *dev, const char *id); /** + * devm_clk_get - lookup and obtain a managed reference to a clock producer. + * @dev: device for clock "consumer" + * @id: clock comsumer ID + * + * Returns a struct clk corresponding to the clock producer, or + * valid IS_ERR() condition containing errno. The implementation + * uses @dev and @id to determine the clock consumer, and thereby + * the clock producer. (IOW, @id may be identical strings, but + * clk_get may return different clock producers depending on @dev.) + * + * Drivers must assume that the clock source is not enabled. + * + * devm_clk_get should not be called from within interrupt context. + * + * The clock will automatically be freed when the device is unbound + * from the bus. + */ +struct clk *devm_clk_get(struct device *dev, const char *id); + +/** * clk_enable - inform the system when the clock source should be running. * @clk: clock source * @@ -83,6 +103,18 @@ unsigned long clk_get_rate(struct clk *clk); */ void clk_put(struct clk *clk); +/** + * devm_clk_put - "free" a managed clock source + * @dev: device used to acuqire the clock + * @clk: clock source acquired with devm_clk_get() + * + * Note: drivers must ensure that all clk_enable calls made on this + * clock source are balanced by clk_disable calls prior to calling + * this function. + * + * clk_put should not be called from within interrupt context. + */ +void devm_clk_put(struct device *dev, struct clk *clk); /* * The remaining APIs are optional for machine class support. diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index c6126b9fb7cf..09b8ea9e194b 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -310,6 +310,7 @@ __ATTR(_name, 0644, show_##_name, store_##_name) *********************************************************************/ int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu); int cpufreq_update_policy(unsigned int cpu); +int cpufreq_set_gov(char *target_gov, unsigned int cpu); #ifdef CONFIG_CPU_FREQ /* query the current CPU frequency (in kHz). If zero, cpufreq couldn't detect it */ diff --git a/include/linux/device.h b/include/linux/device.h index 28c35f876b19..62608d13da3c 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -913,4 +913,25 @@ extern long sysfs_deprecated; #define sysfs_deprecated 0 #endif +/** + * module_driver() - Helper macro for drivers that don't do anything + * special in module init/exit. This eliminates a lot of boilerplate. + * Each module may only use this macro once, and calling it replaces + * module_init() and module_exit(). + * + * Use this macro to construct bus specific macros for registering + * drivers, and do not use it on its own. + */ +#define module_driver(__driver, __register, __unregister) \ +static int __init __driver##_init(void) \ +{ \ + return __register(&(__driver)); \ +} \ +module_init(__driver##_init); \ +static void __exit __driver##_exit(void) \ +{ \ + __unregister(&(__driver)); \ +} \ +module_exit(__driver##_exit); + #endif /* _DEVICE_H_ */ diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 0bd9ea2b62ea..8d3eab3226ad 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -468,6 +468,19 @@ static inline int i2c_adapter_id(struct i2c_adapter *adap) { return adap->nr; } + +/** + * module_i2c_driver() - Helper macro for registering a I2C driver + * @__i2c_driver: i2c_driver struct + * + * Helper macro for I2C drivers which do not do anything special in module + * init/exit. This eliminates a lot of boilerplate. Each module may only + * use this macro once, and calling it replaces module_init() and module_exit() + */ +#define module_i2c_driver(__i2c_driver) \ + module_driver(__i2c_driver, i2c_add_driver, \ + i2c_del_driver) + #endif /* I2C */ #endif /* __KERNEL__ */ diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h index bb92f0b13288..4fea7107fee8 100644 --- a/include/linux/i2c/twl.h +++ b/include/linux/i2c/twl.h @@ -862,22 +862,6 @@ static inline int twl4030charger_usb_en(int enable) { return 0; } #define TWL6030_REG_VDAC 45 #define TWL6030_REG_VUSB 46 -/* These are renamed in 6025 but same registers */ -#define TWL6025_REG_LDO2 48 -#define TWL6025_REG_LDO4 49 -#define TWL6025_REG_LDO3 50 -#define TWL6025_REG_LDO5 51 -#define TWL6025_REG_LDO1 52 -#define TWL6025_REG_LDO7 53 -#define TWL6025_REG_LDO6 54 -#define TWL6025_REG_LDOLN 55 -#define TWL6025_REG_LDOUSB 56 - -/* 6025 DCDC supplies */ -#define TWL6025_REG_SMPS3 57 -#define TWL6025_REG_SMPS4 58 -#define TWL6025_REG_VIO 59 - /* INTERNAL LDOs */ #define TWL6030_REG_VRTC 47 #define TWL6030_REG_CLK32KG 48 diff --git a/include/linux/interrupt_keys.h b/include/linux/interrupt_keys.h deleted file mode 100755 index 8be6e9a6b0a0..000000000000 --- a/include/linux/interrupt_keys.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * include/linux/interrupt_keys.h - * - * Key driver for keys directly connected to intrrupt lines. - * - * Copyright (c) 2011, NVIDIA Corporation. - * - * 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. - * - * 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. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef _INTERRUPT_KEYS_H -#define _INTERRUPT_KEYS_H - -struct interrupt_keys_button { - /* Configuration parameters */ - int code; /* input event code (KEY_*, SW_*) */ - int irq; - int active_low; - char *desc; - int type; /* input event type (EV_KEY, EV_SW) */ - int wakeup; /* configure the interrupt source as a wake-up - * source */ - int debounce_interval; /* debounce ticks interval in msecs */ - bool can_disable; -}; - -struct interrupt_keys_platform_data { - struct interrupt_keys_button *int_buttons; - int nbuttons; - unsigned int rep:1; /* enable input subsystem auto repeat */ - int (*enable)(struct device *dev); - void (*disable)(struct device *dev); -}; - -#endif diff --git a/include/linux/nct1008.h b/include/linux/nct1008.h index 0a517f1d6d89..9227f4ad82f4 100644 --- a/include/linux/nct1008.h +++ b/include/linux/nct1008.h @@ -31,6 +31,8 @@ struct nct1008_data; +enum nct1008_chip { NCT1008, NCT72 }; + struct nct1008_platform_data { bool supported_hwrev; bool ext_range; @@ -56,6 +58,7 @@ struct nct1008_data { u8 config; s8 *limits; u8 limits_sz; + enum nct1008_chip chip; void (*alarm_fn)(bool raised); struct regulator *nct_reg; long current_lo_limit; diff --git a/include/linux/nvhost.h b/include/linux/nvhost.h index da5e1e6862c6..82bb884dfbbd 100644 --- a/include/linux/nvhost.h +++ b/include/linux/nvhost.h @@ -32,6 +32,12 @@ struct nvhost_master; #define NVHOST_MODULE_MAX_POWERGATE_IDS 2 #define NVHOST_MODULE_NO_POWERGATE_IDS .powergate_ids = {-1, -1} #define NVHOST_DEFAULT_CLOCKGATE_DELAY .clockgate_delay = 25 +#define NVHOST_NAME_SIZE 24 + +struct nvhost_device_id { + char name[NVHOST_NAME_SIZE]; + unsigned long driver_data; +}; struct nvhost_clock { char *name; @@ -46,7 +52,11 @@ enum nvhost_device_powerstate_t { }; struct nvhost_device { - const char *name; /* Device name */ + /* device name: its format is of type - + * <name><ip-version>.<instance> + * e.g.: gr3d01 = gr3d ip version 01 used in tegra2 + * no instance number means hardware supports single instance */ + const char *name; struct device dev; /* Linux device struct */ int id; /* Separates clients of same hw */ int index; /* Hardware channel number */ @@ -64,6 +74,7 @@ struct nvhost_device { bool exclusive; /* True if only one user at a time */ bool keepalive; /* Do not power gate when opened */ bool waitbasesync; /* Force sync of wait bases */ + bool powerup_reset; /* Do a reset after power un-gating */ int powergate_ids[NVHOST_MODULE_MAX_POWERGATE_IDS]; bool can_powergate; /* True if module can be power gated */ @@ -81,24 +92,6 @@ struct nvhost_device { struct list_head client_list; /* List of clients and rate requests */ struct nvhost_channel *channel; /* Channel assigned for the module */ - - /* Allocates a context handler for the device */ - struct nvhost_hwctx_handler *(*alloc_hwctx_handler)(u32 syncpt, - u32 waitbase, struct nvhost_channel *ch); - /* Preparing for power off. Used for context save. */ - int (*prepare_poweroff)(struct nvhost_device *dev); - /* Finalize power on. Can be used for context restore. */ - void (*finalize_poweron)(struct nvhost_device *dev); - /* Device is busy. */ - void (*busy)(struct nvhost_device *); - /* Device is idle. */ - void (*idle)(struct nvhost_device *); - /* Device is going to be suspended */ - void (*suspend)(struct nvhost_device *); - /* Device is initialized */ - void (*init)(struct nvhost_device *dev); - /* Device is de-initialized. */ - void (*deinit)(struct nvhost_device *dev); }; /* Register device to nvhost bus */ @@ -110,12 +103,39 @@ extern void nvhost_device_unregister(struct nvhost_device *); extern struct bus_type nvhost_bus_type; struct nvhost_driver { - int (*probe)(struct nvhost_device *); + int (*probe)(struct nvhost_device *, struct nvhost_device_id *); int (*remove)(struct nvhost_device *); void (*shutdown)(struct nvhost_device *); int (*suspend)(struct nvhost_device *, pm_message_t state); int (*resume)(struct nvhost_device *); struct device_driver driver; + + struct nvhost_device_id *id_table; + + /* Finalize power on. Can be used for context restore. */ + void (*finalize_poweron)(struct nvhost_device *dev); + + /* Device is busy. */ + void (*busy)(struct nvhost_device *); + + /* Device is idle. */ + void (*idle)(struct nvhost_device *); + + /* Device is going to be suspended */ + void (*suspend_ndev)(struct nvhost_device *); + + /* Device is initialized */ + void (*init)(struct nvhost_device *dev); + + /* Device is de-initialized. */ + void (*deinit)(struct nvhost_device *dev); + + /* Preparing for power off. Used for context save. */ + int (*prepare_poweroff)(struct nvhost_device *dev); + + /* Allocates a context handler for the device */ + struct nvhost_hwctx_handler *(*alloc_hwctx_handler)(u32 syncpt, + u32 waitbase, struct nvhost_channel *ch); }; extern int nvhost_driver_register(struct nvhost_driver *); @@ -127,7 +147,7 @@ extern struct resource *nvhost_get_resource_byname(struct nvhost_device *, unsigned int, const char *); extern int nvhost_get_irq_byname(struct nvhost_device *, const char *); -#define to_nvhost_device(x) container_of((x), struct nvhost_device, dev) +#define to_nvhost_device(x) container_of((x), struct nvhost_device, dev) #define to_nvhost_driver(drv) (container_of((drv), struct nvhost_driver, \ driver)) diff --git a/include/linux/nvmap.h b/include/linux/nvmap.h new file mode 100644 index 000000000000..bea59694ad27 --- /dev/null +++ b/include/linux/nvmap.h @@ -0,0 +1,161 @@ +/* + * include/linux/nvmap.h + * + * structure declarations for nvmem and nvmap user-space ioctls + * + * Copyright (c) 2009-2012, NVIDIA Corporation. + * + * 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. + * + * 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. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include <linux/ioctl.h> +#include <linux/file.h> +#include <linux/rbtree.h> + +#if !defined(__KERNEL__) +#define __user +#endif + +#ifndef __NVMAP_H +#define __NVMAP_H + +#define NVMAP_HEAP_SYSMEM (1ul<<31) +#define NVMAP_HEAP_IOVMM (1ul<<30) + +/* common carveout heaps */ +#define NVMAP_HEAP_CARVEOUT_IRAM (1ul<<29) +#define NVMAP_HEAP_CARVEOUT_VPR (1ul<<28) +#define NVMAP_HEAP_CARVEOUT_GENERIC (1ul<<0) + +#define NVMAP_HEAP_CARVEOUT_MASK (NVMAP_HEAP_IOVMM - 1) + +/* allocation flags */ +#define NVMAP_HANDLE_UNCACHEABLE (0x0ul << 0) +#define NVMAP_HANDLE_WRITE_COMBINE (0x1ul << 0) +#define NVMAP_HANDLE_INNER_CACHEABLE (0x2ul << 0) +#define NVMAP_HANDLE_CACHEABLE (0x3ul << 0) +#define NVMAP_HANDLE_CACHE_FLAG (0x3ul << 0) + +#define NVMAP_HANDLE_SECURE (0x1ul << 2) + + +#if defined(__KERNEL__) + +#if defined(CONFIG_TEGRA_NVMAP) +struct nvmap_handle; +struct nvmap_client; +struct nvmap_device; +#define nvmap_ref_to_handle(_ref) (*(struct nvmap_handle **)(_ref)) +/* Convert User space handle to Kernel. */ +#define nvmap_convert_handle_u2k(h) (h) +#elif defined(CONFIG_ION_TEGRA) +/* For Ion Mem Manager support through nvmap_* API's. */ +#include "../../../../../drivers/gpu/ion/ion_priv.h" + +#define nvmap_client ion_client +#define nvmap_device ion_device +#define nvmap_handle ion_handle +#define nvmap_handle_ref ion_handle +#define nvmap_ref_to_handle(_ref) (struct ion_handle *)_ref +/* Convert User space handle to Kernel. */ +#define nvmap_convert_handle_u2k(h) ({ \ + if ((u32)h >= TASK_SIZE) { \ + pr_err("Invalid user space handle."); \ + BUG(); \ + } \ + (*((u32 *)h)); }) +#endif + +#define nvmap_id_to_handle(_id) ((struct nvmap_handle *)(_id)) + + +struct nvmap_pinarray_elem { + __u32 patch_mem; + __u32 patch_offset; + __u32 pin_mem; + __u32 pin_offset; + __u32 reloc_shift; +}; + +#if defined(CONFIG_TEGRA_NVMAP) +/* handle_ref objects are client-local references to an nvmap_handle; + * they are distinct objects so that handles can be unpinned and + * unreferenced the correct number of times when a client abnormally + * terminates */ +struct nvmap_handle_ref { + struct nvmap_handle *handle; + struct rb_node node; + atomic_t dupes; /* number of times to free on file close */ + atomic_t pin; /* number of times to unpin on free */ +}; +#endif + +struct nvmap_client *nvmap_create_client(struct nvmap_device *dev, + const char *name); + +struct nvmap_handle_ref *nvmap_alloc(struct nvmap_client *client, size_t size, + size_t align, unsigned int flags, + unsigned int heap_mask); + +void nvmap_free(struct nvmap_client *client, struct nvmap_handle_ref *r); + +void *nvmap_mmap(struct nvmap_handle_ref *r); + +void nvmap_munmap(struct nvmap_handle_ref *r, void *addr); + +struct nvmap_client *nvmap_client_get_file(int fd); + +struct nvmap_client *nvmap_client_get(struct nvmap_client *client); + +void nvmap_client_put(struct nvmap_client *c); + +phys_addr_t nvmap_pin(struct nvmap_client *c, struct nvmap_handle_ref *r); + +phys_addr_t nvmap_handle_address(struct nvmap_client *c, unsigned long id); + +void nvmap_unpin(struct nvmap_client *client, struct nvmap_handle_ref *r); + +int nvmap_pin_array(struct nvmap_client *client, struct nvmap_handle *gather, + const struct nvmap_pinarray_elem *arr, int nr, + struct nvmap_handle **unique); + +void nvmap_unpin_handles(struct nvmap_client *client, + struct nvmap_handle **h, int nr); + +int nvmap_patch_word(struct nvmap_client *client, + struct nvmap_handle *patch, + u32 patch_offset, u32 patch_value); + +struct nvmap_handle_ref *nvmap_duplicate_handle_id(struct nvmap_client *client, + unsigned long id); + +struct nvmap_platform_carveout { + const char *name; + unsigned int usage_mask; + phys_addr_t base; + size_t size; + size_t buddy_size; +}; + +struct nvmap_platform_data { + const struct nvmap_platform_carveout *carveouts; + unsigned int nr_carveouts; +}; + +extern struct nvmap_device *nvmap_dev; + +#endif + +#endif diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 27bb05aae70d..6e25b3c1fc39 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h @@ -146,6 +146,15 @@ static inline void platform_set_drvdata(struct platform_device *pdev, void *data dev_set_drvdata(&pdev->dev, data); } +/* module_platform_driver() - Helper macro for drivers that don't do + * anything special in module init/exit. This eliminates a lot of + * boilerplate. Each module may only use this macro once, and + * calling it replaces module_init() and module_exit() + */ +#define module_platform_driver(__platform_driver) \ + module_driver(__platform_driver, platform_driver_register, \ + platform_driver_unregister) + extern struct platform_device *platform_create_bundle(struct platform_driver *driver, int (*probe)(struct platform_device *), struct resource *res, unsigned int n_res, diff --git a/include/linux/regmap.h b/include/linux/regmap.h index 9fce3c8eb40c..6986d16aeca8 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h @@ -43,7 +43,13 @@ struct reg_default { /** * Configuration for the register map of a device. * + * @name: Optional name of the regmap. Useful when a device has multiple + * register regions. + * * @reg_bits: Number of bits in a register address, mandatory. + * @reg_stride: The register address stride. Valid register addresses are a + * multiple of this value. If set to 0, a value of 1 will be + * used. * @pad_bits: Number of bits of padding between register and value. * @val_bits: Number of bits in a register value, mandatory. * @@ -74,7 +80,10 @@ struct reg_default { * @num_reg_defaults_raw: Number of elements in reg_defaults_raw. */ struct regmap_config { + const char *name; + int reg_bits; + int reg_stride; int pad_bits; int val_bits; @@ -94,18 +103,21 @@ struct regmap_config { u8 write_flag_mask; }; -typedef int (*regmap_hw_write)(struct device *dev, const void *data, +typedef int (*regmap_hw_write)(void *context, const void *data, size_t count); -typedef int (*regmap_hw_gather_write)(struct device *dev, +typedef int (*regmap_hw_gather_write)(void *context, const void *reg, size_t reg_len, const void *val, size_t val_len); -typedef int (*regmap_hw_read)(struct device *dev, +typedef int (*regmap_hw_read)(void *context, const void *reg_buf, size_t reg_size, void *val_buf, size_t val_size); +typedef void (*regmap_hw_free_context)(void *context); /** * Description of a hardware bus for the register map infrastructure. * + * @fast_io: Register IO is fast. Use a spinlock instead of a mutex + * to perform locking. * @write: Write operation. * @gather_write: Write operation with split register/value, return -ENOTSUPP * if not implemented on a given device. @@ -115,27 +127,37 @@ typedef int (*regmap_hw_read)(struct device *dev, * a read. */ struct regmap_bus { + bool fast_io; regmap_hw_write write; regmap_hw_gather_write gather_write; regmap_hw_read read; + regmap_hw_free_context free_context; u8 read_flag_mask; }; struct regmap *regmap_init(struct device *dev, const struct regmap_bus *bus, + void *bus_context, const struct regmap_config *config); struct regmap *regmap_init_i2c(struct i2c_client *i2c, const struct regmap_config *config); struct regmap *regmap_init_spi(struct spi_device *dev, const struct regmap_config *config); +struct regmap *regmap_init_mmio(struct device *dev, + void __iomem *regs, + const struct regmap_config *config); struct regmap *devm_regmap_init(struct device *dev, const struct regmap_bus *bus, + void *bus_context, const struct regmap_config *config); struct regmap *devm_regmap_init_i2c(struct i2c_client *i2c, const struct regmap_config *config); struct regmap *devm_regmap_init_spi(struct spi_device *dev, const struct regmap_config *config); +struct regmap *devm_regmap_init_mmio(struct device *dev, + void __iomem *regs, + const struct regmap_config *config); void regmap_exit(struct regmap *map); int regmap_reinit_cache(struct regmap *map, @@ -157,8 +179,11 @@ int regmap_update_bits_lazy(struct regmap *map, unsigned int reg, int regmap_update_bits_check(struct regmap *map, unsigned int reg, unsigned int mask, unsigned int val, bool *change); +int regmap_get_val_bytes(struct regmap *map); int regcache_sync(struct regmap *map); +int regcache_sync_region(struct regmap *map, unsigned int min, + unsigned int max); void regcache_cache_only(struct regmap *map, bool enable); void regcache_cache_bypass(struct regmap *map, bool enable); void regcache_mark_dirty(struct regmap *map); diff --git a/include/linux/regulator/gpio-switch-regulator.h b/include/linux/regulator/gpio-switch-regulator.h deleted file mode 100644 index 68776b93ef00..000000000000 --- a/include/linux/regulator/gpio-switch-regulator.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2011, NVIDIA Corporation. - * - * 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. - * - * 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. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -#ifndef _GPIO_SWITCH_REGULATOR_H -#define _GPIO_SWITCH_REGULATOR_H - -#include <linux/regulator/machine.h> - -/* - * struct gpio_switch_regulator_subdev_data - Gpio switch regulator subdevice - * data. - * - * Subdevice data to register a gpio regulator switch device driver. - * - * @regulator_name: The name of regulator. - * @input_supply: Input supply name. - * @id: The id of the switch. - * @gpio_nr: Gpio nr which controls this switch. - * @active_low: true if making gpio low makes voltage output enable. - * @init_state: 1 if init_state should be active. - * @voltages: Possible voltages to set at output. The values are in millivolt. - * @n_voltages: Number of voltages. - * @num_consumer_supplies: Number of cosumer supplies. - * @consumer_supplies: List of consumer spllies. - */ -struct gpio_switch_regulator_subdev_data { - const char *regulator_name; - const char *input_supply; - int id; - int gpio_nr; - int active_low; - int pin_group; - int init_state; - int *voltages; - unsigned n_voltages; - struct regulator_consumer_supply *consumer_supplies; - int num_consumer_supplies; - struct regulation_constraints constraints; - int (*enable_rail)(struct gpio_switch_regulator_subdev_data *pdata); - int (*disable_rail)(struct gpio_switch_regulator_subdev_data *pdata); - -}; - -/** - * gpio_switch_regulator_platform_data - platform data for gpio_switch_regulator - * @num_subdevs: number of regulators used - * @subdevs: pointer to regulators used - */ -struct gpio_switch_regulator_platform_data { - int num_subdevs; - struct gpio_switch_regulator_subdev_data **subdevs; -}; - -#endif diff --git a/include/linux/regulator/max8973-regulator.h b/include/linux/regulator/max8973-regulator.h new file mode 100644 index 000000000000..4b86e88b028e --- /dev/null +++ b/include/linux/regulator/max8973-regulator.h @@ -0,0 +1,77 @@ +/* + * max8973-regulator.h -- MAXIM 8973 regulator + * + * Interface for regulator driver for MAXIM 8973 DC-DC step-down + * switching regulator. + * + * Copyright (C) 2012 NVIDIA Corporation + + * Author: Laxman Dewangan <ldewangan@nvidia.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. + * + * 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. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef __LINUX_REGULATOR_MAX8973_H +#define __LINUX_REGULATOR_MAX8973_H + +/* + * Control flags for configuration of the device. + * Client need to pass this information with ORed + */ +#define MAX8973_CONTROL_REMOTE_SENSE_ENABLE 0x00000001 +#define MAX8973_CONTROL_FALLING_SLEW_RATE_ENABLE 0x00000002 +#define MAX8973_CONTROL_OUTPUT_ACTIVE_DISCH_ENABLE 0x00000004 +#define MAX8973_CONTROL_BIAS_ENABLE 0x00000008 +#define MAX8973_CONTROL_PULL_DOWN_ENABLE 0x00000010 +#define MAX8973_CONTROL_FREQ_SHIFT_9PER_ENABLE 0x00000020 + +#define MAX8973_CONTROL_SLEW_RATE_12_5mV_PER_US 0x00000000 +#define MAX8973_CONTROL_SLEW_RATE_25mV_PER_US 0x00000100 +#define MAX8973_CONTROL_SLEW_RATE_50mV_PER_US 0x00000200 +#define MAX8973_CONTROL_SLEW_RATE_200MV_PER_US 0x00000300 + +#define MAX8973_CONTROL_CLKADV_TRIP_DISABLED 0x00000000 +#define MAX8973_CONTROL_CLKADV_TRIP_75mV_PER_US 0x00010000 +#define MAX8973_CONTROL_CLKADV_TRIP_150mV_PER_US 0x00020000 +#define MAX8973_CONTROL_CLKADV_TRIP_75mV_PER_US_HIST_DIS 0x00030000 + +#define MAX8973_CONTROL_INDUCTOR_VALUE_NOMINAL 0x00000000 +#define MAX8973_CONTROL_INDUCTOR_VALUE_MINUS_30_PER 0x00100000 +#define MAX8973_CONTROL_INDUCTOR_VALUE_PLUS_30_PER 0x00200000 +#define MAX8973_CONTROL_INDUCTOR_VALUE_PLUS_60_PER 0x00300000 + +/* + * struct max8973_regulator_platform_data - max8973 regulator platform data. + * + * @reg_init_data: The regulator init data. + * @control_flags: Control flags which are ORed value of above flags to + * configure device. + * @enable_ext_control: Enable the voltage enable/disable through external + * control signal from EN input pin. If it is false then + * voltage output will be enabled/disabled through EN bit of + * device register. + * @dvs_gpio: GPIO for dvs. It should be -1 if this is tied with fixed logic. + * @dvs_def_state: Default state of dvs. 1 if it is high else 0. + */ +struct max8973_regulator_platform_data { + struct regulator_init_data *reg_init_data; + unsigned long control_flags; + bool enable_ext_control; + int dvs_gpio; + unsigned dvs_def_state:1; +}; + +#endif /* __LINUX_REGULATOR_MAX8973_H */ diff --git a/include/linux/regulator/tps6238x0-regulator.h b/include/linux/regulator/tps6238x0-regulator.h new file mode 100644 index 000000000000..d7c4edc5b101 --- /dev/null +++ b/include/linux/regulator/tps6238x0-regulator.h @@ -0,0 +1,46 @@ +/* + * tps6238x0-regulator.h -- TI TPS623850/TPS623860/TPS623870 + * + * Interface for regulator driver for TI TPS623850/TPS623860/TPS623870 + * Processor core supply + * + * Copyright (C) 2012 NVIDIA Corporation + + * Author: Laxman Dewangan <ldewangan@nvidia.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. + * + * 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. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef __LINUX_REGULATOR_TPS6238X0_H +#define __LINUX_REGULATOR_TPS6238X0_H + +/* + * struct tps6238x0_regulator_platform_data - tps62360 regulator platform data. + * + * @init_data: The regulator init data. + * @en_internal_pulldn: internal pull down enable or not. + * @vsel_gpio: Gpio number for vsel. It should be -1 if this is tied with + * fixed logic. + * @vsel_def_state: Default state of vsel. 1 if it is high else 0. + */ +struct tps6238x0_regulator_platform_data { + struct regulator_init_data *init_data; + bool en_internal_pulldn; + int vsel_gpio; + int vsel_def_state; +}; + +#endif /* __LINUX_REGULATOR_TPS6238X0_H */ diff --git a/include/linux/smb349-charger.h b/include/linux/smb349-charger.h index 6dbec61034ed..089f3976dbbe 100644 --- a/include/linux/smb349-charger.h +++ b/include/linux/smb349-charger.h @@ -26,6 +26,7 @@ #include <linux/regulator/machine.h> #include <linux/platform_device.h> #include <linux/regulator/driver.h> +#include <linux/usb/otg.h> struct smb349_charger_platform_data { int regulator_id; @@ -44,6 +45,7 @@ enum charging_states { }; enum charger_type { + NONE, AC, USB, }; diff --git a/include/linux/tegra_audio.h b/include/linux/tegra_audio.h index 904dde998fc4..3975913a5206 100644 --- a/include/linux/tegra_audio.h +++ b/include/linux/tegra_audio.h @@ -78,7 +78,7 @@ struct dam_srate { #ifdef CONFIG_SND_SOC_TEGRA extern bool tegra_is_voice_call_active(); #else -inline bool tegra_is_voice_call_active() +static inline bool tegra_is_voice_call_active() { return false; } diff --git a/include/linux/wl12xx.h b/include/linux/wl12xx.h index 0f559ae411c8..c13dc0c0f4c3 100644 --- a/include/linux/wl12xx.h +++ b/include/linux/wl12xx.h @@ -48,8 +48,8 @@ enum { }; struct wl12xx_platform_data { - void (*set_power)(bool enable); - void (*set_carddetect)(bool enable); + int (*set_power)(int power_on); + int (*set_carddetect)(int val); /* SDIO only: IRQ number if WLAN_IRQ line is used, 0 for SDIO IRQs */ int irq; bool use_eeprom; |