Lines Matching full:context
33 * @context: pointer to driver context structure
36 * context->reg_value will never exceed MAX_REGULATORY
38 static void update_sar_data(struct wwan_sar_context *context) in update_sar_data() argument
41 &context->config_data[context->reg_value]; in update_sar_data()
44 context->sar_data.device_mode < config->total_dev_mode) { in update_sar_data()
48 if (context->sar_data.device_mode == in update_sar_data()
53 context->sar_data.antennatable_index = dev_mode->antennatable_index; in update_sar_data()
54 context->sar_data.bandtable_index = dev_mode->bandtable_index; in update_sar_data()
55 context->sar_data.sartable_index = dev_mode->sartable_index; in update_sar_data()
64 * @context: pointer to driver context structure
69 * skipped and the specific entry in context structure will have the default value
77 static acpi_status parse_package(struct wwan_sar_context *context, union acpi_object *item) in parse_package() argument
89 data = &context->config_data[reg]; in parse_package()
130 struct wwan_sar_context *context = dev_get_drvdata(&device->dev); in sar_get_device_mode() local
135 out = acpi_evaluate_dsm_typed(context->handle, &context->guid, rev, in sar_get_device_mode()
142 context->sar_data.device_mode = out->integer.value; in sar_get_device_mode()
143 update_sar_data(context); in sar_get_device_mode()
159 struct wwan_sar_context *context = dev_get_drvdata(dev); in intc_data_show() local
161 return sysfs_emit(buf, "%d %d %d %d\n", context->sar_data.device_mode, in intc_data_show()
162 context->sar_data.bandtable_index, in intc_data_show()
163 context->sar_data.antennatable_index, in intc_data_show()
164 context->sar_data.sartable_index); in intc_data_show()
170 struct wwan_sar_context *context = dev_get_drvdata(dev); in intc_reg_show() local
172 return sysfs_emit(buf, "%d\n", context->reg_value); in intc_reg_show()
178 struct wwan_sar_context *context = dev_get_drvdata(dev); in intc_reg_store() local
189 context->reg_value = value; in intc_reg_store()
190 update_sar_data(context); in intc_reg_store()
216 static void sar_get_data(int reg, struct wwan_sar_context *context) in sar_get_data() argument
223 out = acpi_evaluate_dsm_typed(context->handle, &context->guid, rev, in sar_get_data()
232 context->config_data[reg].version = out->package.elements[0].integer.value; in sar_get_data()
233 context->config_data[reg].total_dev_mode = in sar_get_data()
235 if (context->config_data[reg].total_dev_mode <= 0 || in sar_get_data()
236 context->config_data[reg].total_dev_mode > MAX_DEV_MODES) { in sar_get_data()
240 parse_package(context, &out->package.elements[2]); in sar_get_data()
247 struct wwan_sar_context *context; in sar_probe() local
251 context = kzalloc(sizeof(*context), GFP_KERNEL); in sar_probe()
252 if (!context) in sar_probe()
255 context->sar_device = device; in sar_probe()
256 context->handle = ACPI_HANDLE(&device->dev); in sar_probe()
257 dev_set_drvdata(&device->dev, context); in sar_probe()
259 result = guid_parse(SAR_DSM_UUID, &context->guid); in sar_probe()
266 sar_get_data(reg, context); in sar_probe()
291 kfree(context); in sar_probe()
297 struct wwan_sar_context *context = dev_get_drvdata(&device->dev); in sar_remove() local
304 kfree(context->config_data[reg].device_mode_info); in sar_remove()
306 kfree(context); in sar_remove()