diff options
Diffstat (limited to 'include/linux/platform_data')
| -rw-r--r-- | include/linux/platform_data/ad5449.h | 40 | ||||
| -rw-r--r-- | include/linux/platform_data/ad7298.h | 20 | ||||
| -rw-r--r-- | include/linux/platform_data/ad7793.h | 112 | ||||
| -rw-r--r-- | include/linux/platform_data/ad7887.h | 26 | ||||
| -rw-r--r-- | include/linux/platform_data/ads7828.h | 29 | ||||
| -rw-r--r-- | include/linux/platform_data/atmel.h | 73 | ||||
| -rw-r--r-- | include/linux/platform_data/clk-integrator.h | 2 | ||||
| -rw-r--r-- | include/linux/platform_data/db8500_thermal.h | 38 | ||||
| -rw-r--r-- | include/linux/platform_data/gpio-ts5500.h | 27 | ||||
| -rw-r--r-- | include/linux/platform_data/mmc-omap.h | 7 | ||||
| -rw-r--r-- | include/linux/platform_data/omap_drm.h | 1 | ||||
| -rw-r--r-- | include/linux/platform_data/pinctrl-coh901.h | 4 | ||||
| -rw-r--r-- | include/linux/platform_data/pinctrl-nomadik.h | 266 | ||||
| -rw-r--r-- | include/linux/platform_data/pxa2xx_udc.h | 27 | ||||
| -rw-r--r-- | include/linux/platform_data/pxa_sdhci.h | 6 | ||||
| -rw-r--r-- | include/linux/platform_data/sa11x0-serial.h | 33 | ||||
| -rw-r--r-- | include/linux/platform_data/uio_dmem_genirq.h | 26 | 
17 files changed, 728 insertions, 9 deletions
diff --git a/include/linux/platform_data/ad5449.h b/include/linux/platform_data/ad5449.h new file mode 100644 index 00000000000..bd712bd4b94 --- /dev/null +++ b/include/linux/platform_data/ad5449.h @@ -0,0 +1,40 @@ +/* + * AD5415, AD5426, AD5429, AD5432, AD5439, AD5443, AD5449 Digital to Analog + * Converter driver. + * + * Copyright 2012 Analog Devices Inc. + *  Author: Lars-Peter Clausen <lars@metafoo.de> + * + * Licensed under the GPL-2. + */ + +#ifndef __LINUX_PLATFORM_DATA_AD5449_H__ +#define __LINUX_PLATFORM_DATA_AD5449_H__ + +/** + * enum ad5449_sdo_mode - AD5449 SDO pin configuration + * @AD5449_SDO_DRIVE_FULL: Drive the SDO pin with full strength. + * @AD5449_SDO_DRIVE_WEAK: Drive the SDO pin with not full strength. + * @AD5449_SDO_OPEN_DRAIN: Operate the SDO pin in open-drain mode. + * @AD5449_SDO_DISABLED: Disable the SDO pin, in this mode it is not possible to + *			read back from the device. + */ +enum ad5449_sdo_mode { +	AD5449_SDO_DRIVE_FULL = 0x0, +	AD5449_SDO_DRIVE_WEAK = 0x1, +	AD5449_SDO_OPEN_DRAIN = 0x2, +	AD5449_SDO_DISABLED = 0x3, +}; + +/** + * struct ad5449_platform_data - Platform data for the ad5449 DAC driver + * @sdo_mode: SDO pin mode + * @hardware_clear_to_midscale: Whether asserting the hardware CLR pin sets the + *			outputs to midscale (true) or to zero scale(false). + */ +struct ad5449_platform_data { +	enum ad5449_sdo_mode sdo_mode; +	bool hardware_clear_to_midscale; +}; + +#endif diff --git a/include/linux/platform_data/ad7298.h b/include/linux/platform_data/ad7298.h new file mode 100644 index 00000000000..fbf8adf1363 --- /dev/null +++ b/include/linux/platform_data/ad7298.h @@ -0,0 +1,20 @@ +/* + * AD7298 SPI ADC driver + * + * Copyright 2011 Analog Devices Inc. + * + * Licensed under the GPL-2. + */ + +#ifndef __LINUX_PLATFORM_DATA_AD7298_H__ +#define __LINUX_PLATFORM_DATA_AD7298_H__ + +/** + * struct ad7298_platform_data - Platform data for the ad7298 ADC driver + * @ext_ref: Whether to use an external reference voltage. + **/ +struct ad7298_platform_data { +	bool ext_ref; +}; + +#endif /* IIO_ADC_AD7298_H_ */ diff --git a/include/linux/platform_data/ad7793.h b/include/linux/platform_data/ad7793.h new file mode 100644 index 00000000000..7ea6751aae6 --- /dev/null +++ b/include/linux/platform_data/ad7793.h @@ -0,0 +1,112 @@ +/* + * AD7792/AD7793 SPI ADC driver + * + * Copyright 2011 Analog Devices Inc. + * + * Licensed under the GPL-2. + */ +#ifndef __LINUX_PLATFORM_DATA_AD7793_H__ +#define __LINUX_PLATFORM_DATA_AD7793_H__ + +/** + * enum ad7793_clock_source - AD7793 clock source selection + * @AD7793_CLK_SRC_INT: Internal 64 kHz clock, not available at the CLK pin. + * @AD7793_CLK_SRC_INT_CO: Internal 64 kHz clock, available at the CLK pin. + * @AD7793_CLK_SRC_EXT: Use external clock. + * @AD7793_CLK_SRC_EXT_DIV2: Use external clock divided by 2. + */ +enum ad7793_clock_source { +	AD7793_CLK_SRC_INT, +	AD7793_CLK_SRC_INT_CO, +	AD7793_CLK_SRC_EXT, +	AD7793_CLK_SRC_EXT_DIV2, +}; + +/** + * enum ad7793_bias_voltage - AD7793 bias voltage selection + * @AD7793_BIAS_VOLTAGE_DISABLED: Bias voltage generator disabled + * @AD7793_BIAS_VOLTAGE_AIN1: Bias voltage connected to AIN1(-). + * @AD7793_BIAS_VOLTAGE_AIN2: Bias voltage connected to AIN2(-). + * @AD7793_BIAS_VOLTAGE_AIN3: Bias voltage connected to AIN3(-). + *	Only valid for AD7795/AD7796. + */ +enum ad7793_bias_voltage { +	AD7793_BIAS_VOLTAGE_DISABLED, +	AD7793_BIAS_VOLTAGE_AIN1, +	AD7793_BIAS_VOLTAGE_AIN2, +	AD7793_BIAS_VOLTAGE_AIN3, +}; + +/** + * enum ad7793_refsel - AD7793 reference voltage selection + * @AD7793_REFSEL_REFIN1: External reference applied between REFIN1(+) + *	and REFIN1(-). + * @AD7793_REFSEL_REFIN2: External reference applied between REFIN2(+) and + *	and REFIN1(-). Only valid for AD7795/AD7796. + * @AD7793_REFSEL_INTERNAL: Internal 1.17 V reference. + */ +enum ad7793_refsel { +	AD7793_REFSEL_REFIN1 = 0, +	AD7793_REFSEL_REFIN2 = 1, +	AD7793_REFSEL_INTERNAL = 2, +}; + +/** + * enum ad7793_current_source_direction - AD7793 excitation current direction + * @AD7793_IEXEC1_IOUT1_IEXEC2_IOUT2: Current source IEXC1 connected to pin + *	IOUT1, current source IEXC2 connected to pin IOUT2. + * @AD7793_IEXEC1_IOUT2_IEXEC2_IOUT1: Current source IEXC2 connected to pin + *	IOUT1, current source IEXC1 connected to pin IOUT2. + * @AD7793_IEXEC1_IEXEC2_IOUT1: Both current sources connected to pin IOUT1. + *	Only valid when the current sources are set to 10 uA or 210 uA. + * @AD7793_IEXEC1_IEXEC2_IOUT2: Both current sources connected to Pin IOUT2. + *	Only valid when the current ources are set to 10 uA or 210 uA. + */ +enum ad7793_current_source_direction { +	AD7793_IEXEC1_IOUT1_IEXEC2_IOUT2 = 0, +	AD7793_IEXEC1_IOUT2_IEXEC2_IOUT1 = 1, +	AD7793_IEXEC1_IEXEC2_IOUT1 = 2, +	AD7793_IEXEC1_IEXEC2_IOUT2 = 3, +}; + +/** + * enum ad7793_excitation_current - AD7793 excitation current selection + * @AD7793_IX_DISABLED: Excitation current Disabled. + * @AD7793_IX_10uA: Enable 10 micro-ampere excitation current. + * @AD7793_IX_210uA: Enable 210 micro-ampere excitation current. + * @AD7793_IX_1mA: Enable 1 milli-Ampere excitation current. + */ +enum ad7793_excitation_current { +	AD7793_IX_DISABLED = 0, +	AD7793_IX_10uA = 1, +	AD7793_IX_210uA = 2, +	AD7793_IX_1mA = 3, +}; + +/** + * struct ad7793_platform_data - AD7793 platform data + * @clock_src: Clock source selection + * @burnout_current: If set to true the 100nA burnout current is enabled. + * @boost_enable: Enable boost for the bias voltage generator. + * @buffered: If set to true configure the device for buffered input mode. + * @unipolar: If set to true sample in unipolar mode, if set to false sample in + *		bipolar mode. + * @refsel: Reference voltage selection + * @bias_voltage: Bias voltage selection + * @exitation_current: Excitation current selection + * @current_source_direction: Excitation current direction selection + */ +struct ad7793_platform_data { +	enum ad7793_clock_source clock_src; +	bool burnout_current; +	bool boost_enable; +	bool buffered; +	bool unipolar; + +	enum ad7793_refsel refsel; +	enum ad7793_bias_voltage bias_voltage; +	enum ad7793_excitation_current exitation_current; +	enum ad7793_current_source_direction current_source_direction; +}; + +#endif /* IIO_ADC_AD7793_H_ */ diff --git a/include/linux/platform_data/ad7887.h b/include/linux/platform_data/ad7887.h new file mode 100644 index 00000000000..1e06eac3174 --- /dev/null +++ b/include/linux/platform_data/ad7887.h @@ -0,0 +1,26 @@ +/* + * AD7887 SPI ADC driver + * + * Copyright 2010 Analog Devices Inc. + * + * Licensed under the GPL-2 or later. + */ +#ifndef IIO_ADC_AD7887_H_ +#define IIO_ADC_AD7887_H_ + +/** + * struct ad7887_platform_data - AD7887 ADC driver platform data + * @en_dual: Whether to use dual channel mode. If set to true AIN1 becomes the + *	second input channel, and Vref is internally connected to Vdd. If set to + *	false the device is used in single channel mode and AIN1/Vref is used as + *	VREF input. + * @use_onchip_ref: Whether to use the onchip reference. If set to true the + *	internal 2.5V reference is used. If set to false a external reference is + *	used. + */ +struct ad7887_platform_data { +	bool en_dual; +	bool use_onchip_ref; +}; + +#endif /* IIO_ADC_AD7887_H_ */ diff --git a/include/linux/platform_data/ads7828.h b/include/linux/platform_data/ads7828.h new file mode 100644 index 00000000000..3245f45f9d7 --- /dev/null +++ b/include/linux/platform_data/ads7828.h @@ -0,0 +1,29 @@ +/* + * TI ADS7828 A/D Converter platform data definition + * + * Copyright (c) 2012 Savoir-faire Linux Inc. + *          Vivien Didelot <vivien.didelot@savoirfairelinux.com> + * + * For further information, see the Documentation/hwmon/ads7828 file. + * + * 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 _PDATA_ADS7828_H +#define _PDATA_ADS7828_H + +/** + * struct ads7828_platform_data - optional ADS7828 connectivity info + * @diff_input:		Differential input mode. + * @ext_vref:		Use an external voltage reference. + * @vref_mv:		Voltage reference value, if external. + */ +struct ads7828_platform_data { +	bool diff_input; +	bool ext_vref; +	unsigned int vref_mv; +}; + +#endif /* _PDATA_ADS7828_H */ diff --git a/include/linux/platform_data/atmel.h b/include/linux/platform_data/atmel.h index b0f2c56a8ea..6a293b7fff3 100644 --- a/include/linux/platform_data/atmel.h +++ b/include/linux/platform_data/atmel.h @@ -8,6 +8,55 @@  #define __ATMEL_H__  #include <linux/mtd/nand.h> +#include <linux/mtd/partitions.h> +#include <linux/device.h> +#include <linux/i2c.h> +#include <linux/leds.h> +#include <linux/spi/spi.h> +#include <linux/usb/atmel_usba_udc.h> +#include <linux/atmel-mci.h> +#include <sound/atmel-ac97c.h> +#include <linux/serial.h> +#include <linux/platform_data/macb.h> + +/* + * at91: 6 USARTs and one DBGU port (SAM9260) + * avr32: 4 + */ +#define ATMEL_MAX_UART	7 + + /* USB Device */ +struct at91_udc_data { +	int	vbus_pin;		/* high == host powering us */ +	u8	vbus_active_low;	/* vbus polarity */ +	u8	vbus_polled;		/* Use polling, not interrupt */ +	int	pullup_pin;		/* active == D+ pulled up */ +	u8	pullup_active_low;	/* true == pullup_pin is active low */ +}; + + /* Compact Flash */ +struct at91_cf_data { +	int	irq_pin;		/* I/O IRQ */ +	int	det_pin;		/* Card detect */ +	int	vcc_pin;		/* power switching */ +	int	rst_pin;		/* card reset */ +	u8	chipselect;		/* EBI Chip Select number */ +	u8	flags; +#define AT91_CF_TRUE_IDE	0x01 +#define AT91_IDE_SWAP_A0_A2	0x02 +}; + + /* USB Host */ +#define AT91_MAX_USBH_PORTS	3 +struct at91_usbh_data { +	int		vbus_pin[AT91_MAX_USBH_PORTS];	/* port power-control pin */ +	int             overcurrent_pin[AT91_MAX_USBH_PORTS]; +	u8		ports;				/* number of ports on root hub */ +	u8              overcurrent_supported; +	u8              vbus_pin_active_low[AT91_MAX_USBH_PORTS]; +	u8              overcurrent_status[AT91_MAX_USBH_PORTS]; +	u8              overcurrent_changed[AT91_MAX_USBH_PORTS]; +};   /* NAND / SmartMedia */  struct atmel_nand_data { @@ -24,4 +73,28 @@ struct atmel_nand_data {  	unsigned int	num_parts;  }; + /* Serial */ +struct atmel_uart_data { +	int			num;		/* port num */ +	short			use_dma_tx;	/* use transmit DMA? */ +	short			use_dma_rx;	/* use receive DMA? */ +	void __iomem		*regs;		/* virt. base address, if any */ +	struct serial_rs485	rs485;		/* rs485 settings */ +}; + + /* Touchscreen Controller */ +struct at91_tsadcc_data { +	unsigned int    adc_clock; +	u8		pendet_debounce; +	u8		ts_sample_hold_time; +}; + +/* CAN */ +struct at91_can_data { +	void (*transceiver_switch)(int on); +}; + +/* FIXME: this needs a better location, but gets stuff building again */ +extern int at91_suspend_entering_slow_clock(void); +  #endif /* __ATMEL_H__ */ diff --git a/include/linux/platform_data/clk-integrator.h b/include/linux/platform_data/clk-integrator.h index 83fe9c283bb..280edac9d0a 100644 --- a/include/linux/platform_data/clk-integrator.h +++ b/include/linux/platform_data/clk-integrator.h @@ -1 +1,3 @@  void integrator_clk_init(bool is_cp); +void integrator_impd1_clk_init(void __iomem *base, unsigned int id); +void integrator_impd1_clk_exit(unsigned int id); diff --git a/include/linux/platform_data/db8500_thermal.h b/include/linux/platform_data/db8500_thermal.h new file mode 100644 index 00000000000..3bf60902e90 --- /dev/null +++ b/include/linux/platform_data/db8500_thermal.h @@ -0,0 +1,38 @@ +/* + * db8500_thermal.h - DB8500 Thermal Management Implementation + * + * Copyright (C) 2012 ST-Ericsson + * Copyright (C) 2012 Linaro Ltd. + * + * Author: Hongbo Zhang <hongbo.zhang@linaro.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. + */ + +#ifndef _DB8500_THERMAL_H_ +#define _DB8500_THERMAL_H_ + +#include <linux/thermal.h> + +#define COOLING_DEV_MAX 8 + +struct db8500_trip_point { +	unsigned long temp; +	enum thermal_trip_type type; +	char cdev_name[COOLING_DEV_MAX][THERMAL_NAME_LENGTH]; +}; + +struct db8500_thsens_platform_data { +	struct db8500_trip_point trip_points[THERMAL_MAX_TRIPS]; +	int num_trips; +}; + +#endif /* _DB8500_THERMAL_H_ */ diff --git a/include/linux/platform_data/gpio-ts5500.h b/include/linux/platform_data/gpio-ts5500.h new file mode 100644 index 00000000000..b10d11c9bb4 --- /dev/null +++ b/include/linux/platform_data/gpio-ts5500.h @@ -0,0 +1,27 @@ +/* + * GPIO (DIO) header for Technologic Systems TS-5500 + * + * Copyright (c) 2012 Savoir-faire Linux Inc. + *	Vivien Didelot <vivien.didelot@savoirfairelinux.com> + * + * 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 _PDATA_GPIO_TS5500_H +#define _PDATA_GPIO_TS5500_H + +/** + * struct ts5500_dio_platform_data - TS-5500 pin block configuration + * @base:	The GPIO base number to use. + * @strap:	The only pin connected to an interrupt in a block is input-only. + *		If you need a bidirectional line which can trigger an IRQ, you + *		may strap it with an in/out pin. This flag indicates this case. + */ +struct ts5500_dio_platform_data { +	int base; +	bool strap; +}; + +#endif /* _PDATA_GPIO_TS5500_H */ diff --git a/include/linux/platform_data/mmc-omap.h b/include/linux/platform_data/mmc-omap.h index 2bf6ea82ff9..2bf1b30cb5d 100644 --- a/include/linux/platform_data/mmc-omap.h +++ b/include/linux/platform_data/mmc-omap.h @@ -107,9 +107,10 @@ struct omap_mmc_platform_data {  		/* we can put the features above into this variable */  #define HSMMC_HAS_PBIAS		(1 << 0)  #define HSMMC_HAS_UPDATED_RESET	(1 << 1) -#define MMC_OMAP7XX		(1 << 2) -#define MMC_OMAP15XX		(1 << 3) -#define MMC_OMAP16XX		(1 << 4) +#define HSMMC_HAS_HSPE_SUPPORT	(1 << 2) +#define MMC_OMAP7XX		(1 << 3) +#define MMC_OMAP15XX		(1 << 4) +#define MMC_OMAP16XX		(1 << 5)  		unsigned features;  		int switch_pin;			/* gpio (card detect) */ diff --git a/include/linux/platform_data/omap_drm.h b/include/linux/platform_data/omap_drm.h index 3da73bdc203..f4e4a237ebd 100644 --- a/include/linux/platform_data/omap_drm.h +++ b/include/linux/platform_data/omap_drm.h @@ -46,6 +46,7 @@ struct omap_kms_platform_data {  };  struct omap_drm_platform_data { +	uint32_t omaprev;  	struct omap_kms_platform_data *kms_pdata;  }; diff --git a/include/linux/platform_data/pinctrl-coh901.h b/include/linux/platform_data/pinctrl-coh901.h index 30dea251b83..dfbc65d1048 100644 --- a/include/linux/platform_data/pinctrl-coh901.h +++ b/include/linux/platform_data/pinctrl-coh901.h @@ -13,14 +13,10 @@   * struct u300_gpio_platform - U300 GPIO platform data   * @ports: number of GPIO block ports   * @gpio_base: first GPIO number for this block (use a free range) - * @gpio_irq_base: first GPIO IRQ number for this block (use a free range) - * @pinctrl_device: pin control device to spawn as child   */  struct u300_gpio_platform {  	u8 ports;  	int gpio_base; -	int gpio_irq_base; -	struct platform_device *pinctrl_device;  };  #endif /* __MACH_U300_GPIO_U300_H */ diff --git a/include/linux/platform_data/pinctrl-nomadik.h b/include/linux/platform_data/pinctrl-nomadik.h new file mode 100644 index 00000000000..f73b2f0c55b --- /dev/null +++ b/include/linux/platform_data/pinctrl-nomadik.h @@ -0,0 +1,266 @@ +/* + * Structures and registers for GPIO access in the Nomadik SoC + * + * Copyright (C) 2008 STMicroelectronics + *     Author: Prafulla WADASKAR <prafulla.wadaskar@st.com> + * Copyright (C) 2009 Alessandro Rubini <rubini@unipv.it> + * + * 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 __PLAT_NOMADIK_GPIO +#define __PLAT_NOMADIK_GPIO + +/* + * pin configurations are represented by 32-bit integers: + * + *	bit  0.. 8 - Pin Number (512 Pins Maximum) + *	bit  9..10 - Alternate Function Selection + *	bit 11..12 - Pull up/down state + *	bit     13 - Sleep mode behaviour + *	bit     14 - Direction + *	bit     15 - Value (if output) + *	bit 16..18 - SLPM pull up/down state + *	bit 19..20 - SLPM direction + *	bit 21..22 - SLPM Value (if output) + *	bit 23..25 - PDIS value (if input) + *	bit	26 - Gpio mode + *	bit	27 - Sleep mode + * + * to facilitate the definition, the following macros are provided + * + * PIN_CFG_DEFAULT - default config (0): + *		     pull up/down = disabled + *		     sleep mode = input/wakeup + *		     direction = input + *		     value = low + *		     SLPM direction = same as normal + *		     SLPM pull = same as normal + *		     SLPM value = same as normal + * + * PIN_CFG	   - default config with alternate function + */ + +typedef unsigned long pin_cfg_t; + +#define PIN_NUM_MASK		0x1ff +#define PIN_NUM(x)		((x) & PIN_NUM_MASK) + +#define PIN_ALT_SHIFT		9 +#define PIN_ALT_MASK		(0x3 << PIN_ALT_SHIFT) +#define PIN_ALT(x)		(((x) & PIN_ALT_MASK) >> PIN_ALT_SHIFT) +#define PIN_GPIO		(NMK_GPIO_ALT_GPIO << PIN_ALT_SHIFT) +#define PIN_ALT_A		(NMK_GPIO_ALT_A << PIN_ALT_SHIFT) +#define PIN_ALT_B		(NMK_GPIO_ALT_B << PIN_ALT_SHIFT) +#define PIN_ALT_C		(NMK_GPIO_ALT_C << PIN_ALT_SHIFT) + +#define PIN_PULL_SHIFT		11 +#define PIN_PULL_MASK		(0x3 << PIN_PULL_SHIFT) +#define PIN_PULL(x)		(((x) & PIN_PULL_MASK) >> PIN_PULL_SHIFT) +#define PIN_PULL_NONE		(NMK_GPIO_PULL_NONE << PIN_PULL_SHIFT) +#define PIN_PULL_UP		(NMK_GPIO_PULL_UP << PIN_PULL_SHIFT) +#define PIN_PULL_DOWN		(NMK_GPIO_PULL_DOWN << PIN_PULL_SHIFT) + +#define PIN_SLPM_SHIFT		13 +#define PIN_SLPM_MASK		(0x1 << PIN_SLPM_SHIFT) +#define PIN_SLPM(x)		(((x) & PIN_SLPM_MASK) >> PIN_SLPM_SHIFT) +#define PIN_SLPM_MAKE_INPUT	(NMK_GPIO_SLPM_INPUT << PIN_SLPM_SHIFT) +#define PIN_SLPM_NOCHANGE	(NMK_GPIO_SLPM_NOCHANGE << PIN_SLPM_SHIFT) +/* These two replace the above in DB8500v2+ */ +#define PIN_SLPM_WAKEUP_ENABLE	(NMK_GPIO_SLPM_WAKEUP_ENABLE << PIN_SLPM_SHIFT) +#define PIN_SLPM_WAKEUP_DISABLE	(NMK_GPIO_SLPM_WAKEUP_DISABLE << PIN_SLPM_SHIFT) +#define PIN_SLPM_USE_MUX_SETTINGS_IN_SLEEP PIN_SLPM_WAKEUP_DISABLE + +#define PIN_SLPM_GPIO  PIN_SLPM_WAKEUP_ENABLE /* In SLPM, pin is a gpio */ +#define PIN_SLPM_ALTFUNC PIN_SLPM_WAKEUP_DISABLE /* In SLPM, pin is altfunc */ + +#define PIN_DIR_SHIFT		14 +#define PIN_DIR_MASK		(0x1 << PIN_DIR_SHIFT) +#define PIN_DIR(x)		(((x) & PIN_DIR_MASK) >> PIN_DIR_SHIFT) +#define PIN_DIR_INPUT		(0 << PIN_DIR_SHIFT) +#define PIN_DIR_OUTPUT		(1 << PIN_DIR_SHIFT) + +#define PIN_VAL_SHIFT		15 +#define PIN_VAL_MASK		(0x1 << PIN_VAL_SHIFT) +#define PIN_VAL(x)		(((x) & PIN_VAL_MASK) >> PIN_VAL_SHIFT) +#define PIN_VAL_LOW		(0 << PIN_VAL_SHIFT) +#define PIN_VAL_HIGH		(1 << PIN_VAL_SHIFT) + +#define PIN_SLPM_PULL_SHIFT	16 +#define PIN_SLPM_PULL_MASK	(0x7 << PIN_SLPM_PULL_SHIFT) +#define PIN_SLPM_PULL(x)	\ +	(((x) & PIN_SLPM_PULL_MASK) >> PIN_SLPM_PULL_SHIFT) +#define PIN_SLPM_PULL_NONE	\ +	((1 + NMK_GPIO_PULL_NONE) << PIN_SLPM_PULL_SHIFT) +#define PIN_SLPM_PULL_UP	\ +	((1 + NMK_GPIO_PULL_UP) << PIN_SLPM_PULL_SHIFT) +#define PIN_SLPM_PULL_DOWN	\ +	((1 + NMK_GPIO_PULL_DOWN) << PIN_SLPM_PULL_SHIFT) + +#define PIN_SLPM_DIR_SHIFT	19 +#define PIN_SLPM_DIR_MASK	(0x3 << PIN_SLPM_DIR_SHIFT) +#define PIN_SLPM_DIR(x)		\ +	(((x) & PIN_SLPM_DIR_MASK) >> PIN_SLPM_DIR_SHIFT) +#define PIN_SLPM_DIR_INPUT	((1 + 0) << PIN_SLPM_DIR_SHIFT) +#define PIN_SLPM_DIR_OUTPUT	((1 + 1) << PIN_SLPM_DIR_SHIFT) + +#define PIN_SLPM_VAL_SHIFT	21 +#define PIN_SLPM_VAL_MASK	(0x3 << PIN_SLPM_VAL_SHIFT) +#define PIN_SLPM_VAL(x)		\ +	(((x) & PIN_SLPM_VAL_MASK) >> PIN_SLPM_VAL_SHIFT) +#define PIN_SLPM_VAL_LOW	((1 + 0) << PIN_SLPM_VAL_SHIFT) +#define PIN_SLPM_VAL_HIGH	((1 + 1) << PIN_SLPM_VAL_SHIFT) + +#define PIN_SLPM_PDIS_SHIFT		23 +#define PIN_SLPM_PDIS_MASK		(0x3 << PIN_SLPM_PDIS_SHIFT) +#define PIN_SLPM_PDIS(x)	\ +	(((x) & PIN_SLPM_PDIS_MASK) >> PIN_SLPM_PDIS_SHIFT) +#define PIN_SLPM_PDIS_NO_CHANGE		(0 << PIN_SLPM_PDIS_SHIFT) +#define PIN_SLPM_PDIS_DISABLED		(1 << PIN_SLPM_PDIS_SHIFT) +#define PIN_SLPM_PDIS_ENABLED		(2 << PIN_SLPM_PDIS_SHIFT) + +#define PIN_LOWEMI_SHIFT	25 +#define PIN_LOWEMI_MASK		(0x1 << PIN_LOWEMI_SHIFT) +#define PIN_LOWEMI(x)		(((x) & PIN_LOWEMI_MASK) >> PIN_LOWEMI_SHIFT) +#define PIN_LOWEMI_DISABLED	(0 << PIN_LOWEMI_SHIFT) +#define PIN_LOWEMI_ENABLED	(1 << PIN_LOWEMI_SHIFT) + +#define PIN_GPIOMODE_SHIFT	26 +#define PIN_GPIOMODE_MASK	(0x1 << PIN_GPIOMODE_SHIFT) +#define PIN_GPIOMODE(x)		(((x) & PIN_GPIOMODE_MASK) >> PIN_GPIOMODE_SHIFT) +#define PIN_GPIOMODE_DISABLED	(0 << PIN_GPIOMODE_SHIFT) +#define PIN_GPIOMODE_ENABLED	(1 << PIN_GPIOMODE_SHIFT) + +#define PIN_SLEEPMODE_SHIFT	27 +#define PIN_SLEEPMODE_MASK	(0x1 << PIN_SLEEPMODE_SHIFT) +#define PIN_SLEEPMODE(x)	(((x) & PIN_SLEEPMODE_MASK) >> PIN_SLEEPMODE_SHIFT) +#define PIN_SLEEPMODE_DISABLED	(0 << PIN_SLEEPMODE_SHIFT) +#define PIN_SLEEPMODE_ENABLED	(1 << PIN_SLEEPMODE_SHIFT) + + +/* Shortcuts.  Use these instead of separate DIR, PULL, and VAL.  */ +#define PIN_INPUT_PULLDOWN	(PIN_DIR_INPUT | PIN_PULL_DOWN) +#define PIN_INPUT_PULLUP	(PIN_DIR_INPUT | PIN_PULL_UP) +#define PIN_INPUT_NOPULL	(PIN_DIR_INPUT | PIN_PULL_NONE) +#define PIN_OUTPUT_LOW		(PIN_DIR_OUTPUT | PIN_VAL_LOW) +#define PIN_OUTPUT_HIGH		(PIN_DIR_OUTPUT | PIN_VAL_HIGH) + +#define PIN_SLPM_INPUT_PULLDOWN	(PIN_SLPM_DIR_INPUT | PIN_SLPM_PULL_DOWN) +#define PIN_SLPM_INPUT_PULLUP	(PIN_SLPM_DIR_INPUT | PIN_SLPM_PULL_UP) +#define PIN_SLPM_INPUT_NOPULL	(PIN_SLPM_DIR_INPUT | PIN_SLPM_PULL_NONE) +#define PIN_SLPM_OUTPUT_LOW	(PIN_SLPM_DIR_OUTPUT | PIN_SLPM_VAL_LOW) +#define PIN_SLPM_OUTPUT_HIGH	(PIN_SLPM_DIR_OUTPUT | PIN_SLPM_VAL_HIGH) + +#define PIN_CFG_DEFAULT		(0) + +#define PIN_CFG(num, alt)		\ +	(PIN_CFG_DEFAULT |\ +	 (PIN_NUM(num) | PIN_##alt)) + +#define PIN_CFG_INPUT(num, alt, pull)		\ +	(PIN_CFG_DEFAULT |\ +	 (PIN_NUM(num) | PIN_##alt | PIN_INPUT_##pull)) + +#define PIN_CFG_OUTPUT(num, alt, val)		\ +	(PIN_CFG_DEFAULT |\ +	 (PIN_NUM(num) | PIN_##alt | PIN_OUTPUT_##val)) + +/* + * "nmk_gpio" and "NMK_GPIO" stand for "Nomadik GPIO", leaving + * the "gpio" namespace for generic and cross-machine functions + */ + +#define GPIO_BLOCK_SHIFT 5 +#define NMK_GPIO_PER_CHIP (1 << GPIO_BLOCK_SHIFT) + +/* Register in the logic block */ +#define NMK_GPIO_DAT	0x00 +#define NMK_GPIO_DATS	0x04 +#define NMK_GPIO_DATC	0x08 +#define NMK_GPIO_PDIS	0x0c +#define NMK_GPIO_DIR	0x10 +#define NMK_GPIO_DIRS	0x14 +#define NMK_GPIO_DIRC	0x18 +#define NMK_GPIO_SLPC	0x1c +#define NMK_GPIO_AFSLA	0x20 +#define NMK_GPIO_AFSLB	0x24 +#define NMK_GPIO_LOWEMI	0x28 + +#define NMK_GPIO_RIMSC	0x40 +#define NMK_GPIO_FIMSC	0x44 +#define NMK_GPIO_IS	0x48 +#define NMK_GPIO_IC	0x4c +#define NMK_GPIO_RWIMSC	0x50 +#define NMK_GPIO_FWIMSC	0x54 +#define NMK_GPIO_WKS	0x58 +/* These appear in DB8540 and later ASICs */ +#define NMK_GPIO_EDGELEVEL 0x5C +#define NMK_GPIO_LEVEL	0x60 + +/* Alternate functions: function C is set in hw by setting both A and B */ +#define NMK_GPIO_ALT_GPIO	0 +#define NMK_GPIO_ALT_A	1 +#define NMK_GPIO_ALT_B	2 +#define NMK_GPIO_ALT_C	(NMK_GPIO_ALT_A | NMK_GPIO_ALT_B) + +#define NMK_GPIO_ALT_CX_SHIFT 2 +#define NMK_GPIO_ALT_C1	((1<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C) +#define NMK_GPIO_ALT_C2	((2<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C) +#define NMK_GPIO_ALT_C3	((3<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C) +#define NMK_GPIO_ALT_C4	((4<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C) + +/* Pull up/down values */ +enum nmk_gpio_pull { +	NMK_GPIO_PULL_NONE, +	NMK_GPIO_PULL_UP, +	NMK_GPIO_PULL_DOWN, +}; + +/* Sleep mode */ +enum nmk_gpio_slpm { +	NMK_GPIO_SLPM_INPUT, +	NMK_GPIO_SLPM_WAKEUP_ENABLE = NMK_GPIO_SLPM_INPUT, +	NMK_GPIO_SLPM_NOCHANGE, +	NMK_GPIO_SLPM_WAKEUP_DISABLE = NMK_GPIO_SLPM_NOCHANGE, +}; + +/* Older deprecated pin config API that should go away soon */ +extern int nmk_config_pin(pin_cfg_t cfg, bool sleep); +extern int nmk_config_pins(pin_cfg_t *cfgs, int num); +extern int nmk_config_pins_sleep(pin_cfg_t *cfgs, int num); +extern int nmk_gpio_set_slpm(int gpio, enum nmk_gpio_slpm mode); +extern int nmk_gpio_set_pull(int gpio, enum nmk_gpio_pull pull); +#ifdef CONFIG_PINCTRL_NOMADIK +extern int nmk_gpio_set_mode(int gpio, int gpio_mode); +#else +static inline int nmk_gpio_set_mode(int gpio, int gpio_mode) +{ +	return -ENODEV; +} +#endif +extern int nmk_gpio_get_mode(int gpio); + +extern void nmk_gpio_wakeups_suspend(void); +extern void nmk_gpio_wakeups_resume(void); + +extern void nmk_gpio_clocks_enable(void); +extern void nmk_gpio_clocks_disable(void); + +extern void nmk_gpio_read_pull(int gpio_bank, u32 *pull_up); + +/* + * Platform data to register a block: only the initial gpio/irq number. + */ +struct nmk_gpio_platform_data { +	char *name; +	int first_gpio; +	int first_irq; +	int num_gpio; +	u32 (*get_secondary_status)(unsigned int bank); +	void (*set_ioforce)(bool enable); +	bool supports_sleepmode; +}; + +#endif /* __PLAT_NOMADIK_GPIO */ diff --git a/include/linux/platform_data/pxa2xx_udc.h b/include/linux/platform_data/pxa2xx_udc.h new file mode 100644 index 00000000000..c6c5e98b5b8 --- /dev/null +++ b/include/linux/platform_data/pxa2xx_udc.h @@ -0,0 +1,27 @@ +/* + * This supports machine-specific differences in how the PXA2xx + * USB Device Controller (UDC) is wired. + * + * It is set in linux/arch/arm/mach-pxa/<machine>.c or in + * linux/arch/mach-ixp4xx/<machine>.c and used in + * the probe routine of linux/drivers/usb/gadget/pxa2xx_udc.c + */ +#ifndef PXA2XX_UDC_H +#define PXA2XX_UDC_H + +struct pxa2xx_udc_mach_info { +        int  (*udc_is_connected)(void);		/* do we see host? */ +        void (*udc_command)(int cmd); +#define	PXA2XX_UDC_CMD_CONNECT		0	/* let host see us */ +#define	PXA2XX_UDC_CMD_DISCONNECT	1	/* so host won't see us */ + +	/* Boards following the design guidelines in the developer's manual, +	 * with on-chip GPIOs not Lubbock's weird hardware, can have a sane +	 * VBUS IRQ and omit the methods above.  Store the GPIO number +	 * here.  Note that sometimes the signals go through inverters... +	 */ +	bool	gpio_pullup_inverted; +	int	gpio_pullup;			/* high == pullup activated */ +}; + +#endif diff --git a/include/linux/platform_data/pxa_sdhci.h b/include/linux/platform_data/pxa_sdhci.h index 59acd987ed3..27d3156d093 100644 --- a/include/linux/platform_data/pxa_sdhci.h +++ b/include/linux/platform_data/pxa_sdhci.h @@ -38,6 +38,7 @@   * @max_speed: the maximum speed supported   * @host_caps: Standard MMC host capabilities bit field.   * @quirks: quirks of platfrom + * @quirks2: quirks2 of platfrom   * @pm_caps: pm_caps of platfrom   */  struct sdhci_pxa_platdata { @@ -48,9 +49,10 @@ struct sdhci_pxa_platdata {  	unsigned int	ext_cd_gpio;  	bool		ext_cd_gpio_invert;  	unsigned int	max_speed; -	unsigned int	host_caps; -	unsigned int	host_caps2; +	u32		host_caps; +	u32		host_caps2;  	unsigned int	quirks; +	unsigned int	quirks2;  	unsigned int	pm_caps;  }; diff --git a/include/linux/platform_data/sa11x0-serial.h b/include/linux/platform_data/sa11x0-serial.h new file mode 100644 index 00000000000..4504d5d592f --- /dev/null +++ b/include/linux/platform_data/sa11x0-serial.h @@ -0,0 +1,33 @@ +/* + *  Author: Nicolas Pitre + * + * Moved and changed lots, Russell King + * + * Low level machine dependent UART functions. + */ +#ifndef SA11X0_SERIAL_H +#define SA11X0_SERIAL_H + +struct uart_port; +struct uart_info; + +/* + * This is a temporary structure for registering these + * functions; it is intended to be discarded after boot. + */ +struct sa1100_port_fns { +	void	(*set_mctrl)(struct uart_port *, u_int); +	u_int	(*get_mctrl)(struct uart_port *); +	void	(*pm)(struct uart_port *, u_int, u_int); +	int	(*set_wake)(struct uart_port *, u_int); +}; + +#ifdef CONFIG_SERIAL_SA1100 +void sa1100_register_uart_fns(struct sa1100_port_fns *fns); +void sa1100_register_uart(int idx, int port); +#else +#define sa1100_register_uart_fns(fns) do { } while (0) +#define sa1100_register_uart(idx,port) do { } while (0) +#endif + +#endif diff --git a/include/linux/platform_data/uio_dmem_genirq.h b/include/linux/platform_data/uio_dmem_genirq.h new file mode 100644 index 00000000000..973c1bb3216 --- /dev/null +++ b/include/linux/platform_data/uio_dmem_genirq.h @@ -0,0 +1,26 @@ +/* + * include/linux/platform_data/uio_dmem_genirq.h + * + * Copyright (C) 2012 Damian Hobson-Garcia + * + * 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 version 2. + * + * This program is distributed "as is" WITHOUT ANY WARRANTY of any + * kind, whether express or implied; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the + * GNU General Public License for more details. + */ + +#ifndef _UIO_DMEM_GENIRQ_H +#define _UIO_DMEM_GENIRQ_H + +#include <linux/uio_driver.h> + +struct uio_dmem_genirq_pdata { +	struct uio_info	uioinfo; +	unsigned int *dynamic_region_sizes; +	unsigned int num_dynamic_regions; +}; +#endif /* _UIO_DMEM_GENIRQ_H */  |