Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) // SPDX-License-Identifier: GPL-2.0-only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  * drivers/mfd/si476x-prop.c -- Subroutines to access
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  * properties of si476x chips
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  * Copyright (C) 2012 Innovative Converged Devices(ICD)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  * Copyright (C) 2013 Andrey Smirnov
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9)  * Author: Andrey Smirnov <andrew.smirnov@gmail.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #include <linux/module.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) #include <linux/mfd/si476x-core.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) struct si476x_property_range {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) 	u16 low, high;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) static bool si476x_core_element_is_in_array(u16 element,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) 					    const u16 array[],
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) 					    size_t size)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) 	int i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) 	for (i = 0; i < size; i++)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) 		if (element == array[i])
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 			return true;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 	return false;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) static bool si476x_core_element_is_in_range(u16 element,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 					    const struct si476x_property_range range[],
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 					    size_t size)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 	int i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 	for (i = 0; i < size; i++)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 		if (element <= range[i].high && element >= range[i].low)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 			return true;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 	return false;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) static bool si476x_core_is_valid_property_a10(struct si476x_core *core,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 					      u16 property)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 	static const u16 valid_properties[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 		0x0000,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 		0x0500, 0x0501,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 		0x0600,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 		0x0709, 0x070C, 0x070D, 0x70E, 0x710,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 		0x0718,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 		0x1207, 0x1208,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 		0x2007,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 		0x2300,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 	static const struct si476x_property_range valid_ranges[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 		{ 0x0200, 0x0203 },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 		{ 0x0300, 0x0303 },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 		{ 0x0400, 0x0404 },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 		{ 0x0700, 0x0707 },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 		{ 0x1100, 0x1102 },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 		{ 0x1200, 0x1204 },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 		{ 0x1300, 0x1306 },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 		{ 0x2000, 0x2005 },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 		{ 0x2100, 0x2104 },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 		{ 0x2106, 0x2106 },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 		{ 0x2200, 0x220E },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 		{ 0x3100, 0x3104 },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 		{ 0x3207, 0x320F },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 		{ 0x3300, 0x3304 },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 		{ 0x3500, 0x3517 },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 		{ 0x3600, 0x3617 },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 		{ 0x3700, 0x3717 },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 		{ 0x4000, 0x4003 },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 	return	si476x_core_element_is_in_range(property, valid_ranges,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 						ARRAY_SIZE(valid_ranges)) ||
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 		si476x_core_element_is_in_array(property, valid_properties,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 						ARRAY_SIZE(valid_properties));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) static bool si476x_core_is_valid_property_a20(struct si476x_core *core,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 					      u16 property)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 	static const u16 valid_properties[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 		0x071B,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 		0x1006,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 		0x2210,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 		0x3401,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 	static const struct si476x_property_range valid_ranges[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 		{ 0x2215, 0x2219 },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 	return	si476x_core_is_valid_property_a10(core, property) ||
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 		si476x_core_element_is_in_range(property, valid_ranges,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 						ARRAY_SIZE(valid_ranges))  ||
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 		si476x_core_element_is_in_array(property, valid_properties,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 						ARRAY_SIZE(valid_properties));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) static bool si476x_core_is_valid_property_a30(struct si476x_core *core,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 					      u16 property)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 	static const u16 valid_properties[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 		0x071C, 0x071D,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 		0x1007, 0x1008,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 		0x220F, 0x2214,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 		0x2301,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 		0x3105, 0x3106,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 		0x3402,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 	static const struct si476x_property_range valid_ranges[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 		{ 0x0405, 0x0411 },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 		{ 0x2008, 0x200B },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 		{ 0x2220, 0x2223 },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 		{ 0x3100, 0x3106 },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 	return	si476x_core_is_valid_property_a20(core, property) ||
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 		si476x_core_element_is_in_range(property, valid_ranges,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 						ARRAY_SIZE(valid_ranges)) ||
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 		si476x_core_element_is_in_array(property, valid_properties,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) 						ARRAY_SIZE(valid_properties));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) typedef bool (*valid_property_pred_t) (struct si476x_core *, u16);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) static bool si476x_core_is_valid_property(struct si476x_core *core,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 					  u16 property)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 	static const valid_property_pred_t is_valid_property[] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 		[SI476X_REVISION_A10] = si476x_core_is_valid_property_a10,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 		[SI476X_REVISION_A20] = si476x_core_is_valid_property_a20,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 		[SI476X_REVISION_A30] = si476x_core_is_valid_property_a30,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 	};
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 	BUG_ON(core->revision > SI476X_REVISION_A30 ||
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 	       core->revision == -1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 	return is_valid_property[core->revision](core, property);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) static bool si476x_core_is_readonly_property(struct si476x_core *core,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 					     u16 property)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 	BUG_ON(core->revision > SI476X_REVISION_A30 ||
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 	       core->revision == -1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 	switch (core->revision) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 	case SI476X_REVISION_A10:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 		return (property == 0x3200);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) 	case SI476X_REVISION_A20:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 		return (property == 0x1006 ||
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 			property == 0x2210 ||
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 			property == 0x3200);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 	case SI476X_REVISION_A30:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 		return false;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 	return false;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) static bool si476x_core_regmap_readable_register(struct device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 						 unsigned int reg)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 	struct i2c_client *client = to_i2c_client(dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 	struct si476x_core *core = i2c_get_clientdata(client);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 	return si476x_core_is_valid_property(core, (u16) reg);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) static bool si476x_core_regmap_writable_register(struct device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 						 unsigned int reg)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 	struct i2c_client *client = to_i2c_client(dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 	struct si476x_core *core = i2c_get_clientdata(client);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 	return si476x_core_is_valid_property(core, (u16) reg) &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 		!si476x_core_is_readonly_property(core, (u16) reg);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) static int si476x_core_regmap_write(void *context, unsigned int reg,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 				    unsigned int val)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 	return si476x_core_cmd_set_property(context, reg, val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) static int si476x_core_regmap_read(void *context, unsigned int reg,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 				   unsigned *val)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 	struct si476x_core *core = context;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 	int err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 	err = si476x_core_cmd_get_property(core, reg);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 	if (err < 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 		return err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 	*val = err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 	return 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) static const struct regmap_config si476x_regmap_config = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 	.reg_bits = 16,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 	.val_bits = 16,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 	.max_register = 0x4003,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 	.writeable_reg = si476x_core_regmap_writable_register,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 	.readable_reg = si476x_core_regmap_readable_register,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 	.reg_read = si476x_core_regmap_read,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 	.reg_write = si476x_core_regmap_write,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 	.cache_type = REGCACHE_RBTREE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) struct regmap *devm_regmap_init_si476x(struct si476x_core *core)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 	return devm_regmap_init(&core->client->dev, NULL,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 				core, &si476x_regmap_config);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) EXPORT_SYMBOL_GPL(devm_regmap_init_si476x);