Lines Matching +full:address +full:- +full:address +full:- +full:data

1 // SPDX-License-Identifier: GPL-2.0
19 u32 address; /* operation region address */ member
38 .address = 0x00,
44 .address = 0x04,
50 .address = 0x08,
56 .address = 0x0C,
62 .address = 0x10,
68 .address = 0x14,
78 .address = 0x00,
84 .address = 0x04,
90 .address = 0x08,
96 .address = 0x0C,
102 .address = 0x10,
108 .address = 0x14,
114 .address = 0x18,
124 .address = 0x00,
130 .address = 0x04,
136 .address = 0x08,
142 .address = 0x0C,
148 .address = 0x10,
154 .address = 0x14,
160 .address = 0x18,
170 .address = 0x00,
176 .address = 0x04,
182 .address = 0x08,
189 .address = 0x0C,
197 static int pmic_get_reg_bit(u64 address, in pmic_get_reg_bit() argument
204 i = address / 4; in pmic_get_reg_bit()
206 return -ENOENT; in pmic_get_reg_bit()
209 return -EINVAL; in pmic_get_reg_bit()
220 unsigned int data; in tps68470_pmic_get_power() local
222 if (regmap_read(regmap, reg, &data)) in tps68470_pmic_get_power()
223 return -EIO; in tps68470_pmic_get_power()
225 *value = (data & bitmask) ? 1 : 0; in tps68470_pmic_get_power()
232 unsigned int data; in tps68470_pmic_get_vr_val() local
234 if (regmap_read(regmap, reg, &data)) in tps68470_pmic_get_vr_val()
235 return -EIO; in tps68470_pmic_get_vr_val()
237 *value = data & bitmask; in tps68470_pmic_get_vr_val()
244 unsigned int data; in tps68470_pmic_get_clk() local
246 if (regmap_read(regmap, reg, &data)) in tps68470_pmic_get_clk()
247 return -EIO; in tps68470_pmic_get_clk()
249 *value = (data & bitmask) ? 1 : 0; in tps68470_pmic_get_clk()
256 unsigned int data; in tps68470_pmic_get_clk_freq() local
258 if (regmap_read(regmap, reg, &data)) in tps68470_pmic_get_clk_freq()
259 return -EIO; in tps68470_pmic_get_clk_freq()
261 *value = data & bitmask; in tps68470_pmic_get_clk_freq()
272 acpi_physical_address address, in tps68470_pmic_common_handler() argument
283 struct regmap *regmap = opregion->regmap; in tps68470_pmic_common_handler()
289 ret = pmic_get_reg_bit(address, tbl, tbl_size, &reg, &bitmask); in tps68470_pmic_common_handler()
296 mutex_lock(&opregion->lock); in tps68470_pmic_common_handler()
302 mutex_unlock(&opregion->lock); in tps68470_pmic_common_handler()
308 acpi_physical_address address, in tps68470_pmic_cfreq_handler() argument
313 return tps68470_pmic_common_handler(function, address, bits, value, in tps68470_pmic_cfreq_handler()
322 acpi_physical_address address, u32 bits, in tps68470_pmic_clk_handler() argument
326 return tps68470_pmic_common_handler(function, address, bits, value, in tps68470_pmic_clk_handler()
335 acpi_physical_address address, in tps68470_pmic_vrval_handler() argument
340 return tps68470_pmic_common_handler(function, address, bits, value, in tps68470_pmic_vrval_handler()
349 acpi_physical_address address, in tps68470_pmic_pwr_handler() argument
363 return tps68470_pmic_common_handler(function, address, bits, value, in tps68470_pmic_pwr_handler()
373 struct regmap *tps68470_regmap = dev_get_drvdata(pdev->dev.parent); in tps68470_pmic_opregion_probe()
374 acpi_handle handle = ACPI_HANDLE(pdev->dev.parent); in tps68470_pmic_opregion_probe()
375 struct device *dev = &pdev->dev; in tps68470_pmic_opregion_probe()
380 return dev_err_probe(dev, -EINVAL, "regmap is missing\n"); in tps68470_pmic_opregion_probe()
384 return -ENODEV; in tps68470_pmic_opregion_probe()
389 return -ENOMEM; in tps68470_pmic_opregion_probe()
391 mutex_init(&opregion->lock); in tps68470_pmic_opregion_probe()
392 opregion->regmap = tps68470_regmap; in tps68470_pmic_opregion_probe()
434 mutex_destroy(&opregion->lock); in tps68470_pmic_opregion_probe()
435 return -ENODEV; in tps68470_pmic_opregion_probe()