aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpi_lpss.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/acpi_lpss.c')
-rw-r--r--drivers/acpi/acpi_lpss.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c
index b1c95422ce74..652fd5ce303c 100644
--- a/drivers/acpi/acpi_lpss.c
+++ b/drivers/acpi/acpi_lpss.c
@@ -35,11 +35,16 @@ ACPI_MODULE_NAME("acpi_lpss");
35 35
36struct lpss_device_desc { 36struct lpss_device_desc {
37 bool clk_required; 37 bool clk_required;
38 const char *clk_parent; 38 const char *clkdev_name;
39 bool ltr_required; 39 bool ltr_required;
40 unsigned int prv_offset; 40 unsigned int prv_offset;
41}; 41};
42 42
43static struct lpss_device_desc lpss_dma_desc = {
44 .clk_required = true,
45 .clkdev_name = "hclk",
46};
47
43struct lpss_private_data { 48struct lpss_private_data {
44 void __iomem *mmio_base; 49 void __iomem *mmio_base;
45 resource_size_t mmio_size; 50 resource_size_t mmio_size;
@@ -49,7 +54,6 @@ struct lpss_private_data {
49 54
50static struct lpss_device_desc lpt_dev_desc = { 55static struct lpss_device_desc lpt_dev_desc = {
51 .clk_required = true, 56 .clk_required = true,
52 .clk_parent = "lpss_clk",
53 .prv_offset = 0x800, 57 .prv_offset = 0x800,
54 .ltr_required = true, 58 .ltr_required = true,
55}; 59};
@@ -60,6 +64,9 @@ static struct lpss_device_desc lpt_sdio_dev_desc = {
60}; 64};
61 65
62static const struct acpi_device_id acpi_lpss_device_ids[] = { 66static const struct acpi_device_id acpi_lpss_device_ids[] = {
67 /* Generic LPSS devices */
68 { "INTL9C60", (unsigned long)&lpss_dma_desc },
69
63 /* Lynxpoint LPSS devices */ 70 /* Lynxpoint LPSS devices */
64 { "INT33C0", (unsigned long)&lpt_dev_desc }, 71 { "INT33C0", (unsigned long)&lpt_dev_desc },
65 { "INT33C1", (unsigned long)&lpt_dev_desc }, 72 { "INT33C1", (unsigned long)&lpt_dev_desc },
@@ -91,16 +98,27 @@ static int register_device_clock(struct acpi_device *adev,
91 struct lpss_private_data *pdata) 98 struct lpss_private_data *pdata)
92{ 99{
93 const struct lpss_device_desc *dev_desc = pdata->dev_desc; 100 const struct lpss_device_desc *dev_desc = pdata->dev_desc;
101 struct lpss_clk_data *clk_data;
94 102
95 if (!lpss_clk_dev) 103 if (!lpss_clk_dev)
96 lpt_register_clock_device(); 104 lpt_register_clock_device();
97 105
98 if (!dev_desc->clk_parent || !pdata->mmio_base 106 clk_data = platform_get_drvdata(lpss_clk_dev);
107 if (!clk_data)
108 return -ENODEV;
109
110 if (dev_desc->clkdev_name) {
111 clk_register_clkdev(clk_data->clk, dev_desc->clkdev_name,
112 dev_name(&adev->dev));
113 return 0;
114 }
115
116 if (!pdata->mmio_base
99 || pdata->mmio_size < dev_desc->prv_offset + LPSS_CLK_SIZE) 117 || pdata->mmio_size < dev_desc->prv_offset + LPSS_CLK_SIZE)
100 return -ENODATA; 118 return -ENODATA;
101 119
102 pdata->clk = clk_register_gate(NULL, dev_name(&adev->dev), 120 pdata->clk = clk_register_gate(NULL, dev_name(&adev->dev),
103 dev_desc->clk_parent, 0, 121 clk_data->name, 0,
104 pdata->mmio_base + dev_desc->prv_offset, 122 pdata->mmio_base + dev_desc->prv_offset,
105 0, 0, NULL); 123 0, 0, NULL);
106 if (IS_ERR(pdata->clk)) 124 if (IS_ERR(pdata->clk))