Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 333852
b: refs/heads/master
c: 33eebec
h: refs/heads/master
v: v3
  • Loading branch information
Antti Palosaari authored and Mauro Carvalho Chehab committed Oct 7, 2012
1 parent 917aefc commit 56499ff
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d92462401dde1effa04a51d0a15000e6246d2a43
refs/heads/master: 33eebec55c94c755f5f4785e46a72af9238999e2
18 changes: 14 additions & 4 deletions trunk/drivers/media/dvb-core/dvb_frontend.c
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,8 @@ static int dvb_frontend_clear_cache(struct dvb_frontend *fe)
break;
}

c->lna = LNA_AUTO;

return 0;
}

Expand Down Expand Up @@ -1054,6 +1056,8 @@ static struct dtv_cmds_h dtv_cmds[DTV_MAX_COMMAND + 1] = {
_DTV_CMD(DTV_ATSCMH_SCCC_CODE_MODE_B, 0, 0),
_DTV_CMD(DTV_ATSCMH_SCCC_CODE_MODE_C, 0, 0),
_DTV_CMD(DTV_ATSCMH_SCCC_CODE_MODE_D, 0, 0),

_DTV_CMD(DTV_LNA, 0, 0),
};

static void dtv_property_dump(struct dvb_frontend *fe, struct dtv_property *tvp)
Expand Down Expand Up @@ -1440,6 +1444,10 @@ static int dtv_property_process_get(struct dvb_frontend *fe,
tvp->u.data = fe->dtv_property_cache.atscmh_sccc_code_mode_d;
break;

case DTV_LNA:
tvp->u.data = c->lna;
break;

default:
return -EINVAL;
}
Expand Down Expand Up @@ -1731,10 +1739,6 @@ static int dtv_property_process_set(struct dvb_frontend *fe,
case DTV_INTERLEAVING:
c->interleaving = tvp->u.data;
break;
case DTV_LNA:
if (fe->ops.set_lna)
r = fe->ops.set_lna(fe, tvp->u.data);
break;

/* ISDB-T Support here */
case DTV_ISDBT_PARTIAL_RECEPTION:
Expand Down Expand Up @@ -1806,6 +1810,12 @@ static int dtv_property_process_set(struct dvb_frontend *fe,
fe->dtv_property_cache.atscmh_rs_frame_ensemble = tvp->u.data;
break;

case DTV_LNA:
c->lna = tvp->u.data;
if (fe->ops.set_lna)
r = fe->ops.set_lna(fe);
break;

default:
return -EINVAL;
}
Expand Down
4 changes: 3 additions & 1 deletion trunk/drivers/media/dvb-core/dvb_frontend.h
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ struct dvb_frontend_ops {
int (*dishnetwork_send_legacy_command)(struct dvb_frontend* fe, unsigned long cmd);
int (*i2c_gate_ctrl)(struct dvb_frontend* fe, int enable);
int (*ts_bus_ctrl)(struct dvb_frontend* fe, int acquire);
int (*set_lna)(struct dvb_frontend *, int);
int (*set_lna)(struct dvb_frontend *);

/* These callbacks are for devices that implement their own
* tuning algorithms, rather than a simple swzigzag
Expand Down Expand Up @@ -391,6 +391,8 @@ struct dtv_frontend_properties {
u8 atscmh_sccc_code_mode_b;
u8 atscmh_sccc_code_mode_c;
u8 atscmh_sccc_code_mode_d;

u32 lna;
};

struct dvb_frontend {
Expand Down
13 changes: 7 additions & 6 deletions trunk/drivers/media/usb/em28xx/em28xx-dvb.c
Original file line number Diff line number Diff line change
Expand Up @@ -574,18 +574,19 @@ static void pctv_520e_init(struct em28xx *dev)
i2c_master_send(&dev->i2c_client, regs[i].r, regs[i].len);
};

static int em28xx_pctv_290e_set_lna(struct dvb_frontend *fe, int val)
static int em28xx_pctv_290e_set_lna(struct dvb_frontend *fe)
{
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct em28xx *dev = fe->dvb->priv;
#ifdef CONFIG_GPIOLIB
struct em28xx_dvb *dvb = dev->dvb;
int ret;
unsigned long flags;

if (val)
flags = GPIOF_OUT_INIT_LOW;
if (c->lna == 1)
flags = GPIOF_OUT_INIT_HIGH; /* enable LNA */
else
flags = GPIOF_OUT_INIT_HIGH;
flags = GPIOF_OUT_INIT_LOW; /* disable LNA */

ret = gpio_request_one(dvb->lna_gpio, flags, NULL);
if (ret)
Expand All @@ -595,8 +596,8 @@ static int em28xx_pctv_290e_set_lna(struct dvb_frontend *fe, int val)

return ret;
#else
dev_warn(&dev->udev->dev, "%s: LNA control is disabled\n",
KBUILD_MODNAME);
dev_warn(&dev->udev->dev, "%s: LNA control is disabled (lna=%u)\n",
KBUILD_MODNAME, c->lna);
return 0;
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/dvb/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
#define _DVBVERSION_H_

#define DVB_API_VERSION 5
#define DVB_API_VERSION_MINOR 8
#define DVB_API_VERSION_MINOR 9

#endif /*_DVBVERSION_H_*/

0 comments on commit 56499ff

Please sign in to comment.