[PATCH 2/5] mfd/stmpe: Move struct stmpe_variant_info to linux/mfd/stmpe.h

From: Viresh Kumar
Date: Wed Nov 16 2011 - 06:26:39 EST


From: Pratyush Anand <pratyush.anand@xxxxxx>

Some variants like GPIO of STMPE801 have different register definition. So,
variant ID will be needed by stmpe-gpio.c to distinguish between STMPE801. Move
this struct definition from drivers/mfd/stmpe.h to include/linux/stmpe.h

Signed-off-by: Pratyush Anand <pratyush.anand@xxxxxx>
---
drivers/mfd/stmpe.h | 32 --------------------------------
include/linux/mfd/stmpe.h | 33 +++++++++++++++++++++++++++++++++
2 files changed, 33 insertions(+), 32 deletions(-)

diff --git a/drivers/mfd/stmpe.h b/drivers/mfd/stmpe.h
index a73f4c1..7df0bda 100644
--- a/drivers/mfd/stmpe.h
+++ b/drivers/mfd/stmpe.h
@@ -44,38 +44,6 @@ struct stmpe_variant_block {
};

/**
- * struct stmpe_variant_info - variant-specific information
- * @name: part name
- * @id_val: content of CHIPID register
- * @id_mask: bits valid in CHIPID register for comparison with id_val
- * @num_gpios: number of GPIOS
- * @af_bits: number of bits used to specify the alternate function
- * @regs: variant specific registers.
- * @blocks: list of blocks present on this device
- * @num_blocks: number of blocks present on this device
- * @num_irqs: number of internal IRQs available on this device
- * @enable: callback to enable the specified blocks.
- * Called with the I/O lock held.
- * @get_altfunc: callback to get the alternate function number for the
- * specific block
- * @enable_autosleep: callback to configure autosleep with specified timeout
- */
-struct stmpe_variant_info {
- const char *name;
- u16 id_val;
- u16 id_mask;
- int num_gpios;
- int af_bits;
- const u8 *regs;
- struct stmpe_variant_block *blocks;
- int num_blocks;
- int num_irqs;
- int (*enable)(struct stmpe *stmpe, unsigned int blocks, bool enable);
- int (*get_altfunc)(struct stmpe *stmpe, enum stmpe_block block);
- int (*enable_autosleep)(struct stmpe *stmpe, int autosleep_timeout);
-};
-
-/**
* struct stmpe_client_info - i2c or spi specific routines/info
* @data: client specific data
* @read_byte: read single byte
diff --git a/include/linux/mfd/stmpe.h b/include/linux/mfd/stmpe.h
index 5afaf89..102c06d 100644
--- a/include/linux/mfd/stmpe.h
+++ b/include/linux/mfd/stmpe.h
@@ -51,6 +51,7 @@ enum {

struct stmpe_variant_info;
struct stmpe_client_info;
+struct stmpe_variant_block;

/**
* struct stmpe - STMPE MFD structure
@@ -86,6 +87,38 @@ struct stmpe {
struct stmpe_platform_data *pdata;
};

+/**
+ * struct stmpe_variant_info - variant-specific information
+ * @name: part name
+ * @id_val: content of CHIPID register
+ * @id_mask: bits valid in CHIPID register for comparison with id_val
+ * @num_gpios: number of GPIOS
+ * @af_bits: number of bits used to specify the alternate function
+ * @regs: variant specific registers.
+ * @blocks: list of blocks present on this device
+ * @num_blocks: number of blocks present on this device
+ * @num_irqs: number of internal IRQs available on this device
+ * @enable: callback to enable the specified blocks.
+ * Called with the I/O lock held.
+ * @get_altfunc: callback to get the alternate function number for the
+ * specific block
+ * @enable_autosleep: callback to configure autosleep with specified timeout
+ */
+struct stmpe_variant_info {
+ const char *name;
+ u16 id_val;
+ u16 id_mask;
+ int num_gpios;
+ int af_bits;
+ const u8 *regs;
+ struct stmpe_variant_block *blocks;
+ int num_blocks;
+ int num_irqs;
+ int (*enable)(struct stmpe *stmpe, unsigned int blocks, bool enable);
+ int (*get_altfunc)(struct stmpe *stmpe, enum stmpe_block block);
+ int (*enable_autosleep)(struct stmpe *stmpe, int autosleep_timeout);
+};
+
extern int stmpe_reg_write(struct stmpe *stmpe, u8 reg, u8 data);
extern int stmpe_reg_read(struct stmpe *stmpe, u8 reg);
extern int stmpe_block_read(struct stmpe *stmpe, u8 reg, u8 length,
--
1.7.2.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/