.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* Linux driver for devices based on the DiBcom DiB0700 USB bridge |
---|
2 | | - * |
---|
3 | | - * This program is free software; you can redistribute it and/or modify it |
---|
4 | | - * under the terms of the GNU General Public License as published by the Free |
---|
5 | | - * Software Foundation, version 2. |
---|
6 | 3 | * |
---|
7 | 4 | * Copyright (C) 2005-9 DiBcom, SA et al |
---|
8 | 5 | */ |
---|
.. | .. |
---|
29 | 26 | |
---|
30 | 27 | static int force_lna_activation; |
---|
31 | 28 | module_param(force_lna_activation, int, 0644); |
---|
32 | | -MODULE_PARM_DESC(force_lna_activation, "force the activation of Low-Noise-Amplifyer(s) (LNA), if applicable for the device (default: 0=automatic/off)."); |
---|
| 29 | +MODULE_PARM_DESC(force_lna_activation, "force the activation of Low-Noise-Amplifier(s) (LNA), if applicable for the device (default: 0=automatic/off)."); |
---|
33 | 30 | |
---|
34 | 31 | struct dib0700_adapter_state { |
---|
35 | 32 | int (*set_param_save) (struct dvb_frontend *); |
---|
.. | .. |
---|
1662 | 1659 | |
---|
1663 | 1660 | switch (band) { |
---|
1664 | 1661 | default: |
---|
1665 | | - deb_info("Warning : Rf frequency (%iHz) is not in the supported range, using VHF switch ", fe->dtv_property_cache.frequency); |
---|
1666 | | - /* fall through */ |
---|
| 1662 | + deb_info("Warning : Rf frequency (%iHz) is not in the supported range, using VHF switch ", fe->dtv_property_cache.frequency); |
---|
| 1663 | + fallthrough; |
---|
1667 | 1664 | case BAND_VHF: |
---|
1668 | | - state->dib8000_ops.set_gpio(fe, 3, 0, 1); |
---|
1669 | | - break; |
---|
| 1665 | + state->dib8000_ops.set_gpio(fe, 3, 0, 1); |
---|
| 1666 | + break; |
---|
1670 | 1667 | case BAND_UHF: |
---|
1671 | | - state->dib8000_ops.set_gpio(fe, 3, 0, 0); |
---|
1672 | | - break; |
---|
| 1668 | + state->dib8000_ops.set_gpio(fe, 3, 0, 0); |
---|
| 1669 | + break; |
---|
1673 | 1670 | } |
---|
1674 | 1671 | |
---|
1675 | 1672 | ret = state->set_param_save(fe); |
---|
.. | .. |
---|
1741 | 1738 | struct dib0700_adapter_state *st = adap->priv; |
---|
1742 | 1739 | struct i2c_adapter *tun_i2c = st->dib8000_ops.get_i2c_master(adap->fe_adap[0].fe, DIBX000_I2C_INTERFACE_TUNER, 1); |
---|
1743 | 1740 | |
---|
1744 | | - if (adap->id == 0) { |
---|
1745 | | - if (dvb_attach(dib0090_register, adap->fe_adap[0].fe, tun_i2c, &dib809x_dib0090_config) == NULL) |
---|
1746 | | - return -ENODEV; |
---|
1747 | | - } else { |
---|
1748 | | - /* FIXME: check if it is fe_adap[1] */ |
---|
1749 | | - if (dvb_attach(dib0090_register, adap->fe_adap[0].fe, tun_i2c, &dib809x_dib0090_config) == NULL) |
---|
1750 | | - return -ENODEV; |
---|
1751 | | - } |
---|
| 1741 | + /* FIXME: if adap->id != 0, check if it is fe_adap[1] */ |
---|
| 1742 | + if (!dvb_attach(dib0090_register, adap->fe_adap[0].fe, tun_i2c, &dib809x_dib0090_config)) |
---|
| 1743 | + return -ENODEV; |
---|
1752 | 1744 | |
---|
1753 | 1745 | st->set_param_save = adap->fe_adap[0].fe->ops.tuner_ops.set_params; |
---|
1754 | 1746 | adap->fe_adap[0].fe->ops.tuner_ops.set_params = dib8096_set_param_override; |
---|
.. | .. |
---|
3771 | 3763 | mn88472_config.ts_mode = PARALLEL_TS_MODE; |
---|
3772 | 3764 | mn88472_config.ts_clock = FIXED_TS_CLOCK; |
---|
3773 | 3765 | memset(&info, 0, sizeof(struct i2c_board_info)); |
---|
3774 | | - strlcpy(info.type, "mn88472", I2C_NAME_SIZE); |
---|
| 3766 | + strscpy(info.type, "mn88472", I2C_NAME_SIZE); |
---|
3775 | 3767 | info.addr = 0x18; |
---|
3776 | 3768 | info.platform_data = &mn88472_config; |
---|
3777 | 3769 | request_module(info.type); |
---|
3778 | | - client_demod = i2c_new_device(&d->i2c_adap, &info); |
---|
3779 | | - if (client_demod == NULL || client_demod->dev.driver == NULL) |
---|
| 3770 | + client_demod = i2c_new_client_device(&d->i2c_adap, &info); |
---|
| 3771 | + if (!i2c_client_has_driver(client_demod)) |
---|
3780 | 3772 | goto fail_demod_device; |
---|
3781 | 3773 | if (!try_module_get(client_demod->dev.driver->owner)) |
---|
3782 | 3774 | goto fail_demod_module; |
---|
.. | .. |
---|
3798 | 3790 | tda18250_config.fe = adap->fe_adap[0].fe; |
---|
3799 | 3791 | |
---|
3800 | 3792 | memset(&info, 0, sizeof(struct i2c_board_info)); |
---|
3801 | | - strlcpy(info.type, "tda18250", I2C_NAME_SIZE); |
---|
| 3793 | + strscpy(info.type, "tda18250", I2C_NAME_SIZE); |
---|
3802 | 3794 | info.addr = 0x60; |
---|
3803 | 3795 | info.platform_data = &tda18250_config; |
---|
3804 | 3796 | |
---|
3805 | 3797 | request_module(info.type); |
---|
3806 | | - client_tuner = i2c_new_device(&adap->dev->i2c_adap, &info); |
---|
3807 | | - if (client_tuner == NULL || client_tuner->dev.driver == NULL) |
---|
| 3798 | + client_tuner = i2c_new_client_device(&adap->dev->i2c_adap, &info); |
---|
| 3799 | + if (!i2c_client_has_driver(client_tuner)) |
---|
3808 | 3800 | goto fail_tuner_device; |
---|
3809 | 3801 | if (!try_module_get(client_tuner->dev.driver->owner)) |
---|
3810 | 3802 | goto fail_tuner_module; |
---|