2 * Copyright (c) 2015 Google, Inc
3 * Written by Simon Glass <sjg@chromium.org>
5 * SPDX-License-Identifier: GPL-2.0+
12 * struct syscon_uc_info - Information stored by the syscon UCLASS_UCLASS
14 * @regmap: Register map for this controller
16 struct syscon_uc_info {
17 struct regmap *regmap;
20 /* So far there are no ops so this is a placeholder */
24 #define syscon_get_ops(dev) ((struct syscon_ops *)(dev)->driver->ops)
27 * syscon_get_regmap() - Get access to a register map
29 * @dev: Device to check (UCLASS_SCON)
30 * @info: Returns regmap for the device
31 * @return 0 if OK, -ve on error
33 struct regmap *syscon_get_regmap(struct udevice *dev);
36 * syscon_get_regmap_by_driver_data() - Look up a controller by its ID
38 * Each system controller can be accessed by its driver data, which is
39 * assumed to be unique through the scope of all system controllers that
40 * are in use. This function looks up the regmap given this driver data.
42 * @driver_data: Driver data value to look up
43 * @return register map correponding to @driver_data, or -ve error code
45 struct regmap *syscon_get_regmap_by_driver_data(ulong driver_data);
48 * syscon_get_first_range() - get the first memory range from a syscon regmap
50 * @driver_data: Driver data value to look up
51 * @return first region of register map correponding to @driver_data, or
54 void *syscon_get_first_range(ulong driver_data);