Add the rt linux 4.1.3-rt3 as base
[kvmfornfv.git] / kernel / arch / x86 / platform / intel-mid / device_libs / platform_msic_ocd.c
1 /*
2  * platform_msic_ocd.c: MSIC OCD platform data initilization 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/sfi.h>
17 #include <linux/init.h>
18 #include <linux/gpio.h>
19 #include <linux/mfd/intel_msic.h>
20 #include <asm/intel-mid.h>
21
22 #include "platform_msic.h"
23 #include "platform_ipc.h"
24
25 static void __init *msic_ocd_platform_data(void *info)
26 {
27         static struct intel_msic_ocd_pdata msic_ocd_pdata;
28         int gpio;
29
30         gpio = get_gpio_by_name("ocd_gpio");
31
32         if (gpio < 0)
33                 return NULL;
34
35         msic_ocd_pdata.gpio = gpio;
36         msic_pdata.ocd = &msic_ocd_pdata;
37
38         return msic_generic_platform_data(info, INTEL_MSIC_BLOCK_OCD);
39 }
40
41 static const struct devs_id msic_ocd_dev_id __initconst = {
42         .name = "msic_ocd",
43         .type = SFI_DEV_TYPE_IPC,
44         .delay = 1,
45         .get_platform_data = &msic_ocd_platform_data,
46         .device_handler = &ipc_device_handler,
47 };
48
49 sfi_device(msic_ocd_dev_id);