i2c-scmi.c (3fbff91afbf0148e937b8718ed865b073c587d9f) i2c-scmi.c (bf6067a6caa6717c40156fd8dfa443fd568c193a)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * SMBus driver for ACPI SMBus CMI
4 *
5 * Copyright (C) 2009 Crane Cai <crane.cai@amd.com>
6 */
7
8#include <linux/module.h>
9#include <linux/platform_device.h>
10#include <linux/slab.h>
11#include <linux/kernel.h>
12#include <linux/stddef.h>
13#include <linux/i2c.h>
14#include <linux/acpi.h>
15
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * SMBus driver for ACPI SMBus CMI
4 *
5 * Copyright (C) 2009 Crane Cai <crane.cai@amd.com>
6 */
7
8#include <linux/module.h>
9#include <linux/platform_device.h>
10#include <linux/slab.h>
11#include <linux/kernel.h>
12#include <linux/stddef.h>
13#include <linux/i2c.h>
14#include <linux/acpi.h>
15
16/* SMBUS HID definition as supported by Microsoft Windows */
17#define ACPI_SMBUS_MS_HID "SMB0001"
18
19struct smbus_methods_t {
20 char *mt_info;
21 char *mt_sbr;
22 char *mt_sbw;
23};
24
25struct acpi_smbus_cmi {
26 acpi_handle handle;

--- 372 unchanged lines hidden (view full) ---

399
400 return 0;
401
402err:
403 kfree(smbus_cmi);
404 return ret;
405}
406
16struct smbus_methods_t {
17 char *mt_info;
18 char *mt_sbr;
19 char *mt_sbw;
20};
21
22struct acpi_smbus_cmi {
23 acpi_handle handle;

--- 372 unchanged lines hidden (view full) ---

396
397 return 0;
398
399err:
400 kfree(smbus_cmi);
401 return ret;
402}
403
407static void smbus_cmi_remove(struct platform_device *device)
404static int smbus_cmi_remove(struct platform_device *device)
408{
409 struct acpi_smbus_cmi *smbus_cmi = platform_get_drvdata(device);
410
411 i2c_del_adapter(&smbus_cmi->adapter);
412 kfree(smbus_cmi);
405{
406 struct acpi_smbus_cmi *smbus_cmi = platform_get_drvdata(device);
407
408 i2c_del_adapter(&smbus_cmi->adapter);
409 kfree(smbus_cmi);
410
411 return 0;
413}
414
415static struct platform_driver smbus_cmi_driver = {
416 .probe = smbus_cmi_probe,
412}
413
414static struct platform_driver smbus_cmi_driver = {
415 .probe = smbus_cmi_probe,
417 .remove_new = smbus_cmi_remove,
416 .remove = smbus_cmi_remove,
418 .driver = {
419 .name = "smbus_cmi",
420 .acpi_match_table = acpi_smbus_cmi_ids,
421 },
422};
423module_platform_driver(smbus_cmi_driver);
424
425MODULE_LICENSE("GPL");
426MODULE_AUTHOR("Crane Cai <crane.cai@amd.com>");
427MODULE_DESCRIPTION("ACPI SMBus CMI driver");
417 .driver = {
418 .name = "smbus_cmi",
419 .acpi_match_table = acpi_smbus_cmi_ids,
420 },
421};
422module_platform_driver(smbus_cmi_driver);
423
424MODULE_LICENSE("GPL");
425MODULE_AUTHOR("Crane Cai <crane.cai@amd.com>");
426MODULE_DESCRIPTION("ACPI SMBus CMI driver");