Skip to content

Commit

Permalink
Merge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma
Browse files Browse the repository at this point in the history
Pull slave-dma fixes from Vinod Koul:
 "We have two patches from Andy & Rafael fixing the Lynxpoint dma"

* 'fixes' of git://git.infradead.org/users/vkoul/slave-dma:
  ACPI / LPSS: register clock device for Lynxpoint DMA properly
  dma: acpi-dma: parse CSRT to extract additional resources
  • Loading branch information
torvalds committed May 26, 2013
2 parents 6b3f7b5 + b59cc20 commit 27a24cf
Show file tree
Hide file tree
Showing 9 changed files with 211 additions and 173 deletions.
1 change: 0 additions & 1 deletion drivers/acpi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ acpi-y += processor_core.o
acpi-y += ec.o
acpi-$(CONFIG_ACPI_DOCK) += dock.o
acpi-y += pci_root.o pci_link.o pci_irq.o
acpi-y += csrt.o
acpi-$(CONFIG_X86_INTEL_LPSS) += acpi_lpss.o
acpi-y += acpi_platform.o
acpi-y += power.o
Expand Down
26 changes: 22 additions & 4 deletions drivers/acpi/acpi_lpss.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,16 @@ ACPI_MODULE_NAME("acpi_lpss");

struct lpss_device_desc {
bool clk_required;
const char *clk_parent;
const char *clkdev_name;
bool ltr_required;
unsigned int prv_offset;
};

static struct lpss_device_desc lpss_dma_desc = {
.clk_required = true,
.clkdev_name = "hclk",
};

struct lpss_private_data {
void __iomem *mmio_base;
resource_size_t mmio_size;
Expand All @@ -49,7 +54,6 @@ struct lpss_private_data {

static struct lpss_device_desc lpt_dev_desc = {
.clk_required = true,
.clk_parent = "lpss_clk",
.prv_offset = 0x800,
.ltr_required = true,
};
Expand All @@ -60,6 +64,9 @@ static struct lpss_device_desc lpt_sdio_dev_desc = {
};

static const struct acpi_device_id acpi_lpss_device_ids[] = {
/* Generic LPSS devices */
{ "INTL9C60", (unsigned long)&lpss_dma_desc },

/* Lynxpoint LPSS devices */
{ "INT33C0", (unsigned long)&lpt_dev_desc },
{ "INT33C1", (unsigned long)&lpt_dev_desc },
Expand Down Expand Up @@ -91,16 +98,27 @@ static int register_device_clock(struct acpi_device *adev,
struct lpss_private_data *pdata)
{
const struct lpss_device_desc *dev_desc = pdata->dev_desc;
struct lpss_clk_data *clk_data;

if (!lpss_clk_dev)
lpt_register_clock_device();

if (!dev_desc->clk_parent || !pdata->mmio_base
clk_data = platform_get_drvdata(lpss_clk_dev);
if (!clk_data)
return -ENODEV;

if (dev_desc->clkdev_name) {
clk_register_clkdev(clk_data->clk, dev_desc->clkdev_name,
dev_name(&adev->dev));
return 0;
}

if (!pdata->mmio_base
|| pdata->mmio_size < dev_desc->prv_offset + LPSS_CLK_SIZE)
return -ENODATA;

pdata->clk = clk_register_gate(NULL, dev_name(&adev->dev),
dev_desc->clk_parent, 0,
clk_data->name, 0,
pdata->mmio_base + dev_desc->prv_offset,
0, 0, NULL);
if (IS_ERR(pdata->clk))
Expand Down
159 changes: 0 additions & 159 deletions drivers/acpi/csrt.c

This file was deleted.

1 change: 0 additions & 1 deletion drivers/acpi/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ void acpi_pci_link_init(void);
void acpi_pci_root_hp_init(void);
void acpi_platform_init(void);
int acpi_sysfs_init(void);
void acpi_csrt_init(void);
#ifdef CONFIG_ACPI_CONTAINER
void acpi_container_init(void);
#else
Expand Down
1 change: 0 additions & 1 deletion drivers/acpi/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -2043,7 +2043,6 @@ int __init acpi_scan_init(void)
acpi_pci_link_init();
acpi_platform_init();
acpi_lpss_init();
acpi_csrt_init();
acpi_container_init();
acpi_memory_hotplug_init();

Expand Down
15 changes: 11 additions & 4 deletions drivers/clk/x86/clk-lpt.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,29 @@
#include <linux/clk-provider.h>
#include <linux/err.h>
#include <linux/module.h>
#include <linux/platform_data/clk-lpss.h>
#include <linux/platform_device.h>

#define PRV_CLOCK_PARAMS 0x800

static int lpt_clk_probe(struct platform_device *pdev)
{
struct lpss_clk_data *drvdata;
struct clk *clk;

drvdata = devm_kzalloc(&pdev->dev, sizeof(*drvdata), GFP_KERNEL);
if (!drvdata)
return -ENOMEM;

/* LPSS free running clock */
clk = clk_register_fixed_rate(&pdev->dev, "lpss_clk", NULL, CLK_IS_ROOT,
100000000);
drvdata->name = "lpss_clk";
clk = clk_register_fixed_rate(&pdev->dev, drvdata->name, NULL,
CLK_IS_ROOT, 100000000);
if (IS_ERR(clk))
return PTR_ERR(clk);

/* Shared DMA clock */
clk_register_clkdev(clk, "hclk", "INTL9C60.0.auto");
drvdata->clk = clk;
platform_set_drvdata(pdev, drvdata);
return 0;
}

Expand Down
Loading

0 comments on commit 27a24cf

Please sign in to comment.