Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 354412
b: refs/heads/master
c: 4e98fcf
h: refs/heads/master
v: v3
  • Loading branch information
Greg Kroah-Hartman committed Feb 5, 2013
1 parent 08e4c5d commit cdde5b9
Show file tree
Hide file tree
Showing 41 changed files with 1,260 additions and 1,939 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: 6cb2afd7c0abb93bd9dc6d36b858b1e312e2407d
refs/heads/master: 4e98fcfb95dfd9c40976dcfa2f3b878eeec4dbaa
42 changes: 0 additions & 42 deletions trunk/drivers/iio/adc/max1363.c
Original file line number Diff line number Diff line change
Expand Up @@ -1484,48 +1484,6 @@ static const struct iio_buffer_setup_ops max1363_buffered_setup_ops = {
.predisable = &iio_triggered_buffer_predisable,
};

static int max1363_register_buffered_funcs_and_init(struct iio_dev *indio_dev)
{
struct max1363_state *st = iio_priv(indio_dev);
int ret = 0;

indio_dev->buffer = iio_kfifo_allocate(indio_dev);
if (!indio_dev->buffer) {
ret = -ENOMEM;
goto error_ret;
}
indio_dev->pollfunc = iio_alloc_pollfunc(NULL,
&max1363_trigger_handler,
IRQF_ONESHOT,
indio_dev,
"%s_consumer%d",
st->client->name,
indio_dev->id);
if (indio_dev->pollfunc == NULL) {
ret = -ENOMEM;
goto error_deallocate_sw_rb;
}
/* Buffer functions - here trigger setup related */
indio_dev->setup_ops = &max1363_buffered_setup_ops;

/* Flag that polled buffering is possible */
indio_dev->modes |= INDIO_BUFFER_TRIGGERED;

return 0;

error_deallocate_sw_rb:
iio_kfifo_free(indio_dev->buffer);
error_ret:
return ret;
}

static void max1363_buffer_cleanup(struct iio_dev *indio_dev)
{
/* ensure that the trigger has been detached */
iio_dealloc_pollfunc(indio_dev->pollfunc);
iio_kfifo_free(indio_dev->buffer);
}

static int max1363_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/staging/comedi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ config COMEDI_DAS08_ISA
DAS08/JR-16-AO, PC104-DAS08, DAS08/JR/16.

To compile this driver as a module, choose M here: the module will be
called das08.
called das08_isa.

config COMEDI_DAS16
tristate "DAS-16 compatible ISA and PC/104 card support"
Expand Down Expand Up @@ -802,7 +802,7 @@ config COMEDI_DAS08_PCI
Enable support for PCI DAS-08 cards.

To compile this driver as a module, choose M here: the module will be
called das08.
called das08_pci.

config COMEDI_DT3000
tristate "Data Translation DT3000 series support"
Expand Down
25 changes: 6 additions & 19 deletions trunk/drivers/staging/comedi/comedi_fops.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,6 @@ MODULE_PARM_DESC(comedi_debug,
);
#endif

bool comedi_autoconfig = true;
module_param(comedi_autoconfig, bool, S_IRUGO);
MODULE_PARM_DESC(comedi_autoconfig,
"enable drivers to auto-configure comedi devices (default 1)");

static int comedi_num_legacy_minors;
module_param(comedi_num_legacy_minors, int, S_IRUGO);
MODULE_PARM_DESC(comedi_num_legacy_minors,
Expand Down Expand Up @@ -1844,15 +1839,15 @@ static unsigned int comedi_poll(struct file *file, poll_table *wait)
}

s = comedi_read_subdevice(info);
if (s) {
if (s && s->async) {
poll_wait(file, &s->async->wait_head, wait);
if (!s->busy || !comedi_is_subdevice_running(s) ||
comedi_buf_read_n_available(s->async) > 0)
mask |= POLLIN | POLLRDNORM;
}

s = comedi_write_subdevice(info);
if (s) {
if (s && s->async) {
unsigned int bps = bytes_per_sample(s->async->subdevice);

poll_wait(file, &s->async->wait_head, wait);
Expand Down Expand Up @@ -1887,7 +1882,7 @@ static ssize_t comedi_write(struct file *file, const char __user *buf,
}

s = comedi_write_subdevice(info);
if (!s)
if (!s || !s->async)
return -EIO;

async = s->async;
Expand Down Expand Up @@ -1982,7 +1977,7 @@ static ssize_t comedi_read(struct file *file, char __user *buf, size_t nbytes,
}

s = comedi_read_subdevice(info);
if (!s)
if (!s || !s->async)
return -EIO;

async = s->async;
Expand Down Expand Up @@ -2352,9 +2347,9 @@ int comedi_find_board_minor(struct device *hardware_device)
return -ENODEV;
}

int comedi_alloc_subdevice_minor(struct comedi_device *dev,
struct comedi_subdevice *s)
int comedi_alloc_subdevice_minor(struct comedi_subdevice *s)
{
struct comedi_device *dev = s->device;
struct comedi_file_info *info;
struct device *csdev;
unsigned i;
Expand Down Expand Up @@ -2437,14 +2432,6 @@ static int __init comedi_init(void)
return -EINVAL;
}

/*
* comedi is unusable if both comedi_autoconfig and
* comedi_num_legacy_minors are zero, so we might as well adjust the
* defaults in that case
*/
if (!comedi_autoconfig && comedi_num_legacy_minors == 0)
comedi_num_legacy_minors = 16;

memset(comedi_file_info_table, 0,
sizeof(struct comedi_file_info *) * COMEDI_NUM_MINORS);

Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/staging/comedi/comedi_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ int do_rangeinfo_ioctl(struct comedi_device *dev,
int comedi_alloc_board_minor(struct device *hardware_device);
void comedi_free_board_minor(unsigned minor);
int comedi_find_board_minor(struct device *hardware_device);
int comedi_alloc_subdevice_minor(struct comedi_subdevice *s);
void comedi_free_subdevice_minor(struct comedi_subdevice *s);

int comedi_buf_alloc(struct comedi_device *dev, struct comedi_subdevice *s,
unsigned long new_size);
Expand All @@ -19,7 +21,6 @@ unsigned int comedi_buf_write_n_allocated(struct comedi_async *async);

extern unsigned int comedi_default_buf_size_kb;
extern unsigned int comedi_default_buf_maxsize_kb;
extern bool comedi_autoconfig;

/* drivers.c */

Expand Down
46 changes: 46 additions & 0 deletions trunk/drivers/staging/comedi/comedi_pcmcia.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,52 @@ struct pcmcia_device *comedi_to_pcmcia_dev(struct comedi_device *dev)
}
EXPORT_SYMBOL_GPL(comedi_to_pcmcia_dev);

static int comedi_pcmcia_conf_check(struct pcmcia_device *link,
void *priv_data)
{
if (link->config_index == 0)
return -EINVAL;

return pcmcia_request_io(link);
}

/**
* comedi_pcmcia_enable() - Request the regions and enable the PCMCIA device.
* @dev: comedi_device struct
*
* The comedi PCMCIA driver needs to set the link->config_flags, as
* appropriate for that driver, before calling this function in order
* to allow pcmcia_loop_config() to do its internal autoconfiguration.
*/
int comedi_pcmcia_enable(struct comedi_device *dev)
{
struct pcmcia_device *link = comedi_to_pcmcia_dev(dev);
int ret;

if (!link)
return -ENODEV;

ret = pcmcia_loop_config(link, comedi_pcmcia_conf_check, NULL);
if (ret)
return ret;

return pcmcia_enable_device(link);
}
EXPORT_SYMBOL_GPL(comedi_pcmcia_enable);

/**
* comedi_pcmcia_disable() - Disable the PCMCIA device and release the regions.
* @dev: comedi_device struct
*/
void comedi_pcmcia_disable(struct comedi_device *dev)
{
struct pcmcia_device *link = comedi_to_pcmcia_dev(dev);

if (link)
pcmcia_disable_device(link);
}
EXPORT_SYMBOL_GPL(comedi_pcmcia_disable);

/**
* comedi_pcmcia_auto_config() - Configure/probe a comedi PCMCIA driver.
* @link: pcmcia_device struct
Expand Down
21 changes: 4 additions & 17 deletions trunk/drivers/staging/comedi/comedidev.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,14 +324,7 @@ static inline unsigned int bytes_per_sample(const struct comedi_subdevice *subd)
* known bus type. Set automatically for auto-configured devices.
* Automatically set to NULL when detaching hardware device.
*/
static inline void comedi_set_hw_dev(struct comedi_device *dev,
struct device *hw_dev)
{
struct device *old_hw_dev = dev->hw_dev;

dev->hw_dev = get_device(hw_dev);
put_device(old_hw_dev);
}
int comedi_set_hw_dev(struct comedi_device *dev, struct device *hw_dev);

unsigned int comedi_buf_write_alloc(struct comedi_async *, unsigned int);
unsigned int comedi_buf_write_free(struct comedi_async *, unsigned int);
Expand All @@ -348,10 +341,6 @@ void comedi_buf_memcpy_to(struct comedi_async *async, unsigned int offset,
void comedi_buf_memcpy_from(struct comedi_async *async, unsigned int offset,
void *destination, unsigned int num_bytes);

int comedi_alloc_subdevice_minor(struct comedi_device *dev,
struct comedi_subdevice *s);
void comedi_free_subdevice_minor(struct comedi_subdevice *s);

/* drivers.c - general comedi driver functions */

int comedi_alloc_subdevices(struct comedi_device *, int);
Expand Down Expand Up @@ -388,12 +377,7 @@ int comedi_driver_unregister(struct comedi_driver *);
#define PCI_VENDOR_ID_DT 0x1116
#define PCI_VENDOR_ID_IOTECH 0x1616
#define PCI_VENDOR_ID_CONTEC 0x1221
#define PCI_VENDOR_ID_CB 0x1307 /* Measurement Computing */
#define PCI_VENDOR_ID_ADVANTECH 0x13fe
#define PCI_VENDOR_ID_MEILHAUS 0x1402
#define PCI_VENDOR_ID_RTD 0x1435
#define PCI_VENDOR_ID_ADLINK 0x144a
#define PCI_VENDOR_ID_AMPLICON 0x14dc

struct pci_dev;
struct pci_driver;
Expand Down Expand Up @@ -456,6 +440,9 @@ struct pcmcia_device;

struct pcmcia_device *comedi_to_pcmcia_dev(struct comedi_device *);

int comedi_pcmcia_enable(struct comedi_device *);
void comedi_pcmcia_disable(struct comedi_device *);

int comedi_pcmcia_auto_config(struct pcmcia_device *, struct comedi_driver *);
void comedi_pcmcia_auto_unconfig(struct pcmcia_device *);

Expand Down
24 changes: 19 additions & 5 deletions trunk/drivers/staging/comedi/drivers.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,23 @@

struct comedi_driver *comedi_drivers;

int comedi_set_hw_dev(struct comedi_device *dev, struct device *hw_dev)
{
if (hw_dev == dev->hw_dev)
return 0;
if (dev->hw_dev != NULL)
return -EEXIST;
dev->hw_dev = get_device(hw_dev);
return 0;
}
EXPORT_SYMBOL_GPL(comedi_set_hw_dev);

static void comedi_clear_hw_dev(struct comedi_device *dev)
{
put_device(dev->hw_dev);
dev->hw_dev = NULL;
}

int comedi_alloc_subdevices(struct comedi_device *dev, int num_subdevices)
{
struct comedi_subdevice *s;
Expand Down Expand Up @@ -98,7 +115,7 @@ static void cleanup_device(struct comedi_device *dev)
dev->write_subdev = NULL;
dev->open = NULL;
dev->close = NULL;
comedi_set_hw_dev(dev, NULL);
comedi_clear_hw_dev(dev);
}

static void __comedi_device_detach(struct comedi_device *dev)
Expand Down Expand Up @@ -209,7 +226,7 @@ static int __comedi_device_postconfig_async(struct comedi_device *dev,
return ret;
}

comedi_alloc_subdevice_minor(dev, s);
comedi_alloc_subdevice_minor(s);

return 0;
}
Expand Down Expand Up @@ -393,9 +410,6 @@ int comedi_auto_config(struct device *hardware_device,
struct comedi_device *comedi_dev;
int ret;

if (!comedi_autoconfig)
return 0;

if (!driver->auto_attach) {
dev_warn(hardware_device,
"BUG! comedi driver '%s' has no auto_attach handler\n",
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/staging/comedi/drivers/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ obj-$(CONFIG_COMEDI_PCM3730) += pcm3730.o
obj-$(CONFIG_COMEDI_RTI800) += rti800.o
obj-$(CONFIG_COMEDI_RTI802) += rti802.o
obj-$(CONFIG_COMEDI_DAS16M1) += das16m1.o
obj-$(CONFIG_COMEDI_DAS08_ISA) += das08_isa.o
obj-$(CONFIG_COMEDI_DAS16) += das16.o
obj-$(CONFIG_COMEDI_DAS800) += das800.o
obj-$(CONFIG_COMEDI_DAS1800) += das1800.o
Expand Down Expand Up @@ -81,6 +82,7 @@ obj-$(CONFIG_COMEDI_AMPLC_PC263) += amplc_pc263.o
obj-$(CONFIG_COMEDI_AMPLC_PCI224) += amplc_pci224.o
obj-$(CONFIG_COMEDI_AMPLC_PCI230) += amplc_pci230.o
obj-$(CONFIG_COMEDI_CONTEC_PCI_DIO) += contec_pci_dio.o
obj-$(CONFIG_COMEDI_DAS08_PCI) += das08_pci.o
obj-$(CONFIG_COMEDI_DT3000) += dt3000.o
obj-$(CONFIG_COMEDI_DYNA_PCI10XX) += dyna_pci10xx.o
obj-$(CONFIG_COMEDI_UNIOXX5) += unioxx5.o
Expand Down
8 changes: 1 addition & 7 deletions trunk/drivers/staging/comedi/drivers/adl_pci7x3x.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,14 @@ Author: H Hartley Sweeten <hsweeten@visionengravers.com>
Updated: Thu, 02 Aug 2012 14:27:46 -0700
Status: untested
This driver only attaches using the PCI PnP auto config support
in the comedi core. The module parameter 'comedi_autoconfig'
must be 1 (default) to enable this feature. The COMEDI_DEVCONFIG
ioctl, used by the comedi_config utility, is not supported by
this driver.
The PCI-7230, PCI-7432 and PCI-7433 boards also support external
interrupt signals on digital input channels 0 and 1. The PCI-7233
has dual-interrupt sources for change-of-state (COS) on any 16
digital input channels of LSB and for COS on any 16 digital input
lines of MSB. Interrupts are not currently supported by this
driver.
Configuration Options: not applicable
Configuration Options: not applicable, uses comedi PCI auto config
*/

#include <linux/pci.h>
Expand Down
Loading

0 comments on commit cdde5b9

Please sign in to comment.