Commit 73996933 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'staging-4.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging and iio driver fixes from Greg KH:
 "Here are a number of small staging and iio driver fixes for reported
  issues for 4.15-rc3. Nothing major here, the majority is IIO issues,
  like normal, but there are also some small bugfixes for a few staging
  drivers as well.

  Full details are in the shortlog.

  All of these have been in linux-next for a while with no reported
  issues"

* tag 'staging-4.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
  iio: stm32: fix adc/trigger link error
  iio: health: max30102: Temperature should be in milli Celsius
  iio: fix kernel-doc build errors
  iio: adc: meson-saradc: Meson8 and Meson8b do not have REG11 and REG13
  iio: adc: meson-saradc: initialize the bandgap correctly on older SoCs
  iio: adc: meson-saradc: fix the bit_idx of the adc_en clock
  iio: proximity: sx9500: Assign interrupt from GpioIo()
  iio: adc: cpcap: fix incorrect validation
  staging: octeon-usb: use __delay() instead of cvmx_wait()
  staging: rtl8188eu: Fix incorrect response to SIOCGIWESSID
  staging: ccree: fix leak of import() after init()
  staging: comedi: ni_atmio: fix license warning.
parents 84dda296 e168e984
...@@ -1011,7 +1011,7 @@ static int cpcap_adc_probe(struct platform_device *pdev) ...@@ -1011,7 +1011,7 @@ static int cpcap_adc_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, indio_dev); platform_set_drvdata(pdev, indio_dev);
ddata->irq = platform_get_irq_byname(pdev, "adcdone"); ddata->irq = platform_get_irq_byname(pdev, "adcdone");
if (!ddata->irq) if (ddata->irq < 0)
return -ENODEV; return -ENODEV;
error = devm_request_threaded_irq(&pdev->dev, ddata->irq, NULL, error = devm_request_threaded_irq(&pdev->dev, ddata->irq, NULL,
......
...@@ -221,8 +221,10 @@ enum meson_sar_adc_chan7_mux_sel { ...@@ -221,8 +221,10 @@ enum meson_sar_adc_chan7_mux_sel {
struct meson_sar_adc_data { struct meson_sar_adc_data {
bool has_bl30_integration; bool has_bl30_integration;
u32 bandgap_reg;
unsigned int resolution; unsigned int resolution;
const char *name; const char *name;
const struct regmap_config *regmap_config;
}; };
struct meson_sar_adc_priv { struct meson_sar_adc_priv {
...@@ -242,13 +244,20 @@ struct meson_sar_adc_priv { ...@@ -242,13 +244,20 @@ struct meson_sar_adc_priv {
int calibscale; int calibscale;
}; };
static const struct regmap_config meson_sar_adc_regmap_config = { static const struct regmap_config meson_sar_adc_regmap_config_gxbb = {
.reg_bits = 8, .reg_bits = 8,
.val_bits = 32, .val_bits = 32,
.reg_stride = 4, .reg_stride = 4,
.max_register = MESON_SAR_ADC_REG13, .max_register = MESON_SAR_ADC_REG13,
}; };
static const struct regmap_config meson_sar_adc_regmap_config_meson8 = {
.reg_bits = 8,
.val_bits = 32,
.reg_stride = 4,
.max_register = MESON_SAR_ADC_DELTA_10,
};
static unsigned int meson_sar_adc_get_fifo_count(struct iio_dev *indio_dev) static unsigned int meson_sar_adc_get_fifo_count(struct iio_dev *indio_dev)
{ {
struct meson_sar_adc_priv *priv = iio_priv(indio_dev); struct meson_sar_adc_priv *priv = iio_priv(indio_dev);
...@@ -600,7 +609,7 @@ static int meson_sar_adc_clk_init(struct iio_dev *indio_dev, ...@@ -600,7 +609,7 @@ static int meson_sar_adc_clk_init(struct iio_dev *indio_dev,
init.num_parents = 1; init.num_parents = 1;
priv->clk_gate.reg = base + MESON_SAR_ADC_REG3; priv->clk_gate.reg = base + MESON_SAR_ADC_REG3;
priv->clk_gate.bit_idx = fls(MESON_SAR_ADC_REG3_CLK_EN); priv->clk_gate.bit_idx = __ffs(MESON_SAR_ADC_REG3_CLK_EN);
priv->clk_gate.hw.init = &init; priv->clk_gate.hw.init = &init;
priv->adc_clk = devm_clk_register(&indio_dev->dev, &priv->clk_gate.hw); priv->adc_clk = devm_clk_register(&indio_dev->dev, &priv->clk_gate.hw);
...@@ -685,6 +694,20 @@ static int meson_sar_adc_init(struct iio_dev *indio_dev) ...@@ -685,6 +694,20 @@ static int meson_sar_adc_init(struct iio_dev *indio_dev)
return 0; return 0;
} }
static void meson_sar_adc_set_bandgap(struct iio_dev *indio_dev, bool on_off)
{
struct meson_sar_adc_priv *priv = iio_priv(indio_dev);
u32 enable_mask;
if (priv->data->bandgap_reg == MESON_SAR_ADC_REG11)
enable_mask = MESON_SAR_ADC_REG11_BANDGAP_EN;
else
enable_mask = MESON_SAR_ADC_DELTA_10_TS_VBG_EN;
regmap_update_bits(priv->regmap, priv->data->bandgap_reg, enable_mask,
on_off ? enable_mask : 0);
}
static int meson_sar_adc_hw_enable(struct iio_dev *indio_dev) static int meson_sar_adc_hw_enable(struct iio_dev *indio_dev)
{ {
struct meson_sar_adc_priv *priv = iio_priv(indio_dev); struct meson_sar_adc_priv *priv = iio_priv(indio_dev);
...@@ -717,9 +740,9 @@ static int meson_sar_adc_hw_enable(struct iio_dev *indio_dev) ...@@ -717,9 +740,9 @@ static int meson_sar_adc_hw_enable(struct iio_dev *indio_dev)
regval = FIELD_PREP(MESON_SAR_ADC_REG0_FIFO_CNT_IRQ_MASK, 1); regval = FIELD_PREP(MESON_SAR_ADC_REG0_FIFO_CNT_IRQ_MASK, 1);
regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG0, regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG0,
MESON_SAR_ADC_REG0_FIFO_CNT_IRQ_MASK, regval); MESON_SAR_ADC_REG0_FIFO_CNT_IRQ_MASK, regval);
regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG11,
MESON_SAR_ADC_REG11_BANDGAP_EN, meson_sar_adc_set_bandgap(indio_dev, true);
MESON_SAR_ADC_REG11_BANDGAP_EN);
regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG3, regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG3,
MESON_SAR_ADC_REG3_ADC_EN, MESON_SAR_ADC_REG3_ADC_EN,
MESON_SAR_ADC_REG3_ADC_EN); MESON_SAR_ADC_REG3_ADC_EN);
...@@ -739,8 +762,7 @@ static int meson_sar_adc_hw_enable(struct iio_dev *indio_dev) ...@@ -739,8 +762,7 @@ static int meson_sar_adc_hw_enable(struct iio_dev *indio_dev)
err_adc_clk: err_adc_clk:
regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG3, regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG3,
MESON_SAR_ADC_REG3_ADC_EN, 0); MESON_SAR_ADC_REG3_ADC_EN, 0);
regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG11, meson_sar_adc_set_bandgap(indio_dev, false);
MESON_SAR_ADC_REG11_BANDGAP_EN, 0);
clk_disable_unprepare(priv->sana_clk); clk_disable_unprepare(priv->sana_clk);
err_sana_clk: err_sana_clk:
clk_disable_unprepare(priv->core_clk); clk_disable_unprepare(priv->core_clk);
...@@ -765,8 +787,8 @@ static int meson_sar_adc_hw_disable(struct iio_dev *indio_dev) ...@@ -765,8 +787,8 @@ static int meson_sar_adc_hw_disable(struct iio_dev *indio_dev)
regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG3, regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG3,
MESON_SAR_ADC_REG3_ADC_EN, 0); MESON_SAR_ADC_REG3_ADC_EN, 0);
regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG11,
MESON_SAR_ADC_REG11_BANDGAP_EN, 0); meson_sar_adc_set_bandgap(indio_dev, false);
clk_disable_unprepare(priv->sana_clk); clk_disable_unprepare(priv->sana_clk);
clk_disable_unprepare(priv->core_clk); clk_disable_unprepare(priv->core_clk);
...@@ -844,30 +866,40 @@ static const struct iio_info meson_sar_adc_iio_info = { ...@@ -844,30 +866,40 @@ static const struct iio_info meson_sar_adc_iio_info = {
static const struct meson_sar_adc_data meson_sar_adc_meson8_data = { static const struct meson_sar_adc_data meson_sar_adc_meson8_data = {
.has_bl30_integration = false, .has_bl30_integration = false,
.bandgap_reg = MESON_SAR_ADC_DELTA_10,
.regmap_config = &meson_sar_adc_regmap_config_meson8,
.resolution = 10, .resolution = 10,
.name = "meson-meson8-saradc", .name = "meson-meson8-saradc",
}; };
static const struct meson_sar_adc_data meson_sar_adc_meson8b_data = { static const struct meson_sar_adc_data meson_sar_adc_meson8b_data = {
.has_bl30_integration = false, .has_bl30_integration = false,
.bandgap_reg = MESON_SAR_ADC_DELTA_10,
.regmap_config = &meson_sar_adc_regmap_config_meson8,
.resolution = 10, .resolution = 10,
.name = "meson-meson8b-saradc", .name = "meson-meson8b-saradc",
}; };
static const struct meson_sar_adc_data meson_sar_adc_gxbb_data = { static const struct meson_sar_adc_data meson_sar_adc_gxbb_data = {
.has_bl30_integration = true, .has_bl30_integration = true,
.bandgap_reg = MESON_SAR_ADC_REG11,
.regmap_config = &meson_sar_adc_regmap_config_gxbb,
.resolution = 10, .resolution = 10,
.name = "meson-gxbb-saradc", .name = "meson-gxbb-saradc",
}; };
static const struct meson_sar_adc_data meson_sar_adc_gxl_data = { static const struct meson_sar_adc_data meson_sar_adc_gxl_data = {
.has_bl30_integration = true, .has_bl30_integration = true,
.bandgap_reg = MESON_SAR_ADC_REG11,
.regmap_config = &meson_sar_adc_regmap_config_gxbb,
.resolution = 12, .resolution = 12,
.name = "meson-gxl-saradc", .name = "meson-gxl-saradc",
}; };
static const struct meson_sar_adc_data meson_sar_adc_gxm_data = { static const struct meson_sar_adc_data meson_sar_adc_gxm_data = {
.has_bl30_integration = true, .has_bl30_integration = true,
.bandgap_reg = MESON_SAR_ADC_REG11,
.regmap_config = &meson_sar_adc_regmap_config_gxbb,
.resolution = 12, .resolution = 12,
.name = "meson-gxm-saradc", .name = "meson-gxm-saradc",
}; };
...@@ -945,7 +977,7 @@ static int meson_sar_adc_probe(struct platform_device *pdev) ...@@ -945,7 +977,7 @@ static int meson_sar_adc_probe(struct platform_device *pdev)
return ret; return ret;
priv->regmap = devm_regmap_init_mmio(&pdev->dev, base, priv->regmap = devm_regmap_init_mmio(&pdev->dev, base,
&meson_sar_adc_regmap_config); priv->data->regmap_config);
if (IS_ERR(priv->regmap)) if (IS_ERR(priv->regmap))
return PTR_ERR(priv->regmap); return PTR_ERR(priv->regmap);
......
...@@ -371,7 +371,7 @@ static int max30102_read_raw(struct iio_dev *indio_dev, ...@@ -371,7 +371,7 @@ static int max30102_read_raw(struct iio_dev *indio_dev,
mutex_unlock(&indio_dev->mlock); mutex_unlock(&indio_dev->mlock);
break; break;
case IIO_CHAN_INFO_SCALE: case IIO_CHAN_INFO_SCALE:
*val = 1; /* 0.0625 */ *val = 1000; /* 62.5 */
*val2 = 16; *val2 = 16;
ret = IIO_VAL_FRACTIONAL; ret = IIO_VAL_FRACTIONAL;
break; break;
......
...@@ -631,7 +631,7 @@ static ssize_t __iio_format_value(char *buf, size_t len, unsigned int type, ...@@ -631,7 +631,7 @@ static ssize_t __iio_format_value(char *buf, size_t len, unsigned int type,
* iio_format_value() - Formats a IIO value into its string representation * iio_format_value() - Formats a IIO value into its string representation
* @buf: The buffer to which the formatted value gets written * @buf: The buffer to which the formatted value gets written
* which is assumed to be big enough (i.e. PAGE_SIZE). * which is assumed to be big enough (i.e. PAGE_SIZE).
* @type: One of the IIO_VAL_... constants. This decides how the val * @type: One of the IIO_VAL_* constants. This decides how the val
* and val2 parameters are formatted. * and val2 parameters are formatted.
* @size: Number of IIO value entries contained in vals * @size: Number of IIO value entries contained in vals
* @vals: Pointer to the values, exact meaning depends on the * @vals: Pointer to the values, exact meaning depends on the
...@@ -639,7 +639,7 @@ static ssize_t __iio_format_value(char *buf, size_t len, unsigned int type, ...@@ -639,7 +639,7 @@ static ssize_t __iio_format_value(char *buf, size_t len, unsigned int type,
* *
* Return: 0 by default, a negative number on failure or the * Return: 0 by default, a negative number on failure or the
* total number of characters written for a type that belongs * total number of characters written for a type that belongs
* to the IIO_VAL_... constant. * to the IIO_VAL_* constant.
*/ */
ssize_t iio_format_value(char *buf, unsigned int type, int size, int *vals) ssize_t iio_format_value(char *buf, unsigned int type, int size, int *vals)
{ {
......
...@@ -869,6 +869,7 @@ static int sx9500_init_device(struct iio_dev *indio_dev) ...@@ -869,6 +869,7 @@ static int sx9500_init_device(struct iio_dev *indio_dev)
static void sx9500_gpio_probe(struct i2c_client *client, static void sx9500_gpio_probe(struct i2c_client *client,
struct sx9500_data *data) struct sx9500_data *data)
{ {
struct gpio_desc *gpiod_int;
struct device *dev; struct device *dev;
if (!client) if (!client)
...@@ -876,6 +877,14 @@ static void sx9500_gpio_probe(struct i2c_client *client, ...@@ -876,6 +877,14 @@ static void sx9500_gpio_probe(struct i2c_client *client,
dev = &client->dev; dev = &client->dev;
if (client->irq <= 0) {
gpiod_int = devm_gpiod_get(dev, SX9500_GPIO_INT, GPIOD_IN);
if (IS_ERR(gpiod_int))
dev_err(dev, "gpio get irq failed\n");
else
client->irq = gpiod_to_irq(gpiod_int);
}
data->gpiod_rst = devm_gpiod_get(dev, SX9500_GPIO_RESET, GPIOD_OUT_HIGH); data->gpiod_rst = devm_gpiod_get(dev, SX9500_GPIO_RESET, GPIOD_OUT_HIGH);
if (IS_ERR(data->gpiod_rst)) { if (IS_ERR(data->gpiod_rst)) {
dev_warn(dev, "gpio get reset pin failed\n"); dev_warn(dev, "gpio get reset pin failed\n");
......
...@@ -1778,9 +1778,12 @@ static int ssi_ahash_import(struct ahash_request *req, const void *in) ...@@ -1778,9 +1778,12 @@ static int ssi_ahash_import(struct ahash_request *req, const void *in)
} }
in += sizeof(u32); in += sizeof(u32);
rc = ssi_hash_init(state, ctx); /* call init() to allocate bufs if the user hasn't */
if (rc) if (!state->digest_buff) {
goto out; rc = ssi_hash_init(state, ctx);
if (rc)
goto out;
}
dma_sync_single_for_cpu(dev, state->digest_buff_dma_addr, dma_sync_single_for_cpu(dev, state->digest_buff_dma_addr,
ctx->inter_digestsize, DMA_BIDIRECTIONAL); ctx->inter_digestsize, DMA_BIDIRECTIONAL);
......
...@@ -361,3 +361,8 @@ static struct comedi_driver ni_atmio_driver = { ...@@ -361,3 +361,8 @@ static struct comedi_driver ni_atmio_driver = {
.detach = ni_atmio_detach, .detach = ni_atmio_detach,
}; };
module_comedi_driver(ni_atmio_driver); module_comedi_driver(ni_atmio_driver);
MODULE_AUTHOR("Comedi http://www.comedi.org");
MODULE_DESCRIPTION("Comedi low-level driver");
MODULE_LICENSE("GPL");
...@@ -394,7 +394,7 @@ struct octeon_hcd { ...@@ -394,7 +394,7 @@ struct octeon_hcd {
result = -1; \ result = -1; \
break; \ break; \
} else \ } else \
cvmx_wait(100); \ __delay(100); \
} \ } \
} while (0); \ } while (0); \
result; }) result; })
...@@ -774,7 +774,7 @@ static int cvmx_usb_initialize(struct device *dev, ...@@ -774,7 +774,7 @@ static int cvmx_usb_initialize(struct device *dev,
usbn_clk_ctl.s.hclk_rst = 1; usbn_clk_ctl.s.hclk_rst = 1;
cvmx_write64_uint64(CVMX_USBNX_CLK_CTL(usb->index), usbn_clk_ctl.u64); cvmx_write64_uint64(CVMX_USBNX_CLK_CTL(usb->index), usbn_clk_ctl.u64);
/* 2e. Wait 64 core-clock cycles for HCLK to stabilize */ /* 2e. Wait 64 core-clock cycles for HCLK to stabilize */
cvmx_wait(64); __delay(64);
/* /*
* 3. Program the power-on reset field in the USBN clock-control * 3. Program the power-on reset field in the USBN clock-control
* register: * register:
...@@ -795,7 +795,7 @@ static int cvmx_usb_initialize(struct device *dev, ...@@ -795,7 +795,7 @@ static int cvmx_usb_initialize(struct device *dev,
cvmx_write64_uint64(CVMX_USBNX_USBP_CTL_STATUS(usb->index), cvmx_write64_uint64(CVMX_USBNX_USBP_CTL_STATUS(usb->index),
usbn_usbp_ctl_status.u64); usbn_usbp_ctl_status.u64);
/* 6. Wait 10 cycles */ /* 6. Wait 10 cycles */
cvmx_wait(10); __delay(10);
/* /*
* 7. Clear ATE_RESET field in the USBN clock-control register: * 7. Clear ATE_RESET field in the USBN clock-control register:
* USBN_USBP_CTL_STATUS[ATE_RESET] = 0 * USBN_USBP_CTL_STATUS[ATE_RESET] = 0
......
...@@ -1395,19 +1395,13 @@ static int rtw_wx_get_essid(struct net_device *dev, ...@@ -1395,19 +1395,13 @@ static int rtw_wx_get_essid(struct net_device *dev,
if ((check_fwstate(pmlmepriv, _FW_LINKED)) || if ((check_fwstate(pmlmepriv, _FW_LINKED)) ||
(check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE))) { (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE))) {
len = pcur_bss->Ssid.SsidLength; len = pcur_bss->Ssid.SsidLength;
wrqu->essid.length = len;
memcpy(extra, pcur_bss->Ssid.Ssid, len); memcpy(extra, pcur_bss->Ssid.Ssid, len);
wrqu->essid.flags = 1;
} else { } else {
ret = -1; len = 0;
goto exit; *extra = 0;
} }
wrqu->essid.length = len;
exit: wrqu->essid.flags = 1;
return ret; return ret;
} }
......
...@@ -16,11 +16,14 @@ ...@@ -16,11 +16,14 @@
#define LPTIM2_OUT "lptim2_out" #define LPTIM2_OUT "lptim2_out"
#define LPTIM3_OUT "lptim3_out" #define LPTIM3_OUT "lptim3_out"
#if IS_ENABLED(CONFIG_IIO_STM32_LPTIMER_TRIGGER) #if IS_REACHABLE(CONFIG_IIO_STM32_LPTIMER_TRIGGER)
bool is_stm32_lptim_trigger(struct iio_trigger *trig); bool is_stm32_lptim_trigger(struct iio_trigger *trig);
#else #else
static inline bool is_stm32_lptim_trigger(struct iio_trigger *trig) static inline bool is_stm32_lptim_trigger(struct iio_trigger *trig)
{ {
#if IS_ENABLED(CONFIG_IIO_STM32_LPTIMER_TRIGGER)
pr_warn_once("stm32 lptim_trigger not linked in\n");
#endif
return false; return false;
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment