summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/i2c/cx25840/cx25840-core.c70
-rw-r--r--include/media/drv-intf/cx25840.h28
2 files changed, 51 insertions, 47 deletions
diff --git a/drivers/media/i2c/cx25840/cx25840-core.c b/drivers/media/i2c/cx25840/cx25840-core.c
index 8b0b8b5aa531..0bf30222cf93 100644
--- a/drivers/media/i2c/cx25840/cx25840-core.c
+++ b/drivers/media/i2c/cx25840/cx25840-core.c
@@ -1649,32 +1649,46 @@ static void log_audio_status(struct i2c_client *client)
1649 1649
1650/* ----------------------------------------------------------------------- */ 1650/* ----------------------------------------------------------------------- */
1651 1651
1652/* This load_fw operation must be called to load the driver's firmware. 1652static int cx25840_reset(struct v4l2_subdev *sd, u32 val)
1653 Without this the audio standard detection will fail and you will
1654 only get mono.
1655
1656 Since loading the firmware is often problematic when the driver is
1657 compiled into the kernel I recommend postponing calling this function
1658 until the first open of the video device. Another reason for
1659 postponing it is that loading this firmware takes a long time (seconds)
1660 due to the slow i2c bus speed. So it will speed up the boot process if
1661 you can avoid loading the fw as long as the video device isn't used. */
1662static int cx25840_load_fw(struct v4l2_subdev *sd)
1663{ 1653{
1664 struct cx25840_state *state = to_state(sd); 1654 struct cx25840_state *state = to_state(sd);
1665 struct i2c_client *client = v4l2_get_subdevdata(sd); 1655 struct i2c_client *client = v4l2_get_subdevdata(sd);
1666 1656
1657 if (is_cx2583x(state))
1658 cx25836_initialize(client);
1659 else if (is_cx2388x(state))
1660 cx23885_initialize(client);
1661 else if (is_cx231xx(state))
1662 cx231xx_initialize(client);
1663 else
1664 cx25840_initialize(client);
1665
1666 state->is_initialized = 1;
1667
1668 return 0;
1669}
1670
1671/*
1672 * This load_fw operation must be called to load the driver's firmware.
1673 * This will load the firmware on the first invocation (further ones are NOP).
1674 * Without this the audio standard detection will fail and you will
1675 * only get mono.
1676 * Alternatively, you can call the reset operation instead of this one.
1677 *
1678 * Since loading the firmware is often problematic when the driver is
1679 * compiled into the kernel I recommend postponing calling this function
1680 * until the first open of the video device. Another reason for
1681 * postponing it is that loading this firmware takes a long time (seconds)
1682 * due to the slow i2c bus speed. So it will speed up the boot process if
1683 * you can avoid loading the fw as long as the video device isn't used.
1684 */
1685static int cx25840_load_fw(struct v4l2_subdev *sd)
1686{
1687 struct cx25840_state *state = to_state(sd);
1688
1667 if (!state->is_initialized) { 1689 if (!state->is_initialized) {
1668 /* initialize and load firmware */ 1690 /* initialize and load firmware */
1669 state->is_initialized = 1; 1691 cx25840_reset(sd, 0);
1670 if (is_cx2583x(state))
1671 cx25836_initialize(client);
1672 else if (is_cx2388x(state))
1673 cx23885_initialize(client);
1674 else if (is_cx231xx(state))
1675 cx231xx_initialize(client);
1676 else
1677 cx25840_initialize(client);
1678 } 1692 }
1679 return 0; 1693 return 0;
1680} 1694}
@@ -1937,22 +1951,6 @@ static int cx25840_s_tuner(struct v4l2_subdev *sd, const struct v4l2_tuner *vt)
1937 return 0; 1951 return 0;
1938} 1952}
1939 1953
1940static int cx25840_reset(struct v4l2_subdev *sd, u32 val)
1941{
1942 struct cx25840_state *state = to_state(sd);
1943 struct i2c_client *client = v4l2_get_subdevdata(sd);
1944
1945 if (is_cx2583x(state))
1946 cx25836_initialize(client);
1947 else if (is_cx2388x(state))
1948 cx23885_initialize(client);
1949 else if (is_cx231xx(state))
1950 cx231xx_initialize(client);
1951 else
1952 cx25840_initialize(client);
1953 return 0;
1954}
1955
1956static int cx25840_log_status(struct v4l2_subdev *sd) 1954static int cx25840_log_status(struct v4l2_subdev *sd)
1957{ 1955{
1958 struct cx25840_state *state = to_state(sd); 1956 struct cx25840_state *state = to_state(sd);
diff --git a/include/media/drv-intf/cx25840.h b/include/media/drv-intf/cx25840.h
index 328ddb359fdf..4eae27c163ba 100644
--- a/include/media/drv-intf/cx25840.h
+++ b/include/media/drv-intf/cx25840.h
@@ -9,17 +9,23 @@
9#ifndef _CX25840_H_ 9#ifndef _CX25840_H_
10#define _CX25840_H_ 10#define _CX25840_H_
11 11
12/* Note that the cx25840 driver requires that the bridge driver calls the 12/*
13 v4l2_subdev's init operation in order to load the driver's firmware. 13 * Note that the cx25840 driver requires that the bridge driver calls the
14 Without this the audio standard detection will fail and you will 14 * v4l2_subdev's load_fw operation in order to load the driver's firmware.
15 only get mono. 15 * This will load the firmware on the first invocation (further ones are NOP).
16 16 * Without this the audio standard detection will fail and you will
17 Since loading the firmware is often problematic when the driver is 17 * only get mono.
18 compiled into the kernel I recommend postponing calling this function 18 * Alternatively, you can call the reset operation (this can be done
19 until the first open of the video device. Another reason for 19 * multiple times if needed, each invocation will fully reinitialize
20 postponing it is that loading this firmware takes a long time (seconds) 20 * the device).
21 due to the slow i2c bus speed. So it will speed up the boot process if 21 *
22 you can avoid loading the fw as long as the video device isn't used. */ 22 * Since loading the firmware is often problematic when the driver is
23 * compiled into the kernel I recommend postponing calling this function
24 * until the first open of the video device. Another reason for
25 * postponing it is that loading this firmware takes a long time (seconds)
26 * due to the slow i2c bus speed. So it will speed up the boot process if
27 * you can avoid loading the fw as long as the video device isn't used.
28 */
23 29
24enum cx25840_video_input { 30enum cx25840_video_input {
25 /* Composite video inputs In1-In8 */ 31 /* Composite video inputs In1-In8 */