summaryrefslogtreecommitdiff
path: root/drivers/mfd/timberdale.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mfd/timberdale.c')
-rw-r--r--drivers/mfd/timberdale.c43
1 files changed, 17 insertions, 26 deletions
diff --git a/drivers/mfd/timberdale.c b/drivers/mfd/timberdale.c
index 436e34705af1..b059713db875 100644
--- a/drivers/mfd/timberdale.c
+++ b/drivers/mfd/timberdale.c
@@ -1,19 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-only
/*
* timberdale.c timberdale FPGA MFD driver
* Copyright (c) 2009 Intel Corporation
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* Supports:
@@ -23,8 +11,8 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pci.h>
-#include <linux/msi.h>
#include <linux/mfd/core.h>
+#include <linux/property.h>
#include <linux/slab.h>
#include <linux/timb_gpio.h>
@@ -38,7 +26,6 @@
#include <linux/spi/max7301.h>
#include <linux/spi/mc33880.h>
-#include <linux/platform_data/tsc2007.h>
#include <linux/platform_data/media/timb_radio.h>
#include <linux/platform_data/media/timb_video.h>
@@ -62,16 +49,21 @@ struct timberdale_device {
/*--------------------------------------------------------------------------*/
-static struct tsc2007_platform_data timberdale_tsc2007_platform_data = {
- .model = 2003,
- .x_plate_ohms = 100
+static const struct property_entry timberdale_tsc2007_properties[] = {
+ PROPERTY_ENTRY_U32("ti,x-plate-ohms", 100),
+ { }
+};
+
+static const struct software_node timberdale_tsc2007_node = {
+ .name = "tsc2007",
+ .properties = timberdale_tsc2007_properties,
};
static struct i2c_board_info timberdale_i2c_board_info[] = {
{
I2C_BOARD_INFO("tsc2007", 0x48),
- .platform_data = &timberdale_tsc2007_platform_data,
- .irq = IRQ_TIMBERDALE_TSC_INT
+ .irq = IRQ_TIMBERDALE_TSC_INT,
+ .swnode = &timberdale_tsc2007_node,
},
};
@@ -635,17 +627,16 @@ static const struct mfd_cell timberdale_cells_bar2[] = {
},
};
-static ssize_t show_fw_ver(struct device *dev, struct device_attribute *attr,
- char *buf)
+static ssize_t fw_ver_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
{
- struct pci_dev *pdev = to_pci_dev(dev);
- struct timberdale_device *priv = pci_get_drvdata(pdev);
+ struct timberdale_device *priv = dev_get_drvdata(dev);
return sprintf(buf, "%d.%d.%d\n", priv->fw.major, priv->fw.minor,
priv->fw.config);
}
-static DEVICE_ATTR(fw_ver, S_IRUGO, show_fw_ver, NULL);
+static DEVICE_ATTR_RO(fw_ver);
/*--------------------------------------------------------------------------*/
@@ -779,7 +770,6 @@ static int timb_probe(struct pci_dev *dev,
default:
dev_err(&dev->dev, "Unknown IP setup: %d.%d.%d\n",
priv->fw.major, priv->fw.minor, ip_setup);
- err = -ENODEV;
goto err_mfd;
}
@@ -868,4 +858,5 @@ module_pci_driver(timberdale_pci_driver);
MODULE_AUTHOR("Mocean Laboratories <info@mocean-labs.com>");
MODULE_VERSION(DRV_VERSION);
+MODULE_DESCRIPTION("Timberdale FPGA MFD driver");
MODULE_LICENSE("GPL v2");