diff options
author | Antti Palosaari <crope@iki.fi> | 2014-03-16 17:13:05 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-03-24 16:21:56 -0400 |
commit | 320c63870941ef3bb6e08e979d894ad6d51340d7 (patch) | |
tree | 3f230ea2916689789f331be19bd0b5cff60f8b61 /drivers/media/tuners | |
parent | ed97a6fe5308e5982d118a25f0697b791af5ec50 (diff) |
[media] e4000: make VIDEO_V4L2 dependency optional
That tuner driver is mainly for DVB API, but there is some V4L2 API
controls for SDR usage. Make driver compile conditional so that V4L2
is not mandatory. Without the V4L2 support driver is build as a DVB
only, without SDR controls.
Fixes following errors reported by kbuild test robot:
ERROR: "v4l2_ctrl_auto_cluster" [drivers/media/tuners/e4000.ko] undefined!
ERROR: "v4l2_ctrl_new_std" [drivers/media/tuners/e4000.ko] undefined!
ERROR: "v4l2_ctrl_handler_init_class" [drivers/media/tuners/e4000.ko] undefined!
ERROR: "v4l2_ctrl_handler_free" [drivers/media/tuners/e4000.ko] undefined!
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Cc: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/tuners')
-rw-r--r-- | drivers/media/tuners/Kconfig | 2 | ||||
-rw-r--r-- | drivers/media/tuners/e4000.c | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/drivers/media/tuners/Kconfig b/drivers/media/tuners/Kconfig index 85c0d96439a5..a1284889cd15 100644 --- a/drivers/media/tuners/Kconfig +++ b/drivers/media/tuners/Kconfig | |||
@@ -203,7 +203,7 @@ config MEDIA_TUNER_TDA18212 | |||
203 | 203 | ||
204 | config MEDIA_TUNER_E4000 | 204 | config MEDIA_TUNER_E4000 |
205 | tristate "Elonics E4000 silicon tuner" | 205 | tristate "Elonics E4000 silicon tuner" |
206 | depends on MEDIA_SUPPORT && I2C && VIDEO_V4L2 | 206 | depends on MEDIA_SUPPORT && I2C |
207 | select REGMAP_I2C | 207 | select REGMAP_I2C |
208 | default m if !MEDIA_SUBDRV_AUTOSELECT | 208 | default m if !MEDIA_SUBDRV_AUTOSELECT |
209 | help | 209 | help |
diff --git a/drivers/media/tuners/e4000.c b/drivers/media/tuners/e4000.c index 67ecf1bbfa1f..90d93348f20c 100644 --- a/drivers/media/tuners/e4000.c +++ b/drivers/media/tuners/e4000.c | |||
@@ -269,6 +269,7 @@ static int e4000_get_if_frequency(struct dvb_frontend *fe, u32 *frequency) | |||
269 | return 0; | 269 | return 0; |
270 | } | 270 | } |
271 | 271 | ||
272 | #if IS_ENABLED(CONFIG_VIDEO_V4L2) | ||
272 | static int e4000_set_lna_gain(struct dvb_frontend *fe) | 273 | static int e4000_set_lna_gain(struct dvb_frontend *fe) |
273 | { | 274 | { |
274 | struct e4000 *s = fe->tuner_priv; | 275 | struct e4000 *s = fe->tuner_priv; |
@@ -456,6 +457,7 @@ static const struct v4l2_ctrl_ops e4000_ctrl_ops = { | |||
456 | .g_volatile_ctrl = e4000_g_volatile_ctrl, | 457 | .g_volatile_ctrl = e4000_g_volatile_ctrl, |
457 | .s_ctrl = e4000_s_ctrl, | 458 | .s_ctrl = e4000_s_ctrl, |
458 | }; | 459 | }; |
460 | #endif | ||
459 | 461 | ||
460 | static const struct dvb_tuner_ops e4000_tuner_ops = { | 462 | static const struct dvb_tuner_ops e4000_tuner_ops = { |
461 | .info = { | 463 | .info = { |
@@ -522,6 +524,7 @@ static int e4000_probe(struct i2c_client *client, | |||
522 | if (ret) | 524 | if (ret) |
523 | goto err; | 525 | goto err; |
524 | 526 | ||
527 | #if IS_ENABLED(CONFIG_VIDEO_V4L2) | ||
525 | /* Register controls */ | 528 | /* Register controls */ |
526 | v4l2_ctrl_handler_init(&s->hdl, 9); | 529 | v4l2_ctrl_handler_init(&s->hdl, 9); |
527 | s->bandwidth_auto = v4l2_ctrl_new_std(&s->hdl, &e4000_ctrl_ops, | 530 | s->bandwidth_auto = v4l2_ctrl_new_std(&s->hdl, &e4000_ctrl_ops, |
@@ -554,6 +557,7 @@ static int e4000_probe(struct i2c_client *client, | |||
554 | } | 557 | } |
555 | 558 | ||
556 | s->sd.ctrl_handler = &s->hdl; | 559 | s->sd.ctrl_handler = &s->hdl; |
560 | #endif | ||
557 | 561 | ||
558 | dev_info(&s->client->dev, | 562 | dev_info(&s->client->dev, |
559 | "%s: Elonics E4000 successfully identified\n", | 563 | "%s: Elonics E4000 successfully identified\n", |
@@ -584,7 +588,9 @@ static int e4000_remove(struct i2c_client *client) | |||
584 | 588 | ||
585 | dev_dbg(&client->dev, "%s:\n", __func__); | 589 | dev_dbg(&client->dev, "%s:\n", __func__); |
586 | 590 | ||
591 | #if IS_ENABLED(CONFIG_VIDEO_V4L2) | ||
587 | v4l2_ctrl_handler_free(&s->hdl); | 592 | v4l2_ctrl_handler_free(&s->hdl); |
593 | #endif | ||
588 | memset(&fe->ops.tuner_ops, 0, sizeof(struct dvb_tuner_ops)); | 594 | memset(&fe->ops.tuner_ops, 0, sizeof(struct dvb_tuner_ops)); |
589 | fe->tuner_priv = NULL; | 595 | fe->tuner_priv = NULL; |
590 | kfree(s); | 596 | kfree(s); |