summaryrefslogtreecommitdiff
path: root/drivers/media/tuners
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2016-11-10 01:24:50 -0200
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-01-31 10:50:34 -0200
commit8efb34b280401acdaad19b6f1920af09d2628334 (patch)
tree9768e5e058b38f35b34d088497a286bc7840cc6e /drivers/media/tuners
parent35ef193b2aa35e404c08d0c9ad010cf171a88cbd (diff)
[media] it913x: add chip device ids for binding
Driver supports 2 different device versions, AX and BX. Use device IDs to pass chip version information to driver. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/tuners')
-rw-r--r--drivers/media/tuners/it913x.c11
-rw-r--r--drivers/media/tuners/it913x.h5
2 files changed, 10 insertions, 6 deletions
diff --git a/drivers/media/tuners/it913x.c b/drivers/media/tuners/it913x.c
index 39998066a347..27e5bc1c3cb5 100644
--- a/drivers/media/tuners/it913x.c
+++ b/drivers/media/tuners/it913x.c
@@ -390,6 +390,7 @@ static int it913x_probe(struct platform_device *pdev)
struct it913x_platform_data *pdata = pdev->dev.platform_data;
struct dvb_frontend *fe = pdata->fe;
struct it913x_dev *dev;
+ const struct platform_device_id *id = platform_get_device_id(pdev);
int ret;
char *chip_ver_str;
@@ -403,7 +404,7 @@ static int it913x_probe(struct platform_device *pdev)
dev->pdev = pdev;
dev->regmap = pdata->regmap;
dev->fe = pdata->fe;
- dev->chip_ver = pdata->chip_ver;
+ dev->chip_ver = id->driver_data;
dev->role = pdata->role;
fe->tuner_priv = dev;
@@ -441,6 +442,13 @@ static int it913x_remove(struct platform_device *pdev)
return 0;
}
+static const struct platform_device_id it913x_id_table[] = {
+ {"it9133ax-tuner", 1},
+ {"it9133bx-tuner", 2},
+ {},
+};
+MODULE_DEVICE_TABLE(platform, it913x_id_table);
+
static struct platform_driver it913x_driver = {
.driver = {
.name = "it913x",
@@ -448,6 +456,7 @@ static struct platform_driver it913x_driver = {
},
.probe = it913x_probe,
.remove = it913x_remove,
+ .id_table = it913x_id_table,
};
module_platform_driver(it913x_driver);
diff --git a/drivers/media/tuners/it913x.h b/drivers/media/tuners/it913x.h
index 9fb8e028176d..226f657228fb 100644
--- a/drivers/media/tuners/it913x.h
+++ b/drivers/media/tuners/it913x.h
@@ -25,21 +25,16 @@
* struct it913x_platform_data - Platform data for the it913x driver
* @regmap: af9033 demod driver regmap.
* @dvb_frontend: af9033 demod driver DVB frontend.
- * @chip_ver: Used chip version. 1=IT9133 AX, 2=IT9133 BX.
* @role: Chip role, single or dual configuration.
*/
struct it913x_platform_data {
struct regmap *regmap;
struct dvb_frontend *fe;
- unsigned int chip_ver:2;
#define IT913X_ROLE_SINGLE 0
#define IT913X_ROLE_DUAL_MASTER 1
#define IT913X_ROLE_DUAL_SLAVE 2
unsigned int role:2;
};
-/* Backwards compatibility */
-#define it913x_config it913x_platform_data
-
#endif