/* * INT3402 thermal driver for memory temperature reporting * * Copyright (C) 2014, Intel Corporation * Authors: Aaron Lu * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * */ #include #include #include #include #include "int340x_thermal_zone.h" #define INT3402_PERF_CHANGED_EVENT 0x80 #define INT3402_THERMAL_EVENT 0x90 struct int3402_thermal_data { acpi_handle *handle; struct int34x_thermal_zone *int340x_zone; }; static void int3402_notify(acpi_handle handle, u32 event, void *data) { struct int3402_thermal_data *priv = data; if (!priv) return; switch (event) { case INT3402_PERF_CHANGED_EVENT: break; case INT3402_THERMAL_EVENT: int340x_thermal_zone_device_update(priv->int340x_zone, THERMAL_TRIP_VIOLATED); break; default: break; } } static int int3402_thermal_probe(struct platform_device *pdev) { struct acpi_device *adev = ACPI_COMPANION(&pdev->dev); struct int3402_thermal_data *d; int ret; if (!acpi_has_method(adev->handle, "_TMP")) return -ENODEV; d = devm_kzalloc(&pdev->dev, sizeof(*d), GFP_KERNEL); if (!d) return -ENOMEM; d->int340x_zone = int340x_thermal_zone_add(adev, NULL); if (IS_ERR(d->int340x_zone)) return PTR_ERR(d->int340x_zone); ret = acpi_install_notify_handler(adev->handle, ACPI_DEVICE_NOTIFY, int3402_notify, d); if (ret) { int340x_thermal_zone_remove(d->int340x_zone); return ret; } d->handle = adev->handle; platform_set_drvdata(pdev, d); return 0; } static int int3402_thermal_remove(struct platform_device *pdev) { struct int3402_thermal_data *d = platform_get_drvdata(pdev); acpi_remove_notify_handler(d->handle, ACPI_DEVICE_NOTIFY, int3402_notify); int340x_thermal_zone_remove(d->int340x_zone); return 0; } static const struct acpi_device_id int3402_thermal_match[] = { {"INT3402", 0}, {} }; MODULE_DEVICE_TABLE(acpi, int3402_thermal_match); static struct platform_driver int3402_thermal_driver = { .probe = int3402_thermal_probe, .remove = int3402_thermal_remove, .driver = { .name = "int3402 thermal", .acpi_match_table = int3402_thermal_match, }, }; module_platform_driver(int3402_thermal_driver); MODULE_DESCRIPTION("INT3402 Thermal driver"); MODULE_LICENSE("GPL"); 1303736638aa923b40c9e107b64e6d2b7af499d'/>
ame='ignorews' onchange='this.form.submit();'>
AgeCommit message (Expand)AuthorFilesLines
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-01-24 16:54:39 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2017-01-24 16:54:39 -0800
commit883af14e67e8b8702b5560aa64c888c0cd0bd66c (patch)
tree74e3a6b53f5fad9f7848ab1b9f6921b7012940a4 /sound/oss/uart401.c
parent0263d4ebd94b36280608e296cba39b924b6e832b (diff)
parentaab45453ff5c77200c6da4ac909f7a4392aed17e (diff)
Merge branch 'akpm' (patches from Andrew)
Merge fixes from Andrew Morton: "26 fixes" * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (26 commits) MAINTAINERS: add Dan Streetman to zbud maintainers MAINTAINERS: add Dan Streetman to zswap maintainers mm: do not export ioremap_page_range symbol for external module mn10300: fix build error of missing fpu_save() romfs: use different way to generate fsid for BLOCK or MTD frv: add missing atomic64 operations mm, page_alloc: fix premature OOM when racing with cpuset mems update mm, page_alloc: move cpuset seqcount checking to slowpath mm, page_alloc: fix fast-path race with cpuset update or removal mm, page_alloc: fix check for NULL preferred_zone kernel/panic.c: add missing \n fbdev: color map copying bounds checking frv: add atomic64_add_unless() mm/mempolicy.c: do not put mempolicy before using its nodemask radix-tree: fix private list warnings Documentation/filesystems/proc.txt: add VmPin mm, memcg: do not retry precharge charges proc: add a schedule point in proc_pid_readdir() mm: alloc_contig: re-allow CMA to compact FS pages mm/slub.c: trace free objects at KERN_INFO ...
Diffstat (limited to 'sound/oss/uart401.c')