Lines Matching +full:dev +full:- +full:size
4 * SPDX-License-Identifier: Apache-2.0
27 size_t size; member
30 static int syscon_generic_get_base(const struct device *dev, uintptr_t *addr) in syscon_generic_get_base() argument
32 if (!dev) { in syscon_generic_get_base()
33 return -ENODEV; in syscon_generic_get_base()
36 *addr = DEVICE_MMIO_GET(dev); in syscon_generic_get_base()
40 static int syscon_generic_read_reg(const struct device *dev, uint16_t reg, uint32_t *val) in syscon_generic_read_reg() argument
46 if (!dev) { in syscon_generic_read_reg()
47 return -ENODEV; in syscon_generic_read_reg()
50 data = dev->data; in syscon_generic_read_reg()
51 config = dev->config; in syscon_generic_read_reg()
54 return -EINVAL; in syscon_generic_read_reg()
57 if (syscon_sanitize_reg(®, data->size, config->reg_width)) { in syscon_generic_read_reg()
58 return -EINVAL; in syscon_generic_read_reg()
61 base_address = DEVICE_MMIO_GET(dev); in syscon_generic_read_reg()
63 switch (config->reg_width) { in syscon_generic_read_reg()
74 return -EINVAL; in syscon_generic_read_reg()
80 static int syscon_generic_write_reg(const struct device *dev, uint16_t reg, uint32_t val) in syscon_generic_write_reg() argument
86 if (!dev) { in syscon_generic_write_reg()
87 return -ENODEV; in syscon_generic_write_reg()
90 data = dev->data; in syscon_generic_write_reg()
91 config = dev->config; in syscon_generic_write_reg()
93 if (syscon_sanitize_reg(®, data->size, config->reg_width)) { in syscon_generic_write_reg()
94 return -EINVAL; in syscon_generic_write_reg()
97 base_address = DEVICE_MMIO_GET(dev); in syscon_generic_write_reg()
99 switch (config->reg_width) { in syscon_generic_write_reg()
110 return -EINVAL; in syscon_generic_write_reg()
116 static int syscon_generic_get_size(const struct device *dev, size_t *size) in syscon_generic_get_size() argument
118 struct syscon_generic_data *data = dev->data; in syscon_generic_get_size()
120 *size = data->size; in syscon_generic_get_size()
131 static int syscon_generic_init(const struct device *dev) in syscon_generic_init() argument
133 DEVICE_MMIO_MAP(dev, K_MEM_CACHE_NONE); in syscon_generic_init()
144 .size = DT_INST_REG_SIZE(inst), \