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
136 out = acpi_evaluate_dsm(context->handle, &context->guid, rev, in sar_get_device_mode()
143 context->sar_data.device_mode = value; in sar_get_device_mode()
144 update_sar_data(context); in sar_get_device_mode()
160 struct wwan_sar_context *context = dev_get_drvdata(dev); in intc_data_show() local
162 return sysfs_emit(buf, "%d %d %d %d\n", context->sar_data.device_mode, in intc_data_show()
163 context->sar_data.bandtable_index, in intc_data_show()
164 context->sar_data.antennatable_index, in intc_data_show()
165 context->sar_data.sartable_index); in intc_data_show()
171 struct wwan_sar_context *context = dev_get_drvdata(dev); in intc_reg_show() local
173 return sysfs_emit(buf, "%d\n", context->reg_value); in intc_reg_show()
179 struct wwan_sar_context *context = dev_get_drvdata(dev); in intc_reg_store() local
190 context->reg_value = value; in intc_reg_store()
191 update_sar_data(context); in intc_reg_store()
217 static void sar_get_data(int reg, struct wwan_sar_context *context) in sar_get_data() argument
224 out = acpi_evaluate_dsm(context->handle, &context->guid, rev, in sar_get_data()
233 context->config_data[reg].version = out->package.elements[0].integer.value; in sar_get_data()
234 context->config_data[reg].total_dev_mode = in sar_get_data()
236 if (context->config_data[reg].total_dev_mode <= 0 || in sar_get_data()
237 context->config_data[reg].total_dev_mode > MAX_DEV_MODES) { in sar_get_data()
241 parse_package(context, &out->package.elements[2]); in sar_get_data()
248 struct wwan_sar_context *context; in sar_probe() local
252 context = kzalloc(sizeof(*context), GFP_KERNEL); in sar_probe()
253 if (!context) in sar_probe()
256 context->sar_device = device; in sar_probe()
257 context->handle = ACPI_HANDLE(&device->dev); in sar_probe()
258 dev_set_drvdata(&device->dev, context); in sar_probe()
260 result = guid_parse(SAR_DSM_UUID, &context->guid); in sar_probe()
267 sar_get_data(reg, context); in sar_probe()
292 kfree(context); in sar_probe()
298 struct wwan_sar_context *context = dev_get_drvdata(&device->dev); in sar_remove() local
305 kfree(context->config_data[reg].device_mode_info); in sar_remove()
307 kfree(context); in sar_remove()