summaryrefstree
path: root/kernel/drivers/battery_v2/sec_pd.c
blob: 4f2d807354a4877b3f04530695f1035449b73846 (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
/*
 * Copyrights (C) 2017 Samsung Electronics, Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * 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.
 */

#include <linux/notifier.h>

#if defined(CONFIG_BATTERY_NOTIFIER)
#include <linux/battery/battery_notifier.h>
#endif

struct pdic_notifier_struct pd_noti;
EXPORT_SYMBOL(pd_noti);

void (*fp_select_pdo)(int num);
EXPORT_SYMBOL(fp_select_pdo);
int (*fp_sec_pd_select_pps)(int num, int ppsVol, int ppsCur);
EXPORT_SYMBOL(fp_sec_pd_select_pps);
int (*fp_sec_pd_get_apdo_max_power)(unsigned int *pdo_pos, unsigned int *taMaxVol, unsigned int *taMaxCur, unsigned int *taMaxPwr);
EXPORT_SYMBOL(fp_sec_pd_get_apdo_max_power);

void select_pdo(int num)
{
	if (fp_select_pdo)
		fp_select_pdo(num);
}
EXPORT_SYMBOL(select_pdo);

int sec_pd_select_pps(int num, int ppsVol, int ppsCur)
{
	if (fp_sec_pd_select_pps)
		return fp_sec_pd_select_pps(num, ppsVol, ppsCur);

	return 0;
}
EXPORT_SYMBOL(sec_pd_select_pps);

int sec_pd_get_apdo_max_power(unsigned int *pdo_pos, unsigned int *taMaxVol, unsigned int *taMaxCur, unsigned int *taMaxPwr)
{
	if (fp_sec_pd_get_apdo_max_power)
		return fp_sec_pd_get_apdo_max_power(pdo_pos, taMaxVol, taMaxCur, taMaxPwr);

	return -ENOTSUPP;
}
EXPORT_SYMBOL(sec_pd_get_apdo_max_power);