aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/scripts')
0 files changed, 0 insertions, 0 deletions
mit/drivers/mfd/abx500-core.c?id=6271299d273831bd8f5934e5d6ddf7756cae91f3'>6271299d2738
fa661258a27a











6271299d2738
fa661258a27a











6271299d2738
fa661258a27a












6271299d2738
fa661258a27a











6271299d2738
fa661258a27a










6271299d2738
fa661258a27a










6271299d2738
fa661258a27a




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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
                                        

                                      






                                                                   

                         


























                                                                   
                                                                      
                       
                               
 
                             
                                                   










                                                                    
                                          
                                                   








                                                                          
                                     











                                                                          
                                     











                                                                       
                                          












                                                                           
                                              











                                                            
                                    










                                                                           
                                                          










                                                                          
                                            




                                                          
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (C) 2007-2010 ST-Ericsson
 * Register access functions for the ABX500 Mixed Signal IC family.
 * Author: Mattias Wallin <mattias.wallin@stericsson.com>
 */

#include <linux/list.h>
#include <linux/slab.h>
#include <linux/err.h>
#include <linux/init.h>
#include <linux/export.h>
#include <linux/mfd/abx500.h>

static LIST_HEAD(abx500_list);

struct abx500_device_entry {
	struct list_head list;
	struct abx500_ops ops;
	struct device *dev;
};

static void lookup_ops(struct device *dev, struct abx500_ops **ops)
{
	struct abx500_device_entry *dev_entry;

	*ops = NULL;
	list_for_each_entry(dev_entry, &abx500_list, list) {
		if (dev_entry->dev == dev) {
			*ops = &dev_entry->ops;
			return;
		}
	}
}

int abx500_register_ops(struct device *dev, struct abx500_ops *ops)
{
	struct abx500_device_entry *dev_entry;

	dev_entry = devm_kzalloc(dev, sizeof(*dev_entry), GFP_KERNEL);
	if (!dev_entry)
		return -ENOMEM;

	dev_entry->dev = dev;
	memcpy(&dev_entry->ops, ops, sizeof(*ops));

	list_add_tail(&dev_entry->list, &abx500_list);
	return 0;
}
EXPORT_SYMBOL(abx500_register_ops);

void abx500_remove_ops(struct device *dev)
{
	struct abx500_device_entry *dev_entry, *tmp;

	list_for_each_entry_safe(dev_entry, tmp, &abx500_list, list)
		if (dev_entry->dev == dev)
			list_del(&dev_entry->list);
}
EXPORT_SYMBOL(abx500_remove_ops);

int abx500_set_register_interruptible(struct device *dev, u8 bank, u8 reg,
	u8 value)
{
	struct abx500_ops *ops;

	lookup_ops(dev->parent, &ops);