aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb-core/dvb_frontend.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb-core/dvb_frontend.c')
-rw-r--r--drivers/media/dvb-core/dvb_frontend.c45
1 files changed, 32 insertions, 13 deletions
diff --git a/drivers/media/dvb-core/dvb_frontend.c b/drivers/media/dvb-core/dvb_frontend.c
index c2a6a0a85813..b8579ee68bd6 100644
--- a/drivers/media/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb-core/dvb_frontend.c
@@ -1934,15 +1934,13 @@ static int dvb_frontend_ioctl_properties(struct file *file,
1934 struct dtv_frontend_properties *c = &fe->dtv_property_cache; 1934 struct dtv_frontend_properties *c = &fe->dtv_property_cache;
1935 int err = 0; 1935 int err = 0;
1936 1936
1937 struct dtv_properties *tvps = NULL; 1937 struct dtv_properties *tvps = parg;
1938 struct dtv_property *tvp = NULL; 1938 struct dtv_property *tvp = NULL;
1939 int i; 1939 int i;
1940 1940
1941 dev_dbg(fe->dvb->device, "%s:\n", __func__); 1941 dev_dbg(fe->dvb->device, "%s:\n", __func__);
1942 1942
1943 if(cmd == FE_SET_PROPERTY) { 1943 if (cmd == FE_SET_PROPERTY) {
1944 tvps = (struct dtv_properties __user *)parg;
1945
1946 dev_dbg(fe->dvb->device, "%s: properties.num = %d\n", __func__, tvps->num); 1944 dev_dbg(fe->dvb->device, "%s: properties.num = %d\n", __func__, tvps->num);
1947 dev_dbg(fe->dvb->device, "%s: properties.props = %p\n", __func__, tvps->props); 1945 dev_dbg(fe->dvb->device, "%s: properties.props = %p\n", __func__, tvps->props);
1948 1946
@@ -1957,7 +1955,8 @@ static int dvb_frontend_ioctl_properties(struct file *file,
1957 goto out; 1955 goto out;
1958 } 1956 }
1959 1957
1960 if (copy_from_user(tvp, tvps->props, tvps->num * sizeof(struct dtv_property))) { 1958 if (copy_from_user(tvp, (void __user *)tvps->props,
1959 tvps->num * sizeof(struct dtv_property))) {
1961 err = -EFAULT; 1960 err = -EFAULT;
1962 goto out; 1961 goto out;
1963 } 1962 }
@@ -1972,10 +1971,7 @@ static int dvb_frontend_ioctl_properties(struct file *file,
1972 if (c->state == DTV_TUNE) 1971 if (c->state == DTV_TUNE)
1973 dev_dbg(fe->dvb->device, "%s: Property cache is full, tuning\n", __func__); 1972 dev_dbg(fe->dvb->device, "%s: Property cache is full, tuning\n", __func__);
1974 1973
1975 } else 1974 } else if (cmd == FE_GET_PROPERTY) {
1976 if(cmd == FE_GET_PROPERTY) {
1977 tvps = (struct dtv_properties __user *)parg;
1978
1979 dev_dbg(fe->dvb->device, "%s: properties.num = %d\n", __func__, tvps->num); 1975 dev_dbg(fe->dvb->device, "%s: properties.num = %d\n", __func__, tvps->num);
1980 dev_dbg(fe->dvb->device, "%s: properties.props = %p\n", __func__, tvps->props); 1976 dev_dbg(fe->dvb->device, "%s: properties.props = %p\n", __func__, tvps->props);
1981 1977
@@ -1990,7 +1986,8 @@ static int dvb_frontend_ioctl_properties(struct file *file,
1990 goto out; 1986 goto out;
1991 } 1987 }
1992 1988
1993 if (copy_from_user(tvp, tvps->props, tvps->num * sizeof(struct dtv_property))) { 1989 if (copy_from_user(tvp, (void __user *)tvps->props,
1990 tvps->num * sizeof(struct dtv_property))) {
1994 err = -EFAULT; 1991 err = -EFAULT;
1995 goto out; 1992 goto out;
1996 } 1993 }
@@ -2012,7 +2009,8 @@ static int dvb_frontend_ioctl_properties(struct file *file,
2012 (tvp + i)->result = err; 2009 (tvp + i)->result = err;
2013 } 2010 }
2014 2011
2015 if (copy_to_user(tvps->props, tvp, tvps->num * sizeof(struct dtv_property))) { 2012 if (copy_to_user((void __user *)tvps->props, tvp,
2013 tvps->num * sizeof(struct dtv_property))) {
2016 err = -EFAULT; 2014 err = -EFAULT;
2017 goto out; 2015 goto out;
2018 } 2016 }
@@ -2072,6 +2070,23 @@ static int dtv_set_frontend(struct dvb_frontend *fe)
2072 case SYS_DVBC_ANNEX_C: 2070 case SYS_DVBC_ANNEX_C:
2073 rolloff = 113; 2071 rolloff = 113;
2074 break; 2072 break;
2073 case SYS_DVBS:
2074 case SYS_TURBO:
2075 rolloff = 135;
2076 break;
2077 case SYS_DVBS2:
2078 switch (c->rolloff) {
2079 case ROLLOFF_20:
2080 rolloff = 120;
2081 break;
2082 case ROLLOFF_25:
2083 rolloff = 125;
2084 break;
2085 default:
2086 case ROLLOFF_35:
2087 rolloff = 135;
2088 }
2089 break;
2075 default: 2090 default:
2076 break; 2091 break;
2077 } 2092 }
@@ -2550,7 +2565,9 @@ int dvb_frontend_suspend(struct dvb_frontend *fe)
2550 dev_dbg(fe->dvb->device, "%s: adap=%d fe=%d\n", __func__, fe->dvb->num, 2565 dev_dbg(fe->dvb->device, "%s: adap=%d fe=%d\n", __func__, fe->dvb->num,
2551 fe->id); 2566 fe->id);
2552 2567
2553 if (fe->ops.tuner_ops.sleep) 2568 if (fe->ops.tuner_ops.suspend)
2569 ret = fe->ops.tuner_ops.suspend(fe);
2570 else if (fe->ops.tuner_ops.sleep)
2554 ret = fe->ops.tuner_ops.sleep(fe); 2571 ret = fe->ops.tuner_ops.sleep(fe);
2555 2572
2556 if (fe->ops.sleep) 2573 if (fe->ops.sleep)
@@ -2572,7 +2589,9 @@ int dvb_frontend_resume(struct dvb_frontend *fe)
2572 if (fe->ops.init) 2589 if (fe->ops.init)
2573 ret = fe->ops.init(fe); 2590 ret = fe->ops.init(fe);
2574 2591
2575 if (fe->ops.tuner_ops.init) 2592 if (fe->ops.tuner_ops.resume)
2593 ret = fe->ops.tuner_ops.resume(fe);
2594 else if (fe->ops.tuner_ops.init)
2576 ret = fe->ops.tuner_ops.init(fe); 2595 ret = fe->ops.tuner_ops.init(fe);
2577 2596
2578 fe->exit = DVB_FE_NO_EXIT; 2597 fe->exit = DVB_FE_NO_EXIT;