2 * platform_ipc.c: IPC platform library file
4 * (C) Copyright 2013 Intel Corporation
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
13 #include <linux/init.h>
14 #include <linux/kernel.h>
15 #include <linux/interrupt.h>
16 #include <linux/sfi.h>
17 #include <linux/gpio.h>
18 #include <asm/intel-mid.h>
19 #include "platform_ipc.h"
21 void __init ipc_device_handler(struct sfi_device_table_entry *pentry,
24 struct platform_device *pdev;
26 static struct resource res __initdata = {
28 .flags = IORESOURCE_IRQ,
31 pr_debug("IPC bus, name = %16.16s, irq = 0x%2x\n",
32 pentry->name, pentry->irq);
35 * We need to call platform init of IPC devices to fill misc_pdata
36 * structure. It will be used in msic_init for initialization.
39 pdata = dev->get_platform_data(pentry);
42 * On Medfield the platform device creation is handled by the MSIC
43 * MFD driver so we don't need to do it here.
45 if (intel_mid_has_msic())
48 pdev = platform_device_alloc(pentry->name, 0);
50 pr_err("out of memory for SFI platform device '%s'.\n",
54 res.start = pentry->irq;
55 platform_device_add_resources(pdev, &res, 1);
57 pdev->dev.platform_data = pdata;
58 intel_scu_device_register(pdev);
61 static const struct devs_id pmic_audio_dev_id __initconst = {
63 .type = SFI_DEV_TYPE_IPC,
65 .device_handler = &ipc_device_handler,
68 sfi_device(pmic_audio_dev_id);