diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/platform_data/leds-omap.h | 22 | ||||
| -rw-r--r-- | include/linux/platform_data/mmc-omap.h | 150 | ||||
| -rw-r--r-- | include/linux/platform_data/mtd-nand-omap2.h | 46 | ||||
| -rw-r--r-- | include/linux/platform_data/mtd-onenand-omap2.h | 28 | ||||
| -rw-r--r-- | include/video/omapdss.h | 14 | ||||
| -rw-r--r-- | include/video/omapvrfb.h | 68 | 
6 files changed, 292 insertions, 36 deletions
diff --git a/include/linux/platform_data/leds-omap.h b/include/linux/platform_data/leds-omap.h new file mode 100644 index 00000000000..56c9b2a0ada --- /dev/null +++ b/include/linux/platform_data/leds-omap.h @@ -0,0 +1,22 @@ +/* + *  Copyright (C) 2006 Samsung Electronics + *  Kyungmin Park <kyungmin.park@samsung.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 ASMARM_ARCH_LED_H +#define ASMARM_ARCH_LED_H + +struct omap_led_config { +	struct led_classdev	cdev; +	s16			gpio; +}; + +struct omap_led_platform_data { +	s16			nr_leds; +	struct omap_led_config	*leds; +}; + +#endif diff --git a/include/linux/platform_data/mmc-omap.h b/include/linux/platform_data/mmc-omap.h new file mode 100644 index 00000000000..2bf6ea82ff9 --- /dev/null +++ b/include/linux/platform_data/mmc-omap.h @@ -0,0 +1,150 @@ +/* + * MMC definitions for OMAP2 + * + * Copyright (C) 2006 Nokia Corporation + * + * 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. + */ + +#define OMAP_MMC_MAX_SLOTS	2 + +/* + * struct omap_mmc_dev_attr.flags possibilities + * + * OMAP_HSMMC_SUPPORTS_DUAL_VOLT: Some HSMMC controller instances can + *    operate with either 1.8Vdc or 3.0Vdc card voltages; this flag + *    should be set if this is the case.  See for example Section 22.5.3 + *    "MMC/SD/SDIO1 Bus Voltage Selection" of the OMAP34xx Multimedia + *    Device Silicon Revision 3.1.x Revision ZR (July 2011) (SWPU223R). + * + * OMAP_HSMMC_BROKEN_MULTIBLOCK_READ: Multiple-block read transfers + *    don't work correctly on some MMC controller instances on some + *    OMAP3 SoCs; this flag should be set if this is the case.  See + *    for example Advisory 2.1.1.128 "MMC: Multiple Block Read + *    Operation Issue" in _OMAP3530/3525/3515/3503 Silicon Errata_ + *    Revision F (October 2010) (SPRZ278F). + */ +#define OMAP_HSMMC_SUPPORTS_DUAL_VOLT		BIT(0) +#define OMAP_HSMMC_BROKEN_MULTIBLOCK_READ	BIT(1) + +struct mmc_card; + +struct omap_mmc_dev_attr { +	u8 flags; +}; + +struct omap_mmc_platform_data { +	/* back-link to device */ +	struct device *dev; + +	/* number of slots per controller */ +	unsigned nr_slots:2; + +	/* set if your board has components or wiring that limits the +	 * maximum frequency on the MMC bus */ +	unsigned int max_freq; + +	/* switch the bus to a new slot */ +	int (*switch_slot)(struct device *dev, int slot); +	/* initialize board-specific MMC functionality, can be NULL if +	 * not supported */ +	int (*init)(struct device *dev); +	void (*cleanup)(struct device *dev); +	void (*shutdown)(struct device *dev); + +	/* To handle board related suspend/resume functionality for MMC */ +	int (*suspend)(struct device *dev, int slot); +	int (*resume)(struct device *dev, int slot); + +	/* Return context loss count due to PM states changing */ +	int (*get_context_loss_count)(struct device *dev); + +	/* Integrating attributes from the omap_hwmod layer */ +	u8 controller_flags; + +	/* Register offset deviation */ +	u16 reg_offset; + +	struct omap_mmc_slot_data { + +		/* +		 * 4/8 wires and any additional host capabilities +		 * need to OR'd all capabilities (ref. linux/mmc/host.h) +		 */ +		u8  wires;	/* Used for the MMC driver on omap1 and 2420 */ +		u32 caps;	/* Used for the MMC driver on 2430 and later */ +		u32 pm_caps;	/* PM capabilities of the mmc */ + +		/* +		 * nomux means "standard" muxing is wrong on this board, and +		 * that board-specific code handled it before common init logic. +		 */ +		unsigned nomux:1; + +		/* switch pin can be for card detect (default) or card cover */ +		unsigned cover:1; + +		/* use the internal clock */ +		unsigned internal_clock:1; + +		/* nonremovable e.g. eMMC */ +		unsigned nonremovable:1; + +		/* Try to sleep or power off when possible */ +		unsigned power_saving:1; + +		/* If using power_saving and the MMC power is not to go off */ +		unsigned no_off:1; + +		/* eMMC does not handle power off when not in sleep state */ +		unsigned no_regulator_off_init:1; + +		/* Regulator off remapped to sleep */ +		unsigned vcc_aux_disable_is_sleep:1; + +		/* 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) +		unsigned features; + +		int switch_pin;			/* gpio (card detect) */ +		int gpio_wp;			/* gpio (write protect) */ + +		int (*set_bus_mode)(struct device *dev, int slot, int bus_mode); +		int (*set_power)(struct device *dev, int slot, +				 int power_on, int vdd); +		int (*get_ro)(struct device *dev, int slot); +		void (*remux)(struct device *dev, int slot, int power_on); +		/* Call back before enabling / disabling regulators */ +		void (*before_set_reg)(struct device *dev, int slot, +				       int power_on, int vdd); +		/* Call back after enabling / disabling regulators */ +		void (*after_set_reg)(struct device *dev, int slot, +				      int power_on, int vdd); +		/* if we have special card, init it using this callback */ +		void (*init_card)(struct mmc_card *card); + +		/* return MMC cover switch state, can be NULL if not supported. +		 * +		 * possible return values: +		 *   0 - closed +		 *   1 - open +		 */ +		int (*get_cover_state)(struct device *dev, int slot); + +		const char *name; +		u32 ocr_mask; + +		/* Card detection IRQs */ +		int card_detect_irq; +		int (*card_detect)(struct device *dev, int slot); + +		unsigned int ban_openended:1; + +	} slots[OMAP_MMC_MAX_SLOTS]; +}; diff --git a/include/linux/platform_data/mtd-nand-omap2.h b/include/linux/platform_data/mtd-nand-omap2.h index 1a68c1e5fe5..24d32ca34be 100644 --- a/include/linux/platform_data/mtd-nand-omap2.h +++ b/include/linux/platform_data/mtd-nand-omap2.h @@ -8,9 +8,13 @@   * published by the Free Software Foundation.   */ -#include <plat/gpmc.h> +#ifndef	_MTD_NAND_OMAP2_H +#define	_MTD_NAND_OMAP2_H +  #include <linux/mtd/partitions.h> +#define	GPMC_BCH_NUM_REMAINDER	8 +  enum nand_io {  	NAND_OMAP_PREFETCH_POLLED = 0,	/* prefetch polled mode, default */  	NAND_OMAP_POLLED,		/* polled mode, without prefetch */ @@ -18,10 +22,38 @@ enum nand_io {  	NAND_OMAP_PREFETCH_IRQ		/* prefetch enabled irq mode */  }; +enum omap_ecc { +		/* 1-bit ecc: stored at end of spare area */ +	OMAP_ECC_HAMMING_CODE_DEFAULT = 0, /* Default, s/w method */ +	OMAP_ECC_HAMMING_CODE_HW, /* gpmc to detect the error */ +		/* 1-bit ecc: stored at beginning of spare area as romcode */ +	OMAP_ECC_HAMMING_CODE_HW_ROMCODE, /* gpmc method & romcode layout */ +	OMAP_ECC_BCH4_CODE_HW, /* 4-bit BCH ecc code */ +	OMAP_ECC_BCH8_CODE_HW, /* 8-bit BCH ecc code */ +}; + +struct gpmc_nand_regs { +	void __iomem	*gpmc_status; +	void __iomem	*gpmc_nand_command; +	void __iomem	*gpmc_nand_address; +	void __iomem	*gpmc_nand_data; +	void __iomem	*gpmc_prefetch_config1; +	void __iomem	*gpmc_prefetch_config2; +	void __iomem	*gpmc_prefetch_control; +	void __iomem	*gpmc_prefetch_status; +	void __iomem	*gpmc_ecc_config; +	void __iomem	*gpmc_ecc_control; +	void __iomem	*gpmc_ecc_size_config; +	void __iomem	*gpmc_ecc1_result; +	void __iomem	*gpmc_bch_result0[GPMC_BCH_NUM_REMAINDER]; +	void __iomem	*gpmc_bch_result1[GPMC_BCH_NUM_REMAINDER]; +	void __iomem	*gpmc_bch_result2[GPMC_BCH_NUM_REMAINDER]; +	void __iomem	*gpmc_bch_result3[GPMC_BCH_NUM_REMAINDER]; +}; +  struct omap_nand_platform_data {  	int			cs;  	struct mtd_partition	*parts; -	struct gpmc_timings	*gpmc_t;  	int			nr_parts;  	bool			dev_ready;  	enum nand_io		xfer_type; @@ -30,14 +62,4 @@ struct omap_nand_platform_data {  	struct gpmc_nand_regs	reg;  }; -/* minimum size for IO mapping */ -#define	NAND_IO_SIZE	4 - -#if defined(CONFIG_MTD_NAND_OMAP2) || defined(CONFIG_MTD_NAND_OMAP2_MODULE) -extern int gpmc_nand_init(struct omap_nand_platform_data *d); -#else -static inline int gpmc_nand_init(struct omap_nand_platform_data *d) -{ -	return 0; -}  #endif diff --git a/include/linux/platform_data/mtd-onenand-omap2.h b/include/linux/platform_data/mtd-onenand-omap2.h index 2858667d2e4..685af7e8b12 100644 --- a/include/linux/platform_data/mtd-onenand-omap2.h +++ b/include/linux/platform_data/mtd-onenand-omap2.h @@ -9,17 +9,15 @@   * published by the Free Software Foundation.   */ +#ifndef	__MTD_ONENAND_OMAP2_H +#define	__MTD_ONENAND_OMAP2_H +  #include <linux/mtd/mtd.h>  #include <linux/mtd/partitions.h>  #define ONENAND_SYNC_READ	(1 << 0)  #define ONENAND_SYNC_READWRITE	(1 << 1) - -struct onenand_freq_info { -	u16			maf_id; -	u16			dev_id; -	u16			ver_id; -}; +#define	ONENAND_IN_OMAP34XX	(1 << 2)  struct omap_onenand_platform_data {  	int			cs; @@ -27,27 +25,9 @@ struct omap_onenand_platform_data {  	struct mtd_partition	*parts;  	int			nr_parts;  	int			(*onenand_setup)(void __iomem *, int *freq_ptr); -	int		(*get_freq)(const struct onenand_freq_info *freq_info, -				    bool *clk_dep);  	int			dma_channel;  	u8			flags;  	u8			regulator_can_sleep;  	u8			skip_initial_unlocking;  }; - -#define ONENAND_MAX_PARTITIONS 8 - -#if defined(CONFIG_MTD_ONENAND_OMAP2) || \ -	defined(CONFIG_MTD_ONENAND_OMAP2_MODULE) - -extern void gpmc_onenand_init(struct omap_onenand_platform_data *d); - -#else - -#define board_onenand_data	NULL - -static inline void gpmc_onenand_init(struct omap_onenand_platform_data *d) -{ -} -  #endif diff --git a/include/video/omapdss.h b/include/video/omapdss.h index 3729173b7fb..88c829466fc 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h @@ -314,6 +314,19 @@ int dsi_vc_send_bta_sync(struct omap_dss_device *dssdev, int channel);  int dsi_enable_video_output(struct omap_dss_device *dssdev, int channel);  void dsi_disable_video_output(struct omap_dss_device *dssdev, int channel); +enum omapdss_version { +	OMAPDSS_VER_UNKNOWN = 0, +	OMAPDSS_VER_OMAP24xx, +	OMAPDSS_VER_OMAP34xx_ES1,	/* OMAP3430 ES1.0, 2.0 */ +	OMAPDSS_VER_OMAP34xx_ES3,	/* OMAP3430 ES3.0+ */ +	OMAPDSS_VER_OMAP3630, +	OMAPDSS_VER_AM35xx, +	OMAPDSS_VER_OMAP4430_ES1,	/* OMAP4430 ES1.0 */ +	OMAPDSS_VER_OMAP4430_ES2,	/* OMAP4430 ES2.0, 2.1, 2.2 */ +	OMAPDSS_VER_OMAP4,		/* All other OMAP4s */ +	OMAPDSS_VER_OMAP5, +}; +  /* Board specific data */  struct omap_dss_board_info {  	int (*get_context_loss_count)(struct device *dev); @@ -323,6 +336,7 @@ struct omap_dss_board_info {  	int (*dsi_enable_pads)(int dsi_id, unsigned lane_mask);  	void (*dsi_disable_pads)(int dsi_id, unsigned lane_mask);  	int (*set_min_bus_tput)(struct device *dev, unsigned long r); +	enum omapdss_version version;  };  /* Init with the board info */ diff --git a/include/video/omapvrfb.h b/include/video/omapvrfb.h new file mode 100644 index 00000000000..bb0bd89f8bc --- /dev/null +++ b/include/video/omapvrfb.h @@ -0,0 +1,68 @@ +/* + * VRFB Rotation Engine + * + * Copyright (C) 2009 Nokia Corporation + * Author: Tomi Valkeinen <tomi.valkeinen@nokia.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. + * + * 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., + * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. + */ + +#ifndef __OMAP_VRFB_H__ +#define __OMAP_VRFB_H__ + +#define OMAP_VRFB_LINE_LEN 2048 + +struct vrfb { +	u8 context; +	void __iomem *vaddr[4]; +	unsigned long paddr[4]; +	u16 xres; +	u16 yres; +	u16 xoffset; +	u16 yoffset; +	u8 bytespp; +	bool yuv_mode; +}; + +#ifdef CONFIG_OMAP2_VRFB +extern bool omap_vrfb_supported(void); +extern int omap_vrfb_request_ctx(struct vrfb *vrfb); +extern void omap_vrfb_release_ctx(struct vrfb *vrfb); +extern void omap_vrfb_adjust_size(u16 *width, u16 *height, +		u8 bytespp); +extern u32 omap_vrfb_min_phys_size(u16 width, u16 height, u8 bytespp); +extern u16 omap_vrfb_max_height(u32 phys_size, u16 width, u8 bytespp); +extern void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr, +		u16 width, u16 height, +		unsigned bytespp, bool yuv_mode); +extern int omap_vrfb_map_angle(struct vrfb *vrfb, u16 height, u8 rot); +extern void omap_vrfb_restore_context(void); + +#else +static inline bool omap_vrfb_supported(void) { return false; } +static inline int omap_vrfb_request_ctx(struct vrfb *vrfb) { return 0; } +static inline void omap_vrfb_release_ctx(struct vrfb *vrfb) {} +static inline void omap_vrfb_adjust_size(u16 *width, u16 *height, +		u8 bytespp) {} +static inline u32 omap_vrfb_min_phys_size(u16 width, u16 height, u8 bytespp) +		{ return 0; } +static inline u16 omap_vrfb_max_height(u32 phys_size, u16 width, u8 bytespp) +		{ return 0; } +static inline void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr, +		u16 width, u16 height, unsigned bytespp, bool yuv_mode) {} +static inline int omap_vrfb_map_angle(struct vrfb *vrfb, u16 height, u8 rot) +		{ return 0; } +static inline void omap_vrfb_restore_context(void) {} +#endif +#endif /* __VRFB_H */  |