14 #include <linux/module.h>
18 #include <linux/slab.h>
22 #define MSIC_VENDOR(id) ((id >> 6) & 3)
23 #define MSIC_VERSION(id) (id & 0x3f)
24 #define MSIC_MAJOR(id) ('A' + ((id >> 3) & 7))
25 #define MSIC_MINOR(id) (id & 7)
32 #define MSIC_IRQ_STATUS(x) (INTEL_MSIC_IRQ_PHYS_BASE + ((x) - 2))
33 #define MSIC_IRQ_STATUS_ACCDET MSIC_IRQ_STATUS(INTEL_MSIC_ACCDET)
39 #define SCU_IPC_RWBUF_LIMIT 16
55 static struct resource msic_touch_resources[] = {
61 static struct resource msic_adc_resources[] = {
67 static struct resource msic_battery_resources[] = {
73 static struct resource msic_gpio_resources[] = {
79 static struct resource msic_audio_resources[] = {
96 static struct resource msic_hdmi_resources[] = {
102 static struct resource msic_thermal_resources[] = {
108 static struct resource msic_power_btn_resources[] = {
114 static struct resource msic_ocd_resources[] = {
124 static struct mfd_cell msic_devs[] = {
126 .name =
"msic_touch",
127 .num_resources =
ARRAY_SIZE(msic_touch_resources),
128 .resources = msic_touch_resources,
132 .num_resources =
ARRAY_SIZE(msic_adc_resources),
133 .resources = msic_adc_resources,
136 .
name =
"msic_battery",
137 .num_resources =
ARRAY_SIZE(msic_battery_resources),
138 .resources = msic_battery_resources,
142 .num_resources =
ARRAY_SIZE(msic_gpio_resources),
143 .resources = msic_gpio_resources,
146 .
name =
"msic_audio",
147 .num_resources =
ARRAY_SIZE(msic_audio_resources),
148 .resources = msic_audio_resources,
152 .num_resources =
ARRAY_SIZE(msic_hdmi_resources),
153 .resources = msic_hdmi_resources,
156 .
name =
"msic_thermal",
157 .num_resources =
ARRAY_SIZE(msic_thermal_resources),
158 .resources = msic_thermal_resources,
161 .
name =
"msic_power_btn",
162 .num_resources =
ARRAY_SIZE(msic_power_btn_resources),
163 .resources = msic_power_btn_resources,
167 .num_resources =
ARRAY_SIZE(msic_ocd_resources),
168 .resources = msic_ocd_resources,
180 static struct mfd_cell msic_other_devs[] = {
323 unsigned gpio = pdata->
ocd->gpio;
327 dev_err(&pdev->
dev,
"failed to register OCD GPIO\n");
333 dev_err(&pdev->
dev,
"no IRQ number for OCD GPIO\n");
387 dev_err(&pdev->
dev,
"no platform data passed\n");
394 dev_err(&pdev->
dev,
"failed to identify the MSIC chip (ID0)\n");
400 dev_err(&pdev->
dev,
"failed to identify the MSIC chip (ID1)\n");
405 dev_err(&pdev->
dev,
"invalid vendor ID: %x, %x\n", id0, id1);
423 dev_err(&pdev->
dev,
"failed to get SRAM iomem resource\n");
429 dev_err(&pdev->
dev,
"failed to map SRAM memory\n");
433 platform_set_drvdata(pdev, msic);
435 ret = intel_msic_init_devices(msic);
437 dev_err(&pdev->
dev,
"failed to initialize MSIC devices\n");
441 dev_info(&pdev->
dev,
"Intel MSIC version %c%d (vendor %#x)\n",
450 struct intel_msic *msic = platform_get_drvdata(pdev);
452 intel_msic_remove_devices(msic);
453 platform_set_drvdata(pdev,
NULL);
459 .probe = intel_msic_probe,
462 .name =
"intel_msic",