summaryrefslogtreecommitdiff
path: root/drivers/misc/m4sensorhub_wrist.h
blob: 7065935cc17e0d5715c134398eb7ae2837d9dbb3 (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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/*
 * Copyright (C) 2013 Motorola Mobility, Inc.
 *
 * 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 _M4SENSORHUB_WRIST_H_
#define _M4SENSORHUB_WRIST_H_

#include <linux/types.h>
#include <linux/platform_device.h>
#include <linux/m4sensorhub.h>

struct m4wrist_driver_data {
	struct m4sensorhub_data  *client;
	struct mutex             *mutex;
	struct platform_device   *pdev;

	int         gpio_xres;
	int         gpio_clk;
	int         gpio_data;

	uint8_t     *img;
	uint32_t    size;
	uint8_t     si_id[2];
	uint8_t     fw_ver[2];
} __packed;

#define M4WRIST_ID_SETUP_1_BITS 594
static uint8_t m4wrist_id_setup_1[] = {
	0xCA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
	0x0D, 0xEE, 0x21, 0xF7, 0xF0, 0x27, 0xDC, 0x40,
	0x9F, 0x70, 0x01, 0xFD, 0xEE, 0x01, 0xE7, 0xC1,
	0xD7, 0x9F, 0x20, 0x7E, 0x7D, 0x88, 0x7D, 0xEE,
	0x21, 0xF7, 0xF0, 0x07, 0xDC, 0x40, 0x1F, 0x70,
	0x01, 0xFD, 0xEE, 0x01, 0xF7, 0xA0, 0x1F, 0xDE,
	0xA0, 0x1F, 0x7B, 0x00, 0x7D, 0xE0, 0x13, 0xF7,
	0xC0, 0x07, 0xDF, 0x28, 0x1F, 0x7D, 0x18, 0x7D,
	0xFE, 0x25, 0x80,
};

#define M4WRIST_ID_SETUP_2_BITS 418
static uint8_t m4wrist_id_setup_2[] = {
	0xDE, 0xE2, 0x1F, 0x7F, 0x02, 0x7D, 0xC4, 0x09,
	0xF7, 0x00, 0x1F, 0x9F, 0x07, 0x5E, 0x7C, 0x81,
	0xF9, 0xF4, 0x01, 0xF7, 0xF0, 0x07, 0xDC, 0x40,
	0x1F, 0x70, 0x01, 0xFD, 0xEE, 0x01, 0xF7, 0xA0,
	0x1F, 0xDE, 0xA0, 0x1F, 0x7B, 0x00, 0x7D, 0xE0,
	0x0D, 0xF7, 0xC0, 0x07, 0xDF, 0x28, 0x1F, 0x7D,
	0x18, 0x7D, 0xFE, 0x25, 0x80,
};

#define M4WRIST_SYNC_ENABLE_BITS 110
static uint8_t m4wrist_sync_enable[] = {
	0xDE, 0xE2, 0x1F, 0x7F, 0x02, 0x7D, 0xC4, 0x09,
	0xF7, 0x00, 0x1F, 0xDE, 0xE0, 0x1C,
};

#define M4WRIST_SYNC_DISABLE_BITS 110
static uint8_t m4wrist_sync_disable[] = {
	0xDE, 0xE2, 0x1F, 0x71, 0x00, 0x7D, 0xFC, 0x01,
	0xF7, 0x00, 0x1F, 0xDE, 0xE0, 0x1C,
};

#define M4WRIST_ERASE_BITS 396
static uint8_t m4wrist_erase[] = {
	0xDE, 0xE2, 0x1F, 0x7F, 0x02, 0x7D, 0xC4, 0x09,
	0xF7, 0x00, 0x1F, 0x9F, 0x07, 0x5E, 0x7C, 0x85,
	0xFD, 0xFC, 0x01, 0xF7, 0x10, 0x07, 0xDC, 0x00,
	0x7F, 0x7B, 0x80, 0x7D, 0xE0, 0x0B, 0xF7, 0xA0,
	0x1F, 0xDE, 0xA0, 0x1F, 0x7B, 0x04, 0x7D, 0xF0,
	0x01, 0xF7, 0xC9, 0x87, 0xDF, 0x48, 0x1F, 0x7F,
	0x89, 0x60,
};

#define M4WRIST_READ_WRITE_SETUP_BITS 66
static uint8_t m4wrist_read_write_setup[] = {
	0xDE, 0xF0, 0x1F, 0x78, 0x00, 0x7D, 0xA0, 0x03,
	0xC0,
};

#define M4WRIST_PROGRAM_AND_VERIFY_BITS 440
static uint8_t m4wrist_program_and_verify[] = {
	0xDE, 0xE2, 0x1F, 0x7F, 0x02, 0x7D, 0xC4, 0x09,
	0xF7, 0x00, 0x1F, 0x9F, 0x07, 0x5E, 0x7C, 0x81,
	0xF9, 0xF7, 0x01, 0xF7, 0xF0, 0x07, 0xDC, 0x40,
	0x1F, 0x70, 0x01, 0xFD, 0xEE, 0x01, 0xF6, 0xA0,
	0x0F, 0xDE, 0x80, 0x7F, 0x7A, 0x80, 0x7D, 0xEC,
	0x01, 0xF7, 0x80, 0x57, 0xDF, 0x00, 0x1F, 0x7C,
	0xA0, 0x7D, 0xF4, 0x61, 0xF7, 0xF8, 0x96,
};

#endif /* _M4SENSORHUB_WRIST_H_ */