|
@@ -24,6 +24,7 @@
|
|
#include <linux/mfd/core.h>
|
|
#include <linux/mfd/core.h>
|
|
#include <linux/pm_qos.h>
|
|
#include <linux/pm_qos.h>
|
|
#include <linux/pm_runtime.h>
|
|
#include <linux/pm_runtime.h>
|
|
|
|
+#include <linux/property.h>
|
|
#include <linux/seq_file.h>
|
|
#include <linux/seq_file.h>
|
|
#include <linux/io-64-nonatomic-lo-hi.h>
|
|
#include <linux/io-64-nonatomic-lo-hi.h>
|
|
|
|
|
|
@@ -72,7 +73,7 @@ struct intel_lpss {
|
|
enum intel_lpss_dev_type type;
|
|
enum intel_lpss_dev_type type;
|
|
struct clk *clk;
|
|
struct clk *clk;
|
|
struct clk_lookup *clock;
|
|
struct clk_lookup *clock;
|
|
- const struct mfd_cell *cell;
|
|
|
|
|
|
+ struct mfd_cell *cell;
|
|
struct device *dev;
|
|
struct device *dev;
|
|
void __iomem *priv;
|
|
void __iomem *priv;
|
|
int devid;
|
|
int devid;
|
|
@@ -217,6 +218,7 @@ static void intel_lpss_ltr_hide(struct intel_lpss *lpss)
|
|
|
|
|
|
static int intel_lpss_assign_devs(struct intel_lpss *lpss)
|
|
static int intel_lpss_assign_devs(struct intel_lpss *lpss)
|
|
{
|
|
{
|
|
|
|
+ const struct mfd_cell *cell;
|
|
unsigned int type;
|
|
unsigned int type;
|
|
|
|
|
|
type = lpss->caps & LPSS_PRIV_CAPS_TYPE_MASK;
|
|
type = lpss->caps & LPSS_PRIV_CAPS_TYPE_MASK;
|
|
@@ -224,18 +226,22 @@ static int intel_lpss_assign_devs(struct intel_lpss *lpss)
|
|
|
|
|
|
switch (type) {
|
|
switch (type) {
|
|
case LPSS_DEV_I2C:
|
|
case LPSS_DEV_I2C:
|
|
- lpss->cell = &intel_lpss_i2c_cell;
|
|
|
|
|
|
+ cell = &intel_lpss_i2c_cell;
|
|
break;
|
|
break;
|
|
case LPSS_DEV_UART:
|
|
case LPSS_DEV_UART:
|
|
- lpss->cell = &intel_lpss_uart_cell;
|
|
|
|
|
|
+ cell = &intel_lpss_uart_cell;
|
|
break;
|
|
break;
|
|
case LPSS_DEV_SPI:
|
|
case LPSS_DEV_SPI:
|
|
- lpss->cell = &intel_lpss_spi_cell;
|
|
|
|
|
|
+ cell = &intel_lpss_spi_cell;
|
|
break;
|
|
break;
|
|
default:
|
|
default:
|
|
return -ENODEV;
|
|
return -ENODEV;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ lpss->cell = devm_kmemdup(lpss->dev, cell, sizeof(*cell), GFP_KERNEL);
|
|
|
|
+ if (!lpss->cell)
|
|
|
|
+ return -ENOMEM;
|
|
|
|
+
|
|
lpss->type = type;
|
|
lpss->type = type;
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
@@ -401,6 +407,8 @@ int intel_lpss_probe(struct device *dev,
|
|
if (ret)
|
|
if (ret)
|
|
return ret;
|
|
return ret;
|
|
|
|
|
|
|
|
+ lpss->cell->pset = info->pset;
|
|
|
|
+
|
|
intel_lpss_init_dev(lpss);
|
|
intel_lpss_init_dev(lpss);
|
|
|
|
|
|
lpss->devid = ida_simple_get(&intel_lpss_devid_ida, 0, 0, GFP_KERNEL);
|
|
lpss->devid = ida_simple_get(&intel_lpss_devid_ida, 0, 0, GFP_KERNEL);
|