ocfs2: fix several issues of append dio
[linux/fpc-iii.git] / drivers / pwm / pwm-lpss-pci.c
blob45042c1b20463eeb1750c166731992d17a75caf6
1 /*
2 * Intel Low Power Subsystem PWM controller PCI driver
4 * Copyright (C) 2014, Intel Corporation
6 * Derived from the original pwm-lpss.c
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
13 #include <linux/kernel.h>
14 #include <linux/module.h>
15 #include <linux/pci.h>
17 #include "pwm-lpss.h"
19 static int pwm_lpss_probe_pci(struct pci_dev *pdev,
20 const struct pci_device_id *id)
22 const struct pwm_lpss_boardinfo *info;
23 struct pwm_lpss_chip *lpwm;
24 int err;
26 err = pcim_enable_device(pdev);
27 if (err < 0)
28 return err;
30 info = (struct pwm_lpss_boardinfo *)id->driver_data;
31 lpwm = pwm_lpss_probe(&pdev->dev, &pdev->resource[0], info);
32 if (IS_ERR(lpwm))
33 return PTR_ERR(lpwm);
35 pci_set_drvdata(pdev, lpwm);
36 return 0;
39 static void pwm_lpss_remove_pci(struct pci_dev *pdev)
41 struct pwm_lpss_chip *lpwm = pci_get_drvdata(pdev);
43 pwm_lpss_remove(lpwm);
46 static const struct pci_device_id pwm_lpss_pci_ids[] = {
47 { PCI_VDEVICE(INTEL, 0x0ac8), (unsigned long)&pwm_lpss_bsw_info},
48 { PCI_VDEVICE(INTEL, 0x0f08), (unsigned long)&pwm_lpss_byt_info},
49 { PCI_VDEVICE(INTEL, 0x0f09), (unsigned long)&pwm_lpss_byt_info},
50 { PCI_VDEVICE(INTEL, 0x1ac8), (unsigned long)&pwm_lpss_bsw_info},
51 { PCI_VDEVICE(INTEL, 0x2288), (unsigned long)&pwm_lpss_bsw_info},
52 { PCI_VDEVICE(INTEL, 0x2289), (unsigned long)&pwm_lpss_bsw_info},
53 { },
55 MODULE_DEVICE_TABLE(pci, pwm_lpss_pci_ids);
57 static struct pci_driver pwm_lpss_driver_pci = {
58 .name = "pwm-lpss",
59 .id_table = pwm_lpss_pci_ids,
60 .probe = pwm_lpss_probe_pci,
61 .remove = pwm_lpss_remove_pci,
63 module_pci_driver(pwm_lpss_driver_pci);
65 MODULE_DESCRIPTION("PWM PCI driver for Intel LPSS");
66 MODULE_LICENSE("GPL v2");