aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/power
diff options
context:
space:
mode:
authorAnton Vorontsov <cbouatmailru@gmail.com>2012-11-18 18:35:32 -0500
committerAnton Vorontsov <cbouatmailru@gmail.com>2012-11-18 18:58:42 -0500
commit6c47a3e00c6e4f3cdac7566c1480de34d9e32e07 (patch)
treea86b059944cbc242de47fe0e2365f961bc2daacb /include/linux/power
parent7ad85830736f3e0d854becf7621eba3a0c926d13 (diff)
bq2415x_charger: Fix style issues
I hate doing these style fixups myself, but I also hate inconsitent code. Normally I just ask to resubmit the patch with the issues fixed, but N900 is special: I have a selfish interest in it. :) Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
Diffstat (limited to 'include/linux/power')
-rw-r--r--include/linux/power/bq2415x_charger.h131
1 files changed, 68 insertions, 63 deletions
diff --git a/include/linux/power/bq2415x_charger.h b/include/linux/power/bq2415x_charger.h
index fb6bf4d8aea8..97a1665eaeaf 100644
--- a/include/linux/power/bq2415x_charger.h
+++ b/include/linux/power/bq2415x_charger.h
@@ -1,72 +1,77 @@
1/* 1/*
2 bq2415x_charger.h - bq2415x charger driver 2 * bq2415x charger driver
3 Copyright (C) 2011-2012 Pali Rohár <pali.rohar@gmail.com> 3 *
4 4 * Copyright (C) 2011-2012 Pali Rohár <pali.rohar@gmail.com>
5 This program is free software; you can redistribute it and/or modify 5 *
6 it under the terms of the GNU General Public License as published by 6 * This program is free software; you can redistribute it and/or modify
7 the Free Software Foundation; either version 2 of the License, or 7 * it under the terms of the GNU General Public License as published by
8 (at your option) any later version. 8 * the Free Software Foundation; either version 2 of the License, or
9 9 * (at your option) any later version.
10 This program is distributed in the hope that it will be useful, 10 *
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * This program is distributed in the hope that it will be useful,
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 GNU General Public License for more details. 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 14 * GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License along 15 *
16 with this program; if not, write to the Free Software Foundation, Inc., 16 * You should have received a copy of the GNU General Public License along
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 * with this program; if not, write to the Free Software Foundation, Inc.,
18*/ 18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
19 20
20#ifndef BQ2415X_CHARGER_H 21#ifndef BQ2415X_CHARGER_H
21#define BQ2415X_CHARGER_H 22#define BQ2415X_CHARGER_H
22 23
23/* 24/*
24 This is platform data for bq2415x chip. It contains default board voltages 25 * This is platform data for bq2415x chip. It contains default board
25 and currents which can be also later configured via sysfs. If value is -1 26 * voltages and currents which can be also later configured via sysfs. If
26 then default chip value (specified in datasheet) will be used. 27 * value is -1 then default chip value (specified in datasheet) will be
27 28 * used.
28 Value resistor_sense is needed for for configuring charge and termination 29 *
29 current. It it is less or equal to zero, configuring charge and termination 30 * Value resistor_sense is needed for for configuring charge and
30 current will not be possible. 31 * termination current. It it is less or equal to zero, configuring charge
31 32 * and termination current will not be possible.
32 Function set_mode_hook is needed for automode (setting correct current limit 33 *
33 when charger is connected/disconnected or setting boost mode). When is NULL, 34 * Function set_mode_hook is needed for automode (setting correct current
34 automode function is disabled. When is not NULL, it must have this prototype: 35 * limit when charger is connected/disconnected or setting boost mode).
35 36 * When is NULL, automode function is disabled. When is not NULL, it must
36 int (*set_mode_hook)( 37 * have this prototype:
37 void (*hook)(enum bq2415x_mode mode, void *data), 38 *
38 void *data) 39 * int (*set_mode_hook)(
39 40 * void (*hook)(enum bq2415x_mode mode, void *data),
40 hook is hook function (see below) and data is pointer to driver private data 41 * void *data)
41 42 *
42 bq2415x driver will call it as: 43 * hook is hook function (see below) and data is pointer to driver private
43 44 * data
44 platform_data->set_mode_hook(bq2415x_hook_function, bq2415x_device); 45 *
45 46 * bq2415x driver will call it as:
46 Board/platform function set_mode_hook return non zero value when hook 47 *
47 function was successful registered. Platform code should call that hook 48 * platform_data->set_mode_hook(bq2415x_hook_function, bq2415x_device);
48 function (which get from pointer, with data) every time when charger was 49 *
49 connected/disconnected or require to enable boost mode. bq2415x driver then 50 * Board/platform function set_mode_hook return non zero value when hook
50 will set correct current limit, enable/disable charger or boost mode. 51 * function was successful registered. Platform code should call that hook
51 52 * function (which get from pointer, with data) every time when charger
52 Hook function has this prototype: 53 * was connected/disconnected or require to enable boost mode. bq2415x
53 54 * driver then will set correct current limit, enable/disable charger or
54 void hook(enum bq2415x_mode mode, void *data); 55 * boost mode.
55 56 *
56 mode is bq2415x mode (charger or boost) 57 * Hook function has this prototype:
57 data is pointer to driver private data (which get from set_charger_type_hook) 58 *
58 59 * void hook(enum bq2415x_mode mode, void *data);
59 When bq driver is being unloaded, it call function: 60 *
60 61 * mode is bq2415x mode (charger or boost)
61 platform_data->set_mode_hook(NULL, NULL); 62 * data is pointer to driver private data (which get from
62 63 * set_charger_type_hook)
63 (hook function and driver private data are NULL) 64 *
64 65 * When bq driver is being unloaded, it call function:
65 After that board/platform code must not call driver hook function! It is 66 *
66 possible that pointer to hook function will not be valid and calling will 67 * platform_data->set_mode_hook(NULL, NULL);
67 cause undefined result. 68 *
68 69 * (hook function and driver private data are NULL)
69*/ 70 *
71 * After that board/platform code must not call driver hook function! It
72 * is possible that pointer to hook function will not be valid and calling
73 * will cause undefined result.
74 */
70 75
71/* Supported modes with maximal current limit */ 76/* Supported modes with maximal current limit */
72enum bq2415x_mode { 77enum bq2415x_mode {