Skip to content

Commit 7399693

Browse files
committed
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.
2 parents 84dda29 + e168e98 commit 7399693

File tree

10 files changed

+77
-31
lines changed

10 files changed

+77
-31
lines changed

drivers/iio/adc/cpcap-adc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1011,7 +1011,7 @@ static int cpcap_adc_probe(struct platform_device *pdev)
10111011
platform_set_drvdata(pdev, indio_dev);
10121012

10131013
ddata->irq = platform_get_irq_byname(pdev, "adcdone");
1014-
if (!ddata->irq)
1014+
if (ddata->irq < 0)
10151015
return -ENODEV;
10161016

10171017
error = devm_request_threaded_irq(&pdev->dev, ddata->irq, NULL,

drivers/iio/adc/meson_saradc.c

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,10 @@ enum meson_sar_adc_chan7_mux_sel {
221221

222222
struct meson_sar_adc_data {
223223
bool has_bl30_integration;
224+
u32 bandgap_reg;
224225
unsigned int resolution;
225226
const char *name;
227+
const struct regmap_config *regmap_config;
226228
};
227229

228230
struct meson_sar_adc_priv {
@@ -242,13 +244,20 @@ struct meson_sar_adc_priv {
242244
int calibscale;
243245
};
244246

245-
static const struct regmap_config meson_sar_adc_regmap_config = {
247+
static const struct regmap_config meson_sar_adc_regmap_config_gxbb = {
246248
.reg_bits = 8,
247249
.val_bits = 32,
248250
.reg_stride = 4,
249251
.max_register = MESON_SAR_ADC_REG13,
250252
};
251253

254+
static const struct regmap_config meson_sar_adc_regmap_config_meson8 = {
255+
.reg_bits = 8,
256+
.val_bits = 32,
257+
.reg_stride = 4,
258+
.max_register = MESON_SAR_ADC_DELTA_10,
259+
};
260+
252261
static unsigned int meson_sar_adc_get_fifo_count(struct iio_dev *indio_dev)
253262
{
254263
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,
600609
init.num_parents = 1;
601610

602611
priv->clk_gate.reg = base + MESON_SAR_ADC_REG3;
603-
priv->clk_gate.bit_idx = fls(MESON_SAR_ADC_REG3_CLK_EN);
612+
priv->clk_gate.bit_idx = __ffs(MESON_SAR_ADC_REG3_CLK_EN);
604613
priv->clk_gate.hw.init = &init;
605614

606615
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)
685694
return 0;
686695
}
687696

697+
static void meson_sar_adc_set_bandgap(struct iio_dev *indio_dev, bool on_off)
698+
{
699+
struct meson_sar_adc_priv *priv = iio_priv(indio_dev);
700+
u32 enable_mask;
701+
702+
if (priv->data->bandgap_reg == MESON_SAR_ADC_REG11)
703+
enable_mask = MESON_SAR_ADC_REG11_BANDGAP_EN;
704+
else
705+
enable_mask = MESON_SAR_ADC_DELTA_10_TS_VBG_EN;
706+
707+
regmap_update_bits(priv->regmap, priv->data->bandgap_reg, enable_mask,
708+
on_off ? enable_mask : 0);
709+
}
710+
688711
static int meson_sar_adc_hw_enable(struct iio_dev *indio_dev)
689712
{
690713
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)
717740
regval = FIELD_PREP(MESON_SAR_ADC_REG0_FIFO_CNT_IRQ_MASK, 1);
718741
regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG0,
719742
MESON_SAR_ADC_REG0_FIFO_CNT_IRQ_MASK, regval);
720-
regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG11,
721-
MESON_SAR_ADC_REG11_BANDGAP_EN,
722-
MESON_SAR_ADC_REG11_BANDGAP_EN);
743+
744+
meson_sar_adc_set_bandgap(indio_dev, true);
745+
723746
regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG3,
724747
MESON_SAR_ADC_REG3_ADC_EN,
725748
MESON_SAR_ADC_REG3_ADC_EN);
@@ -739,8 +762,7 @@ static int meson_sar_adc_hw_enable(struct iio_dev *indio_dev)
739762
err_adc_clk:
740763
regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG3,
741764
MESON_SAR_ADC_REG3_ADC_EN, 0);
742-
regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG11,
743-
MESON_SAR_ADC_REG11_BANDGAP_EN, 0);
765+
meson_sar_adc_set_bandgap(indio_dev, false);
744766
clk_disable_unprepare(priv->sana_clk);
745767
err_sana_clk:
746768
clk_disable_unprepare(priv->core_clk);
@@ -765,8 +787,8 @@ static int meson_sar_adc_hw_disable(struct iio_dev *indio_dev)
765787

766788
regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG3,
767789
MESON_SAR_ADC_REG3_ADC_EN, 0);
768-
regmap_update_bits(priv->regmap, MESON_SAR_ADC_REG11,
769-
MESON_SAR_ADC_REG11_BANDGAP_EN, 0);
790+
791+
meson_sar_adc_set_bandgap(indio_dev, false);
770792

771793
clk_disable_unprepare(priv->sana_clk);
772794
clk_disable_unprepare(priv->core_clk);
@@ -844,30 +866,40 @@ static const struct iio_info meson_sar_adc_iio_info = {
844866

845867
static const struct meson_sar_adc_data meson_sar_adc_meson8_data = {
846868
.has_bl30_integration = false,
869+
.bandgap_reg = MESON_SAR_ADC_DELTA_10,
870+
.regmap_config = &meson_sar_adc_regmap_config_meson8,
847871
.resolution = 10,
848872
.name = "meson-meson8-saradc",
849873
};
850874

851875
static const struct meson_sar_adc_data meson_sar_adc_meson8b_data = {
852876
.has_bl30_integration = false,
877+
.bandgap_reg = MESON_SAR_ADC_DELTA_10,
878+
.regmap_config = &meson_sar_adc_regmap_config_meson8,
853879
.resolution = 10,
854880
.name = "meson-meson8b-saradc",
855881
};
856882

857883
static const struct meson_sar_adc_data meson_sar_adc_gxbb_data = {
858884
.has_bl30_integration = true,
885+
.bandgap_reg = MESON_SAR_ADC_REG11,
886+
.regmap_config = &meson_sar_adc_regmap_config_gxbb,
859887
.resolution = 10,
860888
.name = "meson-gxbb-saradc",
861889
};
862890

863891
static const struct meson_sar_adc_data meson_sar_adc_gxl_data = {
864892
.has_bl30_integration = true,
893+
.bandgap_reg = MESON_SAR_ADC_REG11,
894+
.regmap_config = &meson_sar_adc_regmap_config_gxbb,
865895
.resolution = 12,
866896
.name = "meson-gxl-saradc",
867897
};
868898

869899
static const struct meson_sar_adc_data meson_sar_adc_gxm_data = {
870900
.has_bl30_integration = true,
901+
.bandgap_reg = MESON_SAR_ADC_REG11,
902+
.regmap_config = &meson_sar_adc_regmap_config_gxbb,
871903
.resolution = 12,
872904
.name = "meson-gxm-saradc",
873905
};
@@ -945,7 +977,7 @@ static int meson_sar_adc_probe(struct platform_device *pdev)
945977
return ret;
946978

947979
priv->regmap = devm_regmap_init_mmio(&pdev->dev, base,
948-
&meson_sar_adc_regmap_config);
980+
priv->data->regmap_config);
949981
if (IS_ERR(priv->regmap))
950982
return PTR_ERR(priv->regmap);
951983

drivers/iio/health/max30102.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ static int max30102_read_raw(struct iio_dev *indio_dev,
371371
mutex_unlock(&indio_dev->mlock);
372372
break;
373373
case IIO_CHAN_INFO_SCALE:
374-
*val = 1; /* 0.0625 */
374+
*val = 1000; /* 62.5 */
375375
*val2 = 16;
376376
ret = IIO_VAL_FRACTIONAL;
377377
break;

drivers/iio/industrialio-core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -631,15 +631,15 @@ static ssize_t __iio_format_value(char *buf, size_t len, unsigned int type,
631631
* iio_format_value() - Formats a IIO value into its string representation
632632
* @buf: The buffer to which the formatted value gets written
633633
* which is assumed to be big enough (i.e. PAGE_SIZE).
634-
* @type: One of the IIO_VAL_... constants. This decides how the val
634+
* @type: One of the IIO_VAL_* constants. This decides how the val
635635
* and val2 parameters are formatted.
636636
* @size: Number of IIO value entries contained in vals
637637
* @vals: Pointer to the values, exact meaning depends on the
638638
* type parameter.
639639
*
640640
* Return: 0 by default, a negative number on failure or the
641641
* total number of characters written for a type that belongs
642-
* to the IIO_VAL_... constant.
642+
* to the IIO_VAL_* constant.
643643
*/
644644
ssize_t iio_format_value(char *buf, unsigned int type, int size, int *vals)
645645
{

drivers/iio/proximity/sx9500.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -869,13 +869,22 @@ static int sx9500_init_device(struct iio_dev *indio_dev)
869869
static void sx9500_gpio_probe(struct i2c_client *client,
870870
struct sx9500_data *data)
871871
{
872+
struct gpio_desc *gpiod_int;
872873
struct device *dev;
873874

874875
if (!client)
875876
return;
876877

877878
dev = &client->dev;
878879

880+
if (client->irq <= 0) {
881+
gpiod_int = devm_gpiod_get(dev, SX9500_GPIO_INT, GPIOD_IN);
882+
if (IS_ERR(gpiod_int))
883+
dev_err(dev, "gpio get irq failed\n");
884+
else
885+
client->irq = gpiod_to_irq(gpiod_int);
886+
}
887+
879888
data->gpiod_rst = devm_gpiod_get(dev, SX9500_GPIO_RESET, GPIOD_OUT_HIGH);
880889
if (IS_ERR(data->gpiod_rst)) {
881890
dev_warn(dev, "gpio get reset pin failed\n");

drivers/staging/ccree/ssi_hash.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1778,9 +1778,12 @@ static int ssi_ahash_import(struct ahash_request *req, const void *in)
17781778
}
17791779
in += sizeof(u32);
17801780

1781-
rc = ssi_hash_init(state, ctx);
1782-
if (rc)
1783-
goto out;
1781+
/* call init() to allocate bufs if the user hasn't */
1782+
if (!state->digest_buff) {
1783+
rc = ssi_hash_init(state, ctx);
1784+
if (rc)
1785+
goto out;
1786+
}
17841787

17851788
dma_sync_single_for_cpu(dev, state->digest_buff_dma_addr,
17861789
ctx->inter_digestsize, DMA_BIDIRECTIONAL);

drivers/staging/comedi/drivers/ni_atmio.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,3 +361,8 @@ static struct comedi_driver ni_atmio_driver = {
361361
.detach = ni_atmio_detach,
362362
};
363363
module_comedi_driver(ni_atmio_driver);
364+
365+
MODULE_AUTHOR("Comedi http://www.comedi.org");
366+
MODULE_DESCRIPTION("Comedi low-level driver");
367+
MODULE_LICENSE("GPL");
368+

drivers/staging/octeon-usb/octeon-hcd.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ struct octeon_hcd {
394394
result = -1; \
395395
break; \
396396
} else \
397-
cvmx_wait(100); \
397+
__delay(100); \
398398
} \
399399
} while (0); \
400400
result; })
@@ -774,7 +774,7 @@ static int cvmx_usb_initialize(struct device *dev,
774774
usbn_clk_ctl.s.hclk_rst = 1;
775775
cvmx_write64_uint64(CVMX_USBNX_CLK_CTL(usb->index), usbn_clk_ctl.u64);
776776
/* 2e. Wait 64 core-clock cycles for HCLK to stabilize */
777-
cvmx_wait(64);
777+
__delay(64);
778778
/*
779779
* 3. Program the power-on reset field in the USBN clock-control
780780
* register:
@@ -795,7 +795,7 @@ static int cvmx_usb_initialize(struct device *dev,
795795
cvmx_write64_uint64(CVMX_USBNX_USBP_CTL_STATUS(usb->index),
796796
usbn_usbp_ctl_status.u64);
797797
/* 6. Wait 10 cycles */
798-
cvmx_wait(10);
798+
__delay(10);
799799
/*
800800
* 7. Clear ATE_RESET field in the USBN clock-control register:
801801
* USBN_USBP_CTL_STATUS[ATE_RESET] = 0

drivers/staging/rtl8188eu/os_dep/ioctl_linux.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1395,19 +1395,13 @@ static int rtw_wx_get_essid(struct net_device *dev,
13951395
if ((check_fwstate(pmlmepriv, _FW_LINKED)) ||
13961396
(check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE))) {
13971397
len = pcur_bss->Ssid.SsidLength;
1398-
1399-
wrqu->essid.length = len;
1400-
14011398
memcpy(extra, pcur_bss->Ssid.Ssid, len);
1402-
1403-
wrqu->essid.flags = 1;
14041399
} else {
1405-
ret = -1;
1406-
goto exit;
1400+
len = 0;
1401+
*extra = 0;
14071402
}
1408-
1409-
exit:
1410-
1403+
wrqu->essid.length = len;
1404+
wrqu->essid.flags = 1;
14111405

14121406
return ret;
14131407
}

include/linux/iio/timer/stm32-lptim-trigger.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,14 @@
1616
#define LPTIM2_OUT "lptim2_out"
1717
#define LPTIM3_OUT "lptim3_out"
1818

19-
#if IS_ENABLED(CONFIG_IIO_STM32_LPTIMER_TRIGGER)
19+
#if IS_REACHABLE(CONFIG_IIO_STM32_LPTIMER_TRIGGER)
2020
bool is_stm32_lptim_trigger(struct iio_trigger *trig);
2121
#else
2222
static inline bool is_stm32_lptim_trigger(struct iio_trigger *trig)
2323
{
24+
#if IS_ENABLED(CONFIG_IIO_STM32_LPTIMER_TRIGGER)
25+
pr_warn_once("stm32 lptim_trigger not linked in\n");
26+
#endif
2427
return false;
2528
}
2629
#endif

0 commit comments

Comments
 (0)