aboutsummaryrefslogtreecommitdiff
path: root/include/linux/ir2e71y.h
blob: 5131f1f40386e372816268f02c9cb491fecc374e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/* include/linux/ir2e71y.h  (Display Driver)
 *
 * Copyright (C) 2016 SHARP CORPORATION
 *
 * This software is licensed under the terms of the GNU General Public
 * License version 2, as published by the Free Software Foundation, and
 * may be copied, distributed, and modified under those terms.
 *
 * 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 IR2E71Y_H
#define IR2E71Y_H

#include <uapi/linux/ir2e71y.h>

enum {
    IR2E71Y_BDIC_I2C_M_W,
    IR2E71Y_BDIC_I2C_M_R,
    IR2E71Y_BDIC_I2C_M_R_MODE1,
    IR2E71Y_BDIC_I2C_M_R_MODE2,
    IR2E71Y_BDIC_I2C_M_R_MODE3,
    NUM_IR2E71Y_BDIC_I2C_M
};

enum {
    IR2E71Y_PROX_SENSOR_POWER_OFF,
    IR2E71Y_PROX_SENSOR_POWER_ON,
    IR2E71Y_PROX_SENSOR_BGMODE_ON,
    IR2E71Y_PROX_SENSOR_BGMODE_OFF,
    NUM_IR2E71Y_PROX_SENSOR_POWER
};

struct ir2e71y_bdic_i2c_msg {
    unsigned short addr;
    unsigned char mode;
    unsigned char wlen;
    unsigned char rlen;
    const unsigned char *wbuf;
    unsigned char *rbuf;
};

struct ir2e71y_prox_params {
    unsigned int threshold_low;
    unsigned int threshold_high;
};

#ifdef CONFIG_IR2E71Y
int ir2e71y_enable_analog_power(int enable);
int ir2e71y_prox_sensor_pow_ctl(int power_mode, struct ir2e71y_prox_params *prox_params);
int ir2e71y_write_bdic_i2c(struct ir2e71y_bdic_i2c_msg *i2c_msg);
int ir2e71y_read_bdic_i2c(struct ir2e71y_bdic_i2c_msg *i2c_msg);
#else
static inline int ir2e71y_enable_analog_power(int enable)
{
	return 0;
}
static inline int ir2e71y_prox_sensor_pow_ctl(int power_mode, struct ir2e71y_prox_params *prox_params)
{
	return IR2E71Y_RESULT_SUCCESS;
}
static inline int ir2e71y_write_bdic_i2c(struct ir2e71y_bdic_i2c_msg *i2c_msg)
{
	return IR2E71Y_RESULT_SUCCESS;
}
static inline int ir2e71y_read_bdic_i2c(struct ir2e71y_bdic_i2c_msg *i2c_msg)
{
	return IR2E71Y_RESULT_SUCCESS;
}
#endif /* CONFIG_IR2E71Y */

#endif /* IR2E71Y_H */

/* ------------------------------------------------------------------------- */
/* END OF FILE                                                               */
/* ------------------------------------------------------------------------- */