blob: 19e795b307eb80d13e69b6dbdd9c010ab47bcc19 (
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
|
/*
* maxim_dsm_cal.c -- Module for Rdc calibration
*
* Copyright 2014 Maxim Integrated Products
*
* 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.
*/
#ifndef __SOUND_MAXIM_DSM_CAL_H__
#define __SOUND_MAXIM_DSM_CAL_H__
#define DRIVER_AUTHOR "Kyounghun Jeon<hun.jeon@maximintegrated.com>"
#define DRIVER_DESC "For Rdc calibration of MAX98xxx"
#define DRIVER_SUPPORTED "MAX98xxx"
#define WQ_NAME "maxdsm_wq"
#define FILEPATH_TEMP_CAL "/efs/maxim/temp_cal"
#define FILEPATH_RDC_CAL "/efs/maxim/rdc_cal"
#define FILEPATH_RDC_CAL_R "/efs/maxim/rdc_cal_r"
#define CLASS_NAME "maxdsm_cal"
#define DSM_NAME "dsm"
#define ADDR_RDC 0x2A0050
#define ADDR_FEATURE_ENABLE 0x2A006A
struct maxim_dsm_cal_info {
uint32_t min;
uint32_t max;
uint32_t feature_en;
int interval;
int duration;
int remaining;
int ignored_t;
unsigned long previous_jiffies;
};
struct maxim_dsm_cal_values {
uint32_t status;
int rdc;
int rdc_r;
int temp;
uint64_t avg;
uint64_t avg_r;
int count;
};
struct maxim_dsm_info_v_validation {
int duration;
};
struct maxim_dsm_values_v_validation {
uint32_t status;
int v_validation;
};
struct maxim_dsm_cal {
struct device *dev;
struct class *class;
struct mutex mutex;
struct workqueue_struct *wq;
struct delayed_work work;
struct delayed_work work_v_validation;
struct maxim_dsm_cal_values values;
struct maxim_dsm_cal_info info;
struct maxim_dsm_info_v_validation info_v_validation;
struct maxim_dsm_values_v_validation values_v_validation;
struct regmap *regmap;
uint32_t platform_type;
};
extern struct class *maxdsm_cal_get_class(void);
extern struct regmap *maxdsm_cal_set_regmap(
struct regmap *regmap);
extern int maxdsm_cal_get_temp(int *temp);
extern int maxdsm_cal_set_temp(int temp);
extern int maxdsm_cal_get_rdc(int *rdc);
extern int maxdsm_cal_get_rdc_r(int *rdc);
extern int maxdsm_cal_set_rdc(int rdc);
extern int maxdsm_cal_set_rdc_r(int rdc);
#endif /* __SOUND_MAXIM_DSM_CAL_H__ */
|