PageRenderTime 20ms CodeModel.GetById 9ms app.highlight 7ms RepoModel.GetById 2ms app.codeStats 0ms

/include/linux/vibrator-lc898300.h

https://github.com/airy09/android_kernel_sony_apq8064
C Header | 117 lines | 94 code | 9 blank | 14 comment | 0 complexity | 2eab62e2df0673e88947e7a83a3b4b10 MD5 | raw file
  1/*
  2 * vibrator-lc898300.h - platform data structure for lc898300 vibrator
  3 *
  4 * Copyright (C) 2012 Sony Ericsson Mobile Communications AB
  5 * Copyright (c) 2012 Sony Mobile Communications AB
  6 *
  7 * Authors: Ardiana Karppinen <ardiana.karppinen@sonyericsson.com>
  8 *          Stefan Karlsson <stefan3.karlsson@sonyericsson.com>
  9 *
 10 * This program is free software; you can redistribute it and/or modify
 11 * it under the terms of the GNU General Public License as published by
 12 * the Free Software Foundation; version 2 of the License.
 13 *
 14 */
 15
 16#ifndef __LINUX_LC898300_H
 17#define __LINUX_LC898300_H
 18#include <linux/platform_device.h>
 19
 20#define LC898300_I2C_NAME       "lc898300-vib-i2c"
 21enum vib_cmd_intensity {
 22	VIB_CMD_PWM_OFF   = 0x00,
 23	VIB_CMD_PWM_1_15 = 0x01,
 24	VIB_CMD_PWM_2_15 = 0x02,
 25	VIB_CMD_PWM_3_15 = 0x03,
 26	VIB_CMD_PWM_4_15 = 0x04,
 27	VIB_CMD_PWM_5_15 = 0x05,
 28	VIB_CMD_PWM_6_15 = 0x06,
 29	VIB_CMD_PWM_7_15 = 0x07,
 30	VIB_CMD_PWM_8_15 = 0x08,
 31	VIB_CMD_PWM_9_15 = 0x09,
 32	VIB_CMD_PWM_10_15 = 0x0a,
 33	VIB_CMD_PWM_11_15 = 0x0b,
 34	VIB_CMD_PWM_12_15 = 0x0c,
 35	VIB_CMD_PWM_13_15 = 0x0d,
 36	VIB_CMD_PWM_14_15 = 0x0e,
 37	VIB_CMD_PWM_15_15 = 0x0f,
 38};
 39
 40enum vib_cmd_resonance {
 41	VIB_CMD_FREQ_125 = 0x00,
 42	VIB_CMD_FREQ_150 = 0x05,
 43	VIB_CMD_FREQ_200 = 0x0f,
 44};
 45
 46enum vib_cmd_startup {
 47	VIB_CMD_STTIME_0 = 0x00,
 48	VIB_CMD_STTIME_1 = 0x01,
 49	VIB_CMD_STTIME_2 = 0x02,
 50	VIB_CMD_STTIME_3 = 0x03,
 51	VIB_CMD_STTIME_4 = 0x04,
 52	VIB_CMD_STTIME_5 = 0x05,
 53	VIB_CMD_STTIME_6 = 0x06,
 54	VIB_CMD_STTIME_7 = 0x07,
 55};
 56
 57enum vib_cmd_brake {
 58	VIB_CMD_BRPWR_OFF = 0x00,
 59	VIB_CMD_BRPWR_1_15 = 0x01,
 60	VIB_CMD_BRPWR_2_15 = 0x02,
 61	VIB_CMD_BRPWR_3_15 = 0x03,
 62	VIB_CMD_BRPWR_4_15 = 0x04,
 63	VIB_CMD_BRPWR_5_15 = 0x05,
 64	VIB_CMD_BRPWR_6_15 = 0x06,
 65	VIB_CMD_BRPWR_7_15 = 0x07,
 66	VIB_CMD_BRPWR_8_15 = 0x08,
 67	VIB_CMD_BRPWR_9_15 = 0x09,
 68	VIB_CMD_BRPWR_10_15 = 0x0a,
 69	VIB_CMD_BRPWR_11_15 = 0x0b,
 70	VIB_CMD_BRPWR_12_15 = 0x0c,
 71	VIB_CMD_BRPWR_13_15 = 0x0d,
 72	VIB_CMD_BRPWR_14_15 = 0x0e,
 73	VIB_CMD_BRPWR_15_15 = 0x0f,
 74	VIB_CMD_BRTIME_0 = 0x00 << 4,
 75	VIB_CMD_BRTIME_1 = 0x01 << 4,
 76	VIB_CMD_BRTIME_2 = 0x02 << 4,
 77	VIB_CMD_BRTIME_3 = 0x03 << 4,
 78	VIB_CMD_ATBR = 0x01 << 6,
 79};
 80
 81enum vib_cmd_stops {
 82	VIB_CMD_ATSNUM_0_10 = 0x00,
 83	VIB_CMD_ATSNUM_1_10 = 0x01,
 84	VIB_CMD_ATSNUM_2_10 = 0x02,
 85	VIB_CMD_ATSNUM_3_10 = 0x03,
 86	VIB_CMD_ATSNUM_4_10 = 0x04,
 87	VIB_CMD_ATSNUM_5_10 = 0x05,
 88	VIB_CMD_ATSNUM_6_10 = 0x06,
 89	VIB_CMD_ATSNUM_7_10 = 0x07,
 90	VIB_CMD_ATSNUM_8_10 = 0x08,
 91	VIB_CMD_ATSNUM_9_10 = 0x09,
 92	VIB_CMD_ATSNUM_10_10 = 0x0a,
 93	VIB_CMD_ATSNUM_MASK = 0x0f,
 94	VIB_CMD_ATSOFF = 0x00 << 4,
 95	VIB_CMD_ATSON = 0x01 << 4,
 96};
 97
 98struct lc898300_vib_cmd {
 99	u8 vib_cmd_intensity;
100	u8 vib_cmd_resonance;
101	u8 vib_cmd_startup;
102	u8 vib_cmd_brake;
103	u8 vib_cmd_stops;
104};
105
106struct lc898300_platform_data {
107	const char *name;
108	int (*power_config)(struct device *dev, bool on);
109	int (*power_enable)(struct device *dev, bool on);
110	int (*gpio_allocate)(struct device *dev);
111	void (*gpio_release)(struct device *dev);
112	int (*rstb_gpio_setup)(bool value);
113	int (*en_gpio_setup)(bool value);
114	struct lc898300_vib_cmd *vib_cmd_info;
115};
116
117#endif /* __LINUX_lc898300_H */