Lines Matching refs:smbus_cmi
22 ACPI_MODULE_NAME("smbus_cmi");
86 struct acpi_smbus_cmi *smbus_cmi = adap->algo_data;
163 method = smbus_cmi->methods->mt_sbr;
167 method = smbus_cmi->methods->mt_sbw;
179 status = acpi_evaluate_object(smbus_cmi->handle, method, &input,
269 struct acpi_smbus_cmi *smbus_cmi = adapter->algo_data;
272 ret = smbus_cmi->cap_read | smbus_cmi->cap_write ?
275 ret |= smbus_cmi->cap_read ?
281 ret |= smbus_cmi->cap_write ?
296 static int acpi_smbus_cmi_add_cap(struct acpi_smbus_cmi *smbus_cmi,
303 if (!strcmp(name, smbus_cmi->methods->mt_info)) {
304 status = acpi_evaluate_object(smbus_cmi->handle,
305 smbus_cmi->methods->mt_info,
309 smbus_cmi->methods->mt_info, status));
331 smbus_cmi->cap_info = 1;
332 } else if (!strcmp(name, smbus_cmi->methods->mt_sbr))
333 smbus_cmi->cap_read = 1;
334 else if (!strcmp(name, smbus_cmi->methods->mt_sbw))
335 smbus_cmi->cap_write = 1;
348 struct acpi_smbus_cmi *smbus_cmi = context;
354 acpi_smbus_cmi_add_cap(smbus_cmi, node_name);
361 struct acpi_smbus_cmi *smbus_cmi;
364 smbus_cmi = kzalloc(sizeof(struct acpi_smbus_cmi), GFP_KERNEL);
365 if (!smbus_cmi)
368 smbus_cmi->handle = device->handle;
371 device->driver_data = smbus_cmi;
372 smbus_cmi->cap_info = 0;
373 smbus_cmi->cap_read = 0;
374 smbus_cmi->cap_write = 0;
378 smbus_cmi->methods =
381 acpi_walk_namespace(ACPI_TYPE_METHOD, smbus_cmi->handle, 1,
382 acpi_smbus_cmi_query_methods, NULL, smbus_cmi, NULL);
384 if (smbus_cmi->cap_info == 0)
387 snprintf(smbus_cmi->adapter.name, sizeof(smbus_cmi->adapter.name),
390 smbus_cmi->adapter.owner = THIS_MODULE;
391 smbus_cmi->adapter.algo = &acpi_smbus_cmi_algorithm;
392 smbus_cmi->adapter.algo_data = smbus_cmi;
393 smbus_cmi->adapter.class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
394 smbus_cmi->adapter.dev.parent = &device->dev;
396 if (i2c_add_adapter(&smbus_cmi->adapter)) {
404 kfree(smbus_cmi);
411 struct acpi_smbus_cmi *smbus_cmi = acpi_driver_data(device);
413 i2c_del_adapter(&smbus_cmi->adapter);
414 kfree(smbus_cmi);