aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2009-03-06 22:56:52 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-30 11:43:37 -0400
commitbd14d4f8f436d686e0e915d55533a5e70769cdf4 (patch)
tree270495678804e138e8cb4e42ec52affd0087275e /drivers/media
parent634ba268b965b57da1f60edbc57f14299a5326f6 (diff)
V4L/DVB (11183): pvrusb2: Implement more sub-device loading trace and improve error handling
Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-hdw.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
index 1158021b1e12..b0987a63f67a 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
@@ -2009,6 +2009,10 @@ static int pvr2_hdw_load_subdev(struct pvr2_hdw *hdw,
2009 hdw->hdw_desc->description); 2009 hdw->hdw_desc->description);
2010 return -EINVAL; 2010 return -EINVAL;
2011 } 2011 }
2012 pvr2_trace(PVR2_TRACE_INIT,
2013 "Module ID %u (%s) for device %s being loaded...",
2014 mid, fname,
2015 hdw->hdw_desc->description);
2012 2016
2013 i2ccnt = pvr2_copy_i2c_addr_list(i2caddr, cd->i2c_address_list, 2017 i2ccnt = pvr2_copy_i2c_addr_list(i2caddr, cd->i2c_address_list,
2014 ARRAY_SIZE(i2caddr)); 2018 ARRAY_SIZE(i2caddr));
@@ -2017,6 +2021,12 @@ static int pvr2_hdw_load_subdev(struct pvr2_hdw *hdw,
2017 /* Second chance: Try default i2c address list */ 2021 /* Second chance: Try default i2c address list */
2018 i2ccnt = pvr2_copy_i2c_addr_list(i2caddr, p, 2022 i2ccnt = pvr2_copy_i2c_addr_list(i2caddr, p,
2019 ARRAY_SIZE(i2caddr)); 2023 ARRAY_SIZE(i2caddr));
2024 if (i2ccnt) {
2025 pvr2_trace(PVR2_TRACE_INIT,
2026 "Module ID %u:"
2027 " Using default i2c address list",
2028 mid);
2029 }
2020 } 2030 }
2021 2031
2022 if (!i2ccnt) { 2032 if (!i2ccnt) {
@@ -2035,10 +2045,18 @@ static int pvr2_hdw_load_subdev(struct pvr2_hdw *hdw,
2035 * "chipid" appears to just be the module name again. So here we 2045 * "chipid" appears to just be the module name again. So here we
2036 * just do the same thing. */ 2046 * just do the same thing. */
2037 if (i2ccnt == 1) { 2047 if (i2ccnt == 1) {
2048 pvr2_trace(PVR2_TRACE_INIT,
2049 "Module ID %u:"
2050 " Setting up with specified i2c address 0x%x",
2051 mid, i2caddr[0]);
2038 sd = v4l2_i2c_new_subdev(&hdw->i2c_adap, 2052 sd = v4l2_i2c_new_subdev(&hdw->i2c_adap,
2039 fname, fname, 2053 fname, fname,
2040 i2caddr[0]); 2054 i2caddr[0]);
2041 } else { 2055 } else {
2056 pvr2_trace(PVR2_TRACE_INIT,
2057 "Module ID %u:"
2058 " Setting up with address probe list",
2059 mid);
2042 sd = v4l2_i2c_new_probed_subdev(&hdw->i2c_adap, 2060 sd = v4l2_i2c_new_probed_subdev(&hdw->i2c_adap,
2043 fname, fname, 2061 fname, fname,
2044 i2caddr); 2062 i2caddr);
@@ -2061,7 +2079,7 @@ static int pvr2_hdw_load_subdev(struct pvr2_hdw *hdw,
2061 aid, in normal situations there's no reason for both mechanisms 2079 aid, in normal situations there's no reason for both mechanisms
2062 to be enabled. */ 2080 to be enabled. */
2063 pvr2_i2c_untrack_subdev(hdw, sd); 2081 pvr2_i2c_untrack_subdev(hdw, sd);
2064 pvr2_trace(PVR2_TRACE_INIT, "Attached sub-driver %s", fname); 2082 pvr2_trace(PVR2_TRACE_INFO, "Attached sub-driver %s", fname);
2065 2083
2066 2084
2067 /* client-specific setup... */ 2085 /* client-specific setup... */
@@ -2081,6 +2099,10 @@ static int pvr2_hdw_load_subdev(struct pvr2_hdw *hdw,
2081 up. 2099 up.
2082 */ 2100 */
2083 struct v4l2_format fmt; 2101 struct v4l2_format fmt;
2102 pvr2_trace(PVR2_TRACE_INIT,
2103 "Module ID %u:"
2104 " Executing cx25840 VBI hack",
2105 mid);
2084 memset(&fmt, 0, sizeof(fmt)); 2106 memset(&fmt, 0, sizeof(fmt));
2085 fmt.type = V4L2_BUF_TYPE_SLICED_VBI_CAPTURE; 2107 fmt.type = V4L2_BUF_TYPE_SLICED_VBI_CAPTURE;
2086 v4l2_device_call_all(&hdw->v4l2_dev, mid, 2108 v4l2_device_call_all(&hdw->v4l2_dev, mid,
@@ -2111,7 +2133,7 @@ static void pvr2_hdw_load_modules(struct pvr2_hdw *hdw)
2111 2133
2112 ct = &hdw->hdw_desc->client_table; 2134 ct = &hdw->hdw_desc->client_table;
2113 for (idx = 0; idx < ct->cnt; idx++) { 2135 for (idx = 0; idx < ct->cnt; idx++) {
2114 if (!pvr2_hdw_load_subdev(hdw, &ct->lst[idx])) okFl = 0; 2136 if (pvr2_hdw_load_subdev(hdw, &ct->lst[idx]) < 0) okFl = 0;
2115 } 2137 }
2116 if (!okFl) pvr2_hdw_render_useless(hdw); 2138 if (!okFl) pvr2_hdw_render_useless(hdw);
2117} 2139}