Blame view

include/linux/vexpress.h 1.44 KB
3ecbf05be   Pawel Moll   mfd: Versatile Ex...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
  /*
   * 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.
   *
   * 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.
   *
   * Copyright (C) 2012 ARM Limited
   */
  
  #ifndef _LINUX_VEXPRESS_H
  #define _LINUX_VEXPRESS_H
  
  #include <linux/device.h>
3b9334ac8   Pawel Moll   mfd: vexpress: Co...
18
  #include <linux/regmap.h>
3ecbf05be   Pawel Moll   mfd: Versatile Ex...
19
20
21
22
23
  
  #define VEXPRESS_SITE_MB		0
  #define VEXPRESS_SITE_DB1		1
  #define VEXPRESS_SITE_DB2		2
  #define VEXPRESS_SITE_MASTER		0xf
3b9334ac8   Pawel Moll   mfd: vexpress: Co...
24
  /* Config infrastructure */
3ecbf05be   Pawel Moll   mfd: Versatile Ex...
25

3b9334ac8   Pawel Moll   mfd: vexpress: Co...
26
27
  void vexpress_config_set_master(u32 site);
  u32 vexpress_config_get_master(void);
3ecbf05be   Pawel Moll   mfd: Versatile Ex...
28

3b9334ac8   Pawel Moll   mfd: vexpress: Co...
29
30
  void vexpress_config_lock(void *arg);
  void vexpress_config_unlock(void *arg);
3ecbf05be   Pawel Moll   mfd: Versatile Ex...
31

3b9334ac8   Pawel Moll   mfd: vexpress: Co...
32
33
  int vexpress_config_get_topo(struct device_node *node, u32 *site,
  		u32 *position, u32 *dcc);
3ecbf05be   Pawel Moll   mfd: Versatile Ex...
34

3b9334ac8   Pawel Moll   mfd: vexpress: Co...
35
  /* Config bridge API */
3ecbf05be   Pawel Moll   mfd: Versatile Ex...
36

3b9334ac8   Pawel Moll   mfd: vexpress: Co...
37
38
39
40
  struct vexpress_config_bridge_ops {
  	struct regmap * (*regmap_init)(struct device *dev, void *context);
  	void (*regmap_exit)(struct regmap *regmap, void *context);
  };
3ecbf05be   Pawel Moll   mfd: Versatile Ex...
41

3b9334ac8   Pawel Moll   mfd: vexpress: Co...
42
43
  struct device *vexpress_config_bridge_register(struct device *parent,
  		struct vexpress_config_bridge_ops *ops, void *context);
3ecbf05be   Pawel Moll   mfd: Versatile Ex...
44

3b9334ac8   Pawel Moll   mfd: vexpress: Co...
45
  /* Config regmap API */
3ecbf05be   Pawel Moll   mfd: Versatile Ex...
46

3b9334ac8   Pawel Moll   mfd: vexpress: Co...
47
  struct regmap *devm_regmap_init_vexpress_config(struct device *dev);
3ecbf05be   Pawel Moll   mfd: Versatile Ex...
48

88e0abcd7   Pawel Moll   mfd: Versatile Ex...
49
  /* Platform control */
88e0abcd7   Pawel Moll   mfd: Versatile Ex...
50
  void vexpress_flags_set(u32 data);
3ecbf05be   Pawel Moll   mfd: Versatile Ex...
51
  #endif