~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/x86/platform/intel-mid/device_libs/platform_wdt.c

Version: ~ [ linux-5.13-rc7 ] ~ [ linux-5.12.12 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.45 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.127 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.195 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.237 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.273 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.273 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * platform_wdt.c: Watchdog platform library file
  3  *
  4  * (C) Copyright 2014 Intel Corporation
  5  * Author: David Cohen <david.a.cohen@linux.intel.com>
  6  *
  7  * This program is free software; you can redistribute it and/or
  8  * modify it under the terms of the GNU General Public License
  9  * as published by the Free Software Foundation; version 2
 10  * of the License.
 11  */
 12 
 13 #include <linux/init.h>
 14 #include <linux/interrupt.h>
 15 #include <linux/platform_device.h>
 16 #include <linux/platform_data/intel-mid_wdt.h>
 17 #include <asm/intel-mid.h>
 18 #include <asm/io_apic.h>
 19 
 20 #define TANGIER_EXT_TIMER0_MSI 12
 21 
 22 static struct platform_device wdt_dev = {
 23         .name = "intel_mid_wdt",
 24         .id = -1,
 25 };
 26 
 27 static int tangier_probe(struct platform_device *pdev)
 28 {
 29         int ioapic;
 30         int irq;
 31         struct intel_mid_wdt_pdata *pdata = pdev->dev.platform_data;
 32         struct io_apic_irq_attr irq_attr = { 0 };
 33 
 34         if (!pdata)
 35                 return -EINVAL;
 36 
 37         irq = pdata->irq;
 38         ioapic = mp_find_ioapic(irq);
 39         if (ioapic >= 0) {
 40                 int ret;
 41                 irq_attr.ioapic = ioapic;
 42                 irq_attr.ioapic_pin = irq;
 43                 irq_attr.trigger = 1;
 44                 /* irq_attr.polarity = 0; -> Active high */
 45                 ret = io_apic_set_pci_routing(NULL, irq, &irq_attr);
 46                 if (ret)
 47                         return ret;
 48         } else {
 49                 dev_warn(&pdev->dev, "cannot find interrupt %d in ioapic\n",
 50                          irq);
 51                 return -EINVAL;
 52         }
 53 
 54         return 0;
 55 }
 56 
 57 static struct intel_mid_wdt_pdata tangier_pdata = {
 58         .irq = TANGIER_EXT_TIMER0_MSI,
 59         .probe = tangier_probe,
 60 };
 61 
 62 static int __init register_mid_wdt(void)
 63 {
 64         if (intel_mid_identify_cpu() == INTEL_MID_CPU_CHIP_TANGIER) {
 65                 wdt_dev.dev.platform_data = &tangier_pdata;
 66                 return platform_device_register(&wdt_dev);
 67         }
 68 
 69         return -ENODEV;
 70 }
 71 
 72 rootfs_initcall(register_mid_wdt);
 73 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp