Lines Matching +full:reg +full:- +full:property
1 // SPDX-License-Identifier: GPL-2.0-only
3 * drivers/mfd/si476x-prop.c -- Subroutines to access
13 #include <linux/mfd/si476x-core.h>
46 u16 property) in si476x_core_is_valid_property_a10() argument
80 return si476x_core_element_is_in_range(property, valid_ranges, in si476x_core_is_valid_property_a10()
82 si476x_core_element_is_in_array(property, valid_properties, in si476x_core_is_valid_property_a10()
87 u16 property) in si476x_core_is_valid_property_a20() argument
100 return si476x_core_is_valid_property_a10(core, property) || in si476x_core_is_valid_property_a20()
101 si476x_core_element_is_in_range(property, valid_ranges, in si476x_core_is_valid_property_a20()
103 si476x_core_element_is_in_array(property, valid_properties, in si476x_core_is_valid_property_a20()
108 u16 property) in si476x_core_is_valid_property_a30() argument
126 return si476x_core_is_valid_property_a20(core, property) || in si476x_core_is_valid_property_a30()
127 si476x_core_element_is_in_range(property, valid_ranges, in si476x_core_is_valid_property_a30()
129 si476x_core_element_is_in_array(property, valid_properties, in si476x_core_is_valid_property_a30()
136 u16 property) in si476x_core_is_valid_property() argument
144 BUG_ON(core->revision > SI476X_REVISION_A30 || in si476x_core_is_valid_property()
145 core->revision == -1); in si476x_core_is_valid_property()
146 return is_valid_property[core->revision](core, property); in si476x_core_is_valid_property()
151 u16 property) in si476x_core_is_readonly_property() argument
153 BUG_ON(core->revision > SI476X_REVISION_A30 || in si476x_core_is_readonly_property()
154 core->revision == -1); in si476x_core_is_readonly_property()
156 switch (core->revision) { in si476x_core_is_readonly_property()
158 return (property == 0x3200); in si476x_core_is_readonly_property()
160 return (property == 0x1006 || in si476x_core_is_readonly_property()
161 property == 0x2210 || in si476x_core_is_readonly_property()
162 property == 0x3200); in si476x_core_is_readonly_property()
171 unsigned int reg) in si476x_core_regmap_readable_register() argument
176 return si476x_core_is_valid_property(core, (u16) reg); in si476x_core_regmap_readable_register()
181 unsigned int reg) in si476x_core_regmap_writable_register() argument
186 return si476x_core_is_valid_property(core, (u16) reg) && in si476x_core_regmap_writable_register()
187 !si476x_core_is_readonly_property(core, (u16) reg); in si476x_core_regmap_writable_register()
191 static int si476x_core_regmap_write(void *context, unsigned int reg, in si476x_core_regmap_write() argument
194 return si476x_core_cmd_set_property(context, reg, val); in si476x_core_regmap_write()
197 static int si476x_core_regmap_read(void *context, unsigned int reg, in si476x_core_regmap_read() argument
203 err = si476x_core_cmd_get_property(core, reg); in si476x_core_regmap_read()
230 return devm_regmap_init(&core->client->dev, NULL, in devm_regmap_init_si476x()