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

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

Version: ~ [ linux-5.1-rc5 ] ~ [ linux-5.0.7 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.34 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.111 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.168 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.178 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.138 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.65 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.39.4 ] ~ [ linux-2.6.38.8 ] ~ [ linux-2.6.37.6 ] ~ [ linux-2.6.36.4 ] ~ [ linux-2.6.35.14 ] ~ [ linux-2.6.34.15 ] ~ [ linux-2.6.33.20 ] ~ [ 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_msic.c: MSIC platform data initialization file
  3  *
  4  * (C) Copyright 2013 Intel Corporation
  5  * Author: Sathyanarayanan Kuppuswamy <sathyanarayanan.kuppuswamy@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/kernel.h>
 14 #include <linux/interrupt.h>
 15 #include <linux/scatterlist.h>
 16 #include <linux/init.h>
 17 #include <linux/sfi.h>
 18 #include <linux/mfd/intel_msic.h>
 19 #include <asm/intel_scu_ipc.h>
 20 #include <asm/intel-mid.h>
 21 #include "platform_msic.h"
 22 
 23 struct intel_msic_platform_data msic_pdata;
 24 
 25 static struct resource msic_resources[] = {
 26         {
 27                 .start  = INTEL_MSIC_IRQ_PHYS_BASE,
 28                 .end    = INTEL_MSIC_IRQ_PHYS_BASE + 64 - 1,
 29                 .flags  = IORESOURCE_MEM,
 30         },
 31 };
 32 
 33 static struct platform_device msic_device = {
 34         .name           = "intel_msic",
 35         .id             = -1,
 36         .dev            = {
 37                 .platform_data  = &msic_pdata,
 38         },
 39         .num_resources  = ARRAY_SIZE(msic_resources),
 40         .resource       = msic_resources,
 41 };
 42 
 43 static int msic_scu_status_change(struct notifier_block *nb,
 44                                   unsigned long code, void *data)
 45 {
 46         if (code == SCU_DOWN) {
 47                 platform_device_unregister(&msic_device);
 48                 return 0;
 49         }
 50 
 51         return platform_device_register(&msic_device);
 52 }
 53 
 54 static int __init msic_init(void)
 55 {
 56         static struct notifier_block msic_scu_notifier = {
 57                 .notifier_call  = msic_scu_status_change,
 58         };
 59 
 60         /*
 61          * We need to be sure that the SCU IPC is ready before MSIC device
 62          * can be registered.
 63          */
 64         if (intel_mid_has_msic())
 65                 intel_scu_notifier_add(&msic_scu_notifier);
 66 
 67         return 0;
 68 }
 69 arch_initcall(msic_init);
 70 
 71 /*
 72  * msic_generic_platform_data - sets generic platform data for the block
 73  * @info: pointer to the SFI device table entry for this block
 74  * @block: MSIC block
 75  *
 76  * Function sets IRQ number from the SFI table entry for given device to
 77  * the MSIC platform data.
 78  */
 79 void *msic_generic_platform_data(void *info, enum intel_msic_block block)
 80 {
 81         struct sfi_device_table_entry *entry = info;
 82 
 83         BUG_ON(block < 0 || block >= INTEL_MSIC_BLOCK_LAST);
 84         msic_pdata.irq[block] = entry->irq;
 85 
 86         return NULL;
 87 }
 88 

~ [ 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