Skip to content

Commit

Permalink
Merge tag 'staging-3.10-rc2' of git://git.kernel.org/pub/scm/linux/ke…
Browse files Browse the repository at this point in the history
…rnel/git/gregkh/staging

Pull staging driver fixes from Greg Kroah-Hartman:
 "Here are some staging tree driver fixes for 3.10-rc2

  The drivers/iio/ changes are here as they are still tied into
  drivers/staging/iio/.

  Nothing major, just a number of small bugfixes, and a larger
  documentation update for the ramster code."

* tag 'staging-3.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (28 commits)
  staging: dwc2: remove compile warning for USB_DWC2_TRACK_MISSED_SOFS
  iio: exynos_adc: fix wrong structure extration in suspend and resume
  iio:common:st: added disable function after read info raw data
  iio: dac: Fix build error when CONFIG_SPI_MASTER=y && CONFIG_I2C=m
  staging:iio:light:tsl2x7x: fix the error handling in tsl2x7x_probe()
  staging/iio/mxs-lradc: fix preenable for multiple buffers
  staging: imx-drm: imx-tve: Check the return value of 'regulator_enable()'
  staging: video: imx: Select VIDEOMODE_HELPERS for parallel display
  staging: ramster: add how-to document
  staging: dwc2: Fix dma-enabled platform devices using a default dma_mask
  staging: vt6656: [bug] Fix missing spin lock in iwctl_siwpower.
  staging: Swap zram and zsmalloc in Kconfig
  staging: android: logger: use kuid_t instead of uid_t
  staging: zcache: Fix incorrect module_param_array types
  staging/solo6x10: depend on CONFIG_FONTS
  staging/drm: imx: add missing dependencies
  staging: ste_rmi4: Suppress 'ignoring return value of ‘regulator_enable()' warning
  staging: sep: fix driver build and kconfig
  staging: nvec: cleanup childs on remove
  staging: nvec: implement unregistering of notifiers
  ...
  • Loading branch information
Linus Torvalds committed May 23, 2013
2 parents c7153d0 + 0797c3a commit 388c289
Show file tree
Hide file tree
Showing 32 changed files with 499 additions and 52 deletions.
8 changes: 4 additions & 4 deletions drivers/iio/adc/exynos_adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,8 @@ static int exynos_adc_remove(struct platform_device *pdev)
#ifdef CONFIG_PM_SLEEP
static int exynos_adc_suspend(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct exynos_adc *info = platform_get_drvdata(pdev);
struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct exynos_adc *info = iio_priv(indio_dev);
u32 con;

if (info->version == ADC_V2) {
Expand All @@ -413,8 +413,8 @@ static int exynos_adc_suspend(struct device *dev)

static int exynos_adc_resume(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct exynos_adc *info = platform_get_drvdata(pdev);
struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct exynos_adc *info = iio_priv(indio_dev);
int ret;

ret = regulator_enable(info->vdd);
Expand Down
2 changes: 2 additions & 0 deletions drivers/iio/common/st_sensors/st_sensors_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,8 @@ int st_sensors_read_info_raw(struct iio_dev *indio_dev,
goto read_error;

*val = *val >> ch->scan_type.shift;

err = st_sensors_set_enable(indio_dev, false);
}
mutex_unlock(&indio_dev->mlock);

Expand Down
6 changes: 3 additions & 3 deletions drivers/iio/dac/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ menu "Digital to analog converters"

config AD5064
tristate "Analog Devices AD5064 and similar multi-channel DAC driver"
depends on (SPI_MASTER || I2C)
depends on (SPI_MASTER && I2C!=m) || I2C
help
Say yes here to build support for Analog Devices AD5024, AD5025, AD5044,
AD5045, AD5064, AD5064-1, AD5065, AD5628, AD5629R, AD5648, AD5666, AD5668,
Expand All @@ -27,7 +27,7 @@ config AD5360

config AD5380
tristate "Analog Devices AD5380/81/82/83/84/90/91/92 DAC driver"
depends on (SPI_MASTER || I2C)
depends on (SPI_MASTER && I2C!=m) || I2C
select REGMAP_I2C if I2C
select REGMAP_SPI if SPI_MASTER
help
Expand Down Expand Up @@ -57,7 +57,7 @@ config AD5624R_SPI

config AD5446
tristate "Analog Devices AD5446 and similar single channel DACs driver"
depends on (SPI_MASTER || I2C)
depends on (SPI_MASTER && I2C!=m) || I2C
help
Say yes here to build support for Analog Devices AD5300, AD5301, AD5310,
AD5311, AD5320, AD5321, AD5444, AD5446, AD5450, AD5451, AD5452, AD5453,
Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ source "drivers/staging/sep/Kconfig"

source "drivers/staging/iio/Kconfig"

source "drivers/staging/zram/Kconfig"

source "drivers/staging/zsmalloc/Kconfig"

source "drivers/staging/zram/Kconfig"

source "drivers/staging/wlags49_h2/Kconfig"

source "drivers/staging/wlags49_h25/Kconfig"
Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/android/logger.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ static ssize_t do_read_log_to_user(struct logger_log *log,
* 'log->buffer' which contains the first entry readable by 'euid'
*/
static size_t get_next_entry_by_uid(struct logger_log *log,
size_t off, uid_t euid)
size_t off, kuid_t euid)
{
while (off != log->w_off) {
struct logger_entry *entry;
Expand All @@ -251,7 +251,7 @@ static size_t get_next_entry_by_uid(struct logger_log *log,

entry = get_entry_header(log, off, &scratch);

if (entry->euid == euid)
if (uid_eq(entry->euid, euid))
return off;

next_len = sizeof(struct logger_entry) + entry->len;
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/android/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ struct logger_entry {
__s32 tid;
__s32 sec;
__s32 nsec;
uid_t euid;
kuid_t euid;
char msg[0];
};

Expand Down
9 changes: 9 additions & 0 deletions drivers/staging/comedi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -981,6 +981,7 @@ config COMEDI_ME_DAQ

config COMEDI_NI_6527
tristate "NI 6527 support"
depends on HAS_DMA
select COMEDI_MITE
---help---
Enable support for the National Instruments 6527 PCI card
Expand All @@ -990,6 +991,7 @@ config COMEDI_NI_6527

config COMEDI_NI_65XX
tristate "NI 65xx static dio PCI card support"
depends on HAS_DMA
select COMEDI_MITE
---help---
Enable support for National Instruments 65xx static dio boards.
Expand All @@ -1003,6 +1005,7 @@ config COMEDI_NI_65XX

config COMEDI_NI_660X
tristate "NI 660x counter/timer PCI card support"
depends on HAS_DMA
select COMEDI_NI_TIOCMD
---help---
Enable support for National Instruments PCI-6601 (ni_660x), PCI-6602,
Expand All @@ -1013,6 +1016,7 @@ config COMEDI_NI_660X

config COMEDI_NI_670X
tristate "NI 670x PCI card support"
depends on HAS_DMA
select COMEDI_MITE
---help---
Enable support for National Instruments PCI-6703 and PCI-6704
Expand All @@ -1022,6 +1026,7 @@ config COMEDI_NI_670X

config COMEDI_NI_LABPC_PCI
tristate "NI Lab-PC PCI-1200 support"
depends on HAS_DMA
select COMEDI_NI_LABPC
select COMEDI_MITE
---help---
Expand All @@ -1032,6 +1037,7 @@ config COMEDI_NI_LABPC_PCI

config COMEDI_NI_PCIDIO
tristate "NI PCI-DIO32HS, PCI-6533, PCI-6534 support"
depends on HAS_DMA
select COMEDI_MITE
select COMEDI_8255
---help---
Expand All @@ -1043,6 +1049,7 @@ config COMEDI_NI_PCIDIO

config COMEDI_NI_PCIMIO
tristate "NI PCI-MIO-E series and M series support"
depends on HAS_DMA
select COMEDI_NI_TIOCMD
select COMEDI_8255
select COMEDI_FC
Expand Down Expand Up @@ -1095,10 +1102,12 @@ config COMEDI_SSV_DNP
called ssv_dnp.

config COMEDI_MITE
depends on HAS_DMA
tristate

config COMEDI_NI_TIOCMD
tristate
depends on HAS_DMA
select COMEDI_NI_TIO
select COMEDI_MITE

Expand Down
12 changes: 12 additions & 0 deletions drivers/staging/comedi/comedi_buf.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,12 @@ static void __comedi_buf_free(struct comedi_device *dev,
clear_bit(PG_reserved,
&(virt_to_page(buf->virt_addr)->flags));
if (s->async_dma_dir != DMA_NONE) {
#ifdef CONFIG_HAS_DMA
dma_free_coherent(dev->hw_dev,
PAGE_SIZE,
buf->virt_addr,
buf->dma_addr);
#endif
} else {
free_page((unsigned long)buf->virt_addr);
}
Expand All @@ -74,6 +76,12 @@ static void __comedi_buf_alloc(struct comedi_device *dev,
struct comedi_buf_page *buf;
unsigned i;

if (!IS_ENABLED(CONFIG_HAS_DMA) && s->async_dma_dir != DMA_NONE) {
dev_err(dev->class_dev,
"dma buffer allocation not supported\n");
return;
}

async->buf_page_list = vzalloc(sizeof(*buf) * n_pages);
if (async->buf_page_list)
pages = vmalloc(sizeof(struct page *) * n_pages);
Expand All @@ -84,11 +92,15 @@ static void __comedi_buf_alloc(struct comedi_device *dev,
for (i = 0; i < n_pages; i++) {
buf = &async->buf_page_list[i];
if (s->async_dma_dir != DMA_NONE)
#ifdef CONFIG_HAS_DMA
buf->virt_addr = dma_alloc_coherent(dev->hw_dev,
PAGE_SIZE,
&buf->dma_addr,
GFP_KERNEL |
__GFP_COMP);
#else
break;
#endif
else
buf->virt_addr = (void *)get_zeroed_page(GFP_KERNEL);
if (!buf->virt_addr)
Expand Down
3 changes: 0 additions & 3 deletions drivers/staging/comedi/comedi_fops.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,6 @@ static int resize_async_buffer(struct comedi_device *dev,
return -EBUSY;
}

if (!async->prealloc_buf)
return -EINVAL;

/* make sure buffer is an integral number of pages
* (we round up) */
new_size = (new_size + PAGE_SIZE - 1) & PAGE_MASK;
Expand Down
8 changes: 5 additions & 3 deletions drivers/staging/comedi/drivers/ni_labpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -976,8 +976,7 @@ static int labpc_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
/* clear flip-flop to make sure 2-byte registers for
* count and address get set correctly */
clear_dma_ff(devpriv->dma_chan);
set_dma_addr(devpriv->dma_chan,
virt_to_bus(devpriv->dma_buffer));
set_dma_addr(devpriv->dma_chan, devpriv->dma_addr);
/* set appropriate size of transfer */
devpriv->dma_transfer_size = labpc_suggest_transfer_size(cmd);
if (cmd->stop_src == TRIG_COUNT &&
Expand Down Expand Up @@ -1089,7 +1088,7 @@ static void labpc_drain_dma(struct comedi_device *dev)
devpriv->count -= num_points;

/* set address and count for next transfer */
set_dma_addr(devpriv->dma_chan, virt_to_bus(devpriv->dma_buffer));
set_dma_addr(devpriv->dma_chan, devpriv->dma_addr);
set_dma_count(devpriv->dma_chan, leftover * sample_size);
release_dma_lock(flags);

Expand Down Expand Up @@ -1741,6 +1740,9 @@ static int labpc_attach(struct comedi_device *dev, struct comedi_devconfig *it)
unsigned long dma_flags;

devpriv->dma_chan = dma_chan;
devpriv->dma_addr =
virt_to_bus(devpriv->dma_buffer);

dma_flags = claim_dma_lock();
disable_dma(devpriv->dma_chan);
set_dma_mode(devpriv->dma_chan, DMA_MODE_READ);
Expand Down
1 change: 1 addition & 0 deletions drivers/staging/comedi/drivers/ni_labpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ struct labpc_private {
unsigned int divisor_b1;
unsigned int dma_chan; /* dma channel to use */
u16 *dma_buffer; /* buffer ai will dma into */
phys_addr_t dma_addr;
/* transfer size in bytes for current transfer */
unsigned int dma_transfer_size;
/* we are using dma/fifo-half-full/etc. */
Expand Down
20 changes: 10 additions & 10 deletions drivers/staging/comedi/drivers/ni_mio_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,11 @@ static int ni_gpct_insn_read(struct comedi_device *dev,
static int ni_gpct_insn_config(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
#ifdef PCIDMA
static int ni_gpct_cmd(struct comedi_device *dev, struct comedi_subdevice *s);
static int ni_gpct_cmdtest(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_cmd *cmd);
#endif
static int ni_gpct_cancel(struct comedi_device *dev,
struct comedi_subdevice *s);
static void handle_gpct_interrupt(struct comedi_device *dev,
Expand Down Expand Up @@ -4617,9 +4619,7 @@ static int ni_E_init(struct comedi_device *dev)
for (j = 0; j < NUM_GPCT; ++j) {
s = &dev->subdevices[NI_GPCT_SUBDEV(j)];
s->type = COMEDI_SUBD_COUNTER;
s->subdev_flags =
SDF_READABLE | SDF_WRITABLE | SDF_LSAMPL | SDF_CMD_READ
/* | SDF_CMD_WRITE */ ;
s->subdev_flags = SDF_READABLE | SDF_WRITABLE | SDF_LSAMPL;
s->n_chan = 3;
if (board->reg_type & ni_reg_m_series_mask)
s->maxdata = 0xffffffff;
Expand All @@ -4628,11 +4628,14 @@ static int ni_E_init(struct comedi_device *dev)
s->insn_read = &ni_gpct_insn_read;
s->insn_write = &ni_gpct_insn_write;
s->insn_config = &ni_gpct_insn_config;
#ifdef PCIDMA
s->subdev_flags |= SDF_CMD_READ /* | SDF_CMD_WRITE */;
s->do_cmd = &ni_gpct_cmd;
s->len_chanlist = 1;
s->do_cmdtest = &ni_gpct_cmdtest;
s->cancel = &ni_gpct_cancel;
s->async_dma_dir = DMA_BIDIRECTIONAL;
#endif
s->private = &devpriv->counter_dev->counters[j];

devpriv->counter_dev->counters[j].chip_index = 0;
Expand Down Expand Up @@ -5216,10 +5219,10 @@ static int ni_gpct_insn_write(struct comedi_device *dev,
return ni_tio_winsn(counter, insn, data);
}

#ifdef PCIDMA
static int ni_gpct_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
{
int retval;
#ifdef PCIDMA
struct ni_gpct *counter = s->private;
/* const struct comedi_cmd *cmd = &s->async->cmd; */

Expand All @@ -5233,23 +5236,20 @@ static int ni_gpct_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
ni_tio_acknowledge_and_confirm(counter, NULL, NULL, NULL, NULL);
ni_e_series_enable_second_irq(dev, counter->counter_index, 1);
retval = ni_tio_cmd(counter, s->async);
#else
retval = -ENOTSUPP;
#endif
return retval;
}
#endif

#ifdef PCIDMA
static int ni_gpct_cmdtest(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_cmd *cmd)
{
#ifdef PCIDMA
struct ni_gpct *counter = s->private;

return ni_tio_cmdtest(counter, cmd);
#else
return -ENOTSUPP;
#endif
}
#endif

static int ni_gpct_cancel(struct comedi_device *dev, struct comedi_subdevice *s)
{
Expand Down
1 change: 1 addition & 0 deletions drivers/staging/dwc2/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ config USB_DWC2_TRACK_MISSED_SOFS
bool "Enable Missed SOF Tracking"
help
Say Y here to enable logging of missed SOF events to the dmesg log.
WARNING: This feature is still experimental.
If in doubt, say N.

config USB_DWC2_DEBUG_PERIODIC
Expand Down
2 changes: 0 additions & 2 deletions drivers/staging/dwc2/hcd_intr.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@
static void dwc2_track_missed_sofs(struct dwc2_hsotg *hsotg)
{
#ifdef CONFIG_USB_DWC2_TRACK_MISSED_SOFS
#warning Compiling code to track missed SOFs

u16 curr_frame_number = hsotg->frame_number;

if (hsotg->frame_num_idx < FRAME_NUM_ARRAY_SIZE) {
Expand Down
8 changes: 8 additions & 0 deletions drivers/staging/dwc2/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@ static int dwc2_driver_probe(struct platform_device *dev)

hsotg->dev = &dev->dev;

/*
* Use reasonable defaults so platforms don't have to provide these.
*/
if (!dev->dev.dma_mask)
dev->dev.dma_mask = &dev->dev.coherent_dma_mask;
if (!dev->dev.coherent_dma_mask)
dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);

irq = platform_get_irq(dev, 0);
if (irq < 0) {
dev_err(&dev->dev, "missing IRQ resource\n");
Expand Down
5 changes: 2 additions & 3 deletions drivers/staging/iio/adc/mxs-lradc.c
Original file line number Diff line number Diff line change
Expand Up @@ -690,15 +690,14 @@ static void mxs_lradc_trigger_remove(struct iio_dev *iio)
static int mxs_lradc_buffer_preenable(struct iio_dev *iio)
{
struct mxs_lradc *lradc = iio_priv(iio);
struct iio_buffer *buffer = iio->buffer;
int ret = 0, chan, ofs = 0;
unsigned long enable = 0;
uint32_t ctrl4_set = 0;
uint32_t ctrl4_clr = 0;
uint32_t ctrl1_irq = 0;
const uint32_t chan_value = LRADC_CH_ACCUMULATE |
((LRADC_DELAY_TIMER_LOOP - 1) << LRADC_CH_NUM_SAMPLES_OFFSET);
const int len = bitmap_weight(buffer->scan_mask, LRADC_MAX_TOTAL_CHANS);
const int len = bitmap_weight(iio->active_scan_mask, LRADC_MAX_TOTAL_CHANS);

if (!len)
return -EINVAL;
Expand All @@ -725,7 +724,7 @@ static int mxs_lradc_buffer_preenable(struct iio_dev *iio)
lradc->base + LRADC_CTRL1 + STMP_OFFSET_REG_CLR);
writel(0xff, lradc->base + LRADC_CTRL0 + STMP_OFFSET_REG_CLR);

for_each_set_bit(chan, buffer->scan_mask, LRADC_MAX_TOTAL_CHANS) {
for_each_set_bit(chan, iio->active_scan_mask, LRADC_MAX_TOTAL_CHANS) {
ctrl4_set |= chan << LRADC_CTRL4_LRADCSELECT_OFFSET(ofs);
ctrl4_clr |= LRADC_CTRL4_LRADCSELECT_MASK(ofs);
ctrl1_irq |= LRADC_CTRL1_LRADC_IRQ_EN(ofs);
Expand Down
Loading

0 comments on commit 388c289

Please sign in to comment.