blob: ef8b519bb21866bdacb0dd42fb6886863814d64f [file] [log] [blame]
Mahesh Kumar Sharma41a4d382017-01-17 17:00:51 -08001/*
2 * Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 */
14
15#ifndef __LINUX_BLUETOOTH_POWER_H
16#define __LINUX_BLUETOOTH_POWER_H
17
18/*
19 * voltage regulator information required for configuring the
20 * bluetooth chipset
21 */
22struct bt_power_vreg_data {
23 /* voltage regulator handle */
24 struct regulator *reg;
25 /* regulator name */
26 const char *name;
27 /* voltage levels to be set */
28 unsigned int low_vol_level;
29 unsigned int high_vol_level;
30 /* current level to be set */
31 unsigned int load_uA;
32 /*
33 * is set voltage supported for this regulator?
34 * false => set voltage is not supported
35 * true => set voltage is supported
36 *
37 * Some regulators (like gpio-regulators, LVS (low voltage swtiches)
38 * PMIC regulators) dont have the capability to call
39 * regulator_set_voltage or regulator_set_optimum_mode
40 * Use this variable to indicate if its a such regulator or not
41 */
42 bool set_voltage_sup;
43 /* is this regulator enabled? */
44 bool is_enabled;
45};
46
47struct bt_power_clk_data {
48 /* clock regulator handle */
49 struct clk *clk;
50 /* clock name */
51 const char *name;
52 /* is this clock enabled? */
53 bool is_enabled;
54};
55
56/*
57 * Platform data for the bluetooth power driver.
58 */
59struct bluetooth_power_platform_data {
60 /* Bluetooth reset gpio */
61 int bt_gpio_sys_rst;
62 struct device *slim_dev;
63 /* VDDIO voltage regulator */
64 struct bt_power_vreg_data *bt_vdd_io;
65 /* VDD_PA voltage regulator */
66 struct bt_power_vreg_data *bt_vdd_pa;
67 /* VDD_LDOIN voltage regulator */
68 struct bt_power_vreg_data *bt_vdd_ldo;
69 /* VDD_XTAL voltage regulator */
70 struct bt_power_vreg_data *bt_vdd_xtal;
71 /* VDD_CORE voltage regulator */
72 struct bt_power_vreg_data *bt_vdd_core;
73 /* Optional: chip power down gpio-regulator
74 * chip power down data is required when bluetooth module
75 * and other modules like wifi co-exist in a single chip and
76 * shares a common gpio to bring chip out of reset.
77 */
78 struct bt_power_vreg_data *bt_chip_pwd;
79 /* bluetooth reference clock */
80 struct bt_power_clk_data *bt_chip_clk;
81 /* Optional: Bluetooth power setup function */
82 int (*bt_power_setup)(int);
83};
84
85int bt_register_slimdev(struct device *dev);
86
87#define BT_CMD_SLIM_TEST 0xbfac
88#define BT_CMD_PWR_CTRL 0xbfad
89#endif /* __LINUX_BLUETOOTH_POWER_H */