Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 331206
b: refs/heads/master
c: a36a66d
h: refs/heads/master
v: v3
  • Loading branch information
Antti Palosaari authored and Mauro Carvalho Chehab committed Oct 1, 2012
1 parent 172162a commit ba77ec5
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 10 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: 13a5336e88b5b23047db643bb9cac2cef7548c6c
refs/heads/master: a36a66d7aaa6468a91941ffcfb6d324f28825910
29 changes: 20 additions & 9 deletions trunk/drivers/media/dvb-frontends/cxd2820r_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ static int cxd2820r_get_frontend_algo(struct dvb_frontend *fe)
static void cxd2820r_release(struct dvb_frontend *fe)
{
struct cxd2820r_priv *priv = fe->demodulator_priv;
int ret;
int uninitialized_var(ret); /* silence compiler warning */

dev_dbg(&priv->i2c->dev, "%s\n", __func__);

Expand Down Expand Up @@ -688,9 +688,9 @@ struct dvb_frontend *cxd2820r_attach(const struct cxd2820r_config *cfg,
{
struct cxd2820r_priv *priv;
int ret;
u8 tmp;
u8 tmp, gpio[GPIO_COUNT];

priv = kzalloc(sizeof (struct cxd2820r_priv), GFP_KERNEL);
priv = kzalloc(sizeof(struct cxd2820r_priv), GFP_KERNEL);
if (!priv) {
ret = -ENOMEM;
dev_err(&i2c->dev, "%s: kzalloc() failed\n",
Expand All @@ -699,17 +699,19 @@ struct dvb_frontend *cxd2820r_attach(const struct cxd2820r_config *cfg,
}

priv->i2c = i2c;
memcpy(&priv->cfg, cfg, sizeof (struct cxd2820r_config));
memcpy(&priv->cfg, cfg, sizeof(struct cxd2820r_config));
memcpy(&priv->fe.ops, &cxd2820r_ops, sizeof(struct dvb_frontend_ops));
priv->fe.demodulator_priv = priv;

priv->bank[0] = priv->bank[1] = 0xff;
ret = cxd2820r_rd_reg(priv, 0x000fd, &tmp);
dev_dbg(&priv->i2c->dev, "%s: chip id=%02x\n", __func__, tmp);
if (ret || tmp != 0xe1)
goto error;

#ifdef CONFIG_GPIOLIB
/* add GPIOs */
if (gpio_chip_base) {
#ifdef CONFIG_GPIOLIB
/* add GPIOs */
priv->gpio_chip.label = KBUILD_MODNAME;
priv->gpio_chip.dev = &priv->i2c->dev;
priv->gpio_chip.owner = THIS_MODULE;
Expand All @@ -728,11 +730,20 @@ struct dvb_frontend *cxd2820r_attach(const struct cxd2820r_config *cfg,
priv->gpio_chip.base);

*gpio_chip_base = priv->gpio_chip.base;
}
#else
/*
* Use static GPIO configuration if GPIOLIB is undefined.
* This is fallback condition.
*/
gpio[0] = (*gpio_chip_base >> 0) & 0x07;
gpio[1] = (*gpio_chip_base >> 3) & 0x07;
gpio[2] = 0;
ret = cxd2820r_gpio(&priv->fe, gpio);
if (ret)
goto error;
#endif
}

memcpy(&priv->fe.ops, &cxd2820r_ops, sizeof (struct dvb_frontend_ops));
priv->fe.demodulator_priv = priv;
return &priv->fe;
error:
dev_dbg(&i2c->dev, "%s: failed=%d\n", __func__, ret);
Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/media/usb/em28xx/em28xx-dvb.c
Original file line number Diff line number Diff line change
Expand Up @@ -983,6 +983,9 @@ static int em28xx_dvb_init(struct em28xx *dev)
&dev->i2c_adap, &kworld_a340_config);
break;
case EM28174_BOARD_PCTV_290E:
/* set default GPIO0 for LNA, used if GPIOLIB is undefined */
dvb->lna_gpio = CXD2820R_GPIO_E | CXD2820R_GPIO_O |
CXD2820R_GPIO_L;
dvb->fe[0] = dvb_attach(cxd2820r_attach,
&em28xx_cxd2820r_config,
&dev->i2c_adap,
Expand Down

0 comments on commit ba77ec5

Please sign in to comment.