Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  * ACPI support for int340x thermal drivers
0004  *
0005  * Copyright (C) 2014, Intel Corporation
0006  * Authors: Zhang Rui <rui.zhang@intel.com>
0007  */
0008 
0009 #include <linux/acpi.h>
0010 #include <linux/module.h>
0011 
0012 #include "../internal.h"
0013 
0014 #define INT3401_DEVICE 0X01
0015 static const struct acpi_device_id int340x_thermal_device_ids[] = {
0016     {"INT3400"},
0017     {"INT3401", INT3401_DEVICE},
0018     {"INT3402"},
0019     {"INT3403"},
0020     {"INT3404"},
0021     {"INT3406"},
0022     {"INT3407"},
0023     {"INT3408"},
0024     {"INT3409"},
0025     {"INT340A"},
0026     {"INT340B"},
0027     {"INT3532"},
0028     {"INTC1040"},
0029     {"INTC1041"},
0030     {"INTC1042"},
0031     {"INTC1043"},
0032     {"INTC1044"},
0033     {"INTC1045"},
0034     {"INTC1046"},
0035     {"INTC1047"},
0036     {"INTC1048"},
0037     {"INTC1049"},
0038     {"INTC1050"},
0039     {"INTC1060"},
0040     {"INTC1061"},
0041     {"INTC1062"},
0042     {"INTC1063"},
0043     {"INTC1064"},
0044     {"INTC1065"},
0045     {"INTC1066"},
0046     {"INTC10A0"},
0047     {"INTC10A1"},
0048     {"INTC10A2"},
0049     {"INTC10A3"},
0050     {"INTC10A4"},
0051     {"INTC10A5"},
0052     {""},
0053 };
0054 
0055 static int int340x_thermal_handler_attach(struct acpi_device *adev,
0056                     const struct acpi_device_id *id)
0057 {
0058     if (IS_ENABLED(CONFIG_INT340X_THERMAL))
0059         acpi_create_platform_device(adev, NULL);
0060     /* Intel SoC DTS thermal driver needs INT3401 to set IRQ descriptor */
0061     else if (IS_ENABLED(CONFIG_INTEL_SOC_DTS_THERMAL) &&
0062          id->driver_data == INT3401_DEVICE)
0063         acpi_create_platform_device(adev, NULL);
0064     return 1;
0065 }
0066 
0067 static struct acpi_scan_handler int340x_thermal_handler = {
0068     .ids = int340x_thermal_device_ids,
0069     .attach = int340x_thermal_handler_attach,
0070 };
0071 
0072 void __init acpi_int340x_thermal_init(void)
0073 {
0074     acpi_scan_add_handler(&int340x_thermal_handler);
0075 }