Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1435294

Re: [PATCH] [media] rc: ir-spi: add support for IR LEDs connected with SPI

From Andi Shyti <andi.shyti@samsung.com>
Newsgroups linux.kernel
Subject Re: [PATCH] [media] rc: ir-spi: add support for IR LEDs connected with SPI
Date 2016-07-01 14:40 +0200
Message-ID <rQ5TI-6DF-17@gated-at.bofh.it> (permalink)
References <rQ29s-4m1-43@gated-at.bofh.it> <rQ5TI-6DF-19@gated-at.bofh.it> <rQ3fc-4Yz-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Sean,

> > The ir-spi is a simple device driver which supports the
> > connection between an IR LED and the MOSI line of an SPI device.
> > 
> > The driver, indeed, uses the SPI framework to stream the raw data
> > provided by userspace through a character device. The chardev is
> > handled by the LIRC framework and its functionality basically
> > provides:
> > 
> >  - raw write: data to be sent to the SPI and then streamed to the
> >    MOSI line;
> >  - set frequency: sets the frequency whith which the data should
> >    be sent;
> >  - set length: sets the data length. This information is
> >    optional, if the length is set, then userspace should send raw
> >    data only with that length; while if the length is set to '0',
> >    then the driver will figure out himself the length of the data
> >    based on the length of the data written on the character
> >    device.
> >    The latter is not recommended, though, as the driver, at
> >    any write, allocates and deallocates a buffer where the data
> >    from userspace are stored.
> > 
> > The driver provides three feedback commands:
> > 
> >  - get length: reads the length set and (as mentioned), if the
> >    length is '0' it will be calculated at any write
> >  - get frequency: the driver reports the frequency. If userpace
> >    doesn't set the frequency, the driver will use a default value
> >    of 38000Hz.
> 
> This interface is not compatible with other lirc devices; there is no
> way of determining whether this is a regular lirc device or this new
> flavour you've invented.

except of the set length and get length which I'm using a bit
freely because I am dealing with devices that exchange always the
same amount of data, so that I don't need (in my case) to
pre-allocate or overallocate or runtime allocate. I don't
understand what else I invented :)

This is a simple driver which is driving an LED connected through
SPI and userspace writes raw data in it (LIRC_CAN_SEND_RAW).

> Also I don't see what justifies this new interface. This can be 
> implemented in rc-core in less lines of code and it will be entirely 
> compatible with existing user-space.

Also here I'm getting a bit confused. When I started writing
this, I didn't even know of the existence of a remote controlling
framework, but then I run across this:

"LIRC is a package that allows you to decode and send infra-red
signals of many (but not all) commonly used remote controls. "

taken from lirc.org: my case is exactly falling into this
description.

Am I missing anything?

Thanks,
Andi

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] [media] rc: ir-spi: add support for IR LEDs connected with SPI Andi Shyti <andi.shyti@samsung.com> - 2016-07-01 10:40 +0200
  Re: [PATCH] [media] rc: ir-spi: add support for IR LEDs connected  with SPI Sean Young <sean@mess.org> - 2016-07-01 11:50 +0200
    Re: [PATCH] [media] rc: ir-spi: add support for IR LEDs connected with  SPI Andi Shyti <andi.shyti@samsung.com> - 2016-07-01 14:40 +0200
      Re: [PATCH] [media] rc: ir-spi: add support for IR LEDs connected  with SPI Sean Young <sean@mess.org> - 2016-07-01 15:30 +0200
        Re: [PATCH] [media] rc: ir-spi: add support for IR LEDs connected  with SPI Andi Shyti <andi@etezian.org> - 2016-07-01 16:10 +0200
  Re: [PATCH] [media] rc: ir-spi: add support for IR LEDs connected  with SPI kbuild test robot <lkp@intel.com> - 2016-07-02 07:00 +0200
  Re: [PATCH] [media] rc: ir-spi: add support for IR LEDs connected  with SPI Rob Herring <robh@kernel.org> - 2016-07-05 16:30 +0200
    Re: [PATCH] [media] rc: ir-spi: add support for IR LEDs connected  with SPI Andi Shyti <andi@etezian.org> - 2016-07-05 17:10 +0200

csiph-web