stmpe.h (e4da3fbfbd1de56d2367653e3823e6445e49f8a9) stmpe.h (1a6e4b7415339e3b11a87cff0d701b8a2e55f062)
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 *
4 * License Terms: GNU General Public License, version 2
5 * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson
6 */
7
8#ifndef __STMPE_H
9#define __STMPE_H
10
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 *
4 * License Terms: GNU General Public License, version 2
5 * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson
6 */
7
8#ifndef __STMPE_H
9#define __STMPE_H
10
11#include <linux/device.h>
12#include <linux/mfd/core.h>
13#include <linux/mfd/stmpe.h>
14#include <linux/printk.h>
15#include <linux/types.h>
16
17extern const struct dev_pm_ops stmpe_dev_pm_ops;
18
11#ifdef STMPE_DUMP_BYTES
12static inline void stmpe_dump_bytes(const char *str, const void *buf,
13 size_t len)
14{
15 print_hex_dump_bytes(str, DUMP_PREFIX_OFFSET, buf, len);
16}
17#else
18static inline void stmpe_dump_bytes(const char *str, const void *buf,

--- 43 unchanged lines hidden (view full) ---

62 struct stmpe_variant_block *blocks;
63 int num_blocks;
64 int num_irqs;
65 int (*enable)(struct stmpe *stmpe, unsigned int blocks, bool enable);
66 int (*get_altfunc)(struct stmpe *stmpe, enum stmpe_block block);
67 int (*enable_autosleep)(struct stmpe *stmpe, int autosleep_timeout);
68};
69
19#ifdef STMPE_DUMP_BYTES
20static inline void stmpe_dump_bytes(const char *str, const void *buf,
21 size_t len)
22{
23 print_hex_dump_bytes(str, DUMP_PREFIX_OFFSET, buf, len);
24}
25#else
26static inline void stmpe_dump_bytes(const char *str, const void *buf,

--- 43 unchanged lines hidden (view full) ---

70 struct stmpe_variant_block *blocks;
71 int num_blocks;
72 int num_irqs;
73 int (*enable)(struct stmpe *stmpe, unsigned int blocks, bool enable);
74 int (*get_altfunc)(struct stmpe *stmpe, enum stmpe_block block);
75 int (*enable_autosleep)(struct stmpe *stmpe, int autosleep_timeout);
76};
77
78/**
79 * struct stmpe_client_info - i2c or spi specific routines/info
80 * @data: client specific data
81 * @read_byte: read single byte
82 * @write_byte: write single byte
83 * @read_block: read block or multiple bytes
84 * @write_block: write block or multiple bytes
85 * @init: client init routine, called during probe
86 */
87struct stmpe_client_info {
88 void *data;
89 int irq;
90 void *client;
91 struct device *dev;
92 int (*read_byte)(struct stmpe *stmpe, u8 reg);
93 int (*write_byte)(struct stmpe *stmpe, u8 reg, u8 val);
94 int (*read_block)(struct stmpe *stmpe, u8 reg, u8 len, u8 *values);
95 int (*write_block)(struct stmpe *stmpe, u8 reg, u8 len,
96 const u8 *values);
97 void (*init)(struct stmpe *stmpe);
98};
99
100int stmpe_probe(struct stmpe_client_info *ci, int partnum);
101int stmpe_remove(struct stmpe *stmpe);
102
70#define STMPE_ICR_LSB_HIGH (1 << 2)
71#define STMPE_ICR_LSB_EDGE (1 << 1)
72#define STMPE_ICR_LSB_GIM (1 << 0)
73
74/*
75 * STMPE811
76 */
77

--- 107 unchanged lines hidden ---
103#define STMPE_ICR_LSB_HIGH (1 << 2)
104#define STMPE_ICR_LSB_EDGE (1 << 1)
105#define STMPE_ICR_LSB_GIM (1 << 0)
106
107/*
108 * STMPE811
109 */
110

--- 107 unchanged lines hidden ---