blob: 25219f7dbf0f5bfdf6e5a71c70a0ff4a090a4b1b [file] [log] [blame]
Ajit Kumarc43c8002019-05-02 12:51:34 +05301/* Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
Ramesh Yadav Javadi43ff8772018-04-06 13:13:53 +05302 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
10 * GNU General Public License for more details.
11 */
12#ifndef LINUX_BG_CHAR_H
13#define LINUX_BG_CHAR_H
14#define BGCOM_REG_READ 0
15#define BGCOM_AHB_READ 1
16#define BGCOM_AHB_WRITE 2
17#define BGCOM_SET_SPI_FREE 3
18#define BGCOM_SET_SPI_BUSY 4
19#define BGCOM_REG_WRITE 5
20#define BGCOM_SOFT_RESET 6
21#define BGCOM_MODEM_DOWN2_BG 7
Ajit Kumar51fd2402018-05-15 14:40:20 +053022#define BGCOM_TWM_EXIT 8
Ajit Kumarc43c8002019-05-02 12:51:34 +053023#define BGCOM_BG_APP_RUNNING 9
Ramesh Yadav Javadi43ff8772018-04-06 13:13:53 +053024#define EXCHANGE_CODE 'V'
25
26struct bg_ui_data {
27 uint64_t __user write;
28 uint64_t __user result;
29 uint32_t bg_address;
30 uint32_t cmd;
31 uint32_t num_of_words;
32};
33
34enum bg_event_type {
35 BG_BEFORE_POWER_DOWN = 1,
36 BG_AFTER_POWER_UP,
37 MODEM_BEFORE_POWER_DOWN,
38 MODEM_AFTER_POWER_UP,
39};
40
41#define REG_READ \
42 _IOWR(EXCHANGE_CODE, BGCOM_REG_READ, \
43 struct bg_ui_data)
44#define AHB_READ \
45 _IOWR(EXCHANGE_CODE, BGCOM_AHB_READ, \
46 struct bg_ui_data)
47#define AHB_WRITE \
48 _IOW(EXCHANGE_CODE, BGCOM_AHB_WRITE, \
49 struct bg_ui_data)
50#define SET_SPI_FREE \
51 _IOR(EXCHANGE_CODE, BGCOM_SET_SPI_FREE, \
52 struct bg_ui_data)
53#define SET_SPI_BUSY \
54 _IOR(EXCHANGE_CODE, BGCOM_SET_SPI_BUSY, \
55 struct bg_ui_data)
56#define REG_WRITE \
57 _IOWR(EXCHANGE_CODE, BGCOM_REG_WRITE, \
58 struct bg_ui_data)
59#define BG_SOFT_RESET \
60 _IOWR(EXCHANGE_CODE, BGCOM_SOFT_RESET, \
61 struct bg_ui_data)
Ajit Kumar51fd2402018-05-15 14:40:20 +053062#define BG_TWM_EXIT \
63 _IOWR(EXCHANGE_CODE, BGCOM_TWM_EXIT, \
64 struct bg_ui_data)
Ajit Kumarc43c8002019-05-02 12:51:34 +053065#define BG_APP_RUNNING \
66 _IOWR(EXCHANGE_CODE, BGCOM_BG_APP_RUNNING, \
67 struct bg_ui_data)
Ramesh Yadav Javadi43ff8772018-04-06 13:13:53 +053068#define BG_MODEM_DOWN2_BG_DONE \
69 _IOWR(EXCHANGE_CODE, BGCOM_MODEM_DOWN2_BG, \
70 struct bg_ui_data)
71#endif