From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752021AbcGAMak (ORCPT ); Fri, 1 Jul 2016 08:30:40 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:59055 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750702AbcGAMai (ORCPT ); Fri, 1 Jul 2016 08:30:38 -0400 X-AuditID: cbfee68f-f79476d000001429-2d-5776626b58ed Date: Fri, 01 Jul 2016 21:30:35 +0900 From: Andi Shyti To: Sean Young Cc: Mauro Carvalho Chehab , Rob Herring , Mark Rutland , devicetree@vger.kernel.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Andi Shyti Subject: Re: [PATCH] [media] rc: ir-spi: add support for IR LEDs connected with SPI Message-id: <20160701123035.GA12029@samsunx.samsung> References: <1467362022-12704-1-git-send-email-andi.shyti@samsung.com> <20160701094458.GA8933@gofer.mess.org> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-disposition: inline In-reply-to: <20160701094458.GA8933@gofer.mess.org> User-Agent: Mutt/1.6.0 (2016-04-01) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrFIsWRmVeSWpSXmKPExsWyRsSkUDc7qSzcYPI0JYvFP54zWcw/co7V 4vKuOWwWPRu2slosvX6RyWL1swqL1r1H2C0WPv3O4sDhsWbeGkaP60s+MXtsWtXJ5rHkjbXH lv677B6fN8kFsEVx2aSk5mSWpRbp2yVwZezcLVNwQKSicdsa1gbGh/xdjJwcEgImEutff2SC sMUkLtxbz9bFyMUhJLCCUeLtnDNADgdY0aHDDhDxpYwS/1rWs4A0CAl8ZJR4OasOxGYRUJV4 On8+2CA2AU2Jpts/2EBsEQE5iW/bWlhBmpkFvjFKnDo0iREkISwQKrHh92+wQbxAC25fu80K seEwo8TU5ntsEAlBiR+T74EVMQtoSazfeZwJwpaWePR3BjuIzSlgLPHv21omkEtFBZQl7i4L Apkj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ollIUL8aYkVlalFuXHF5Xm pBYfYjQFhshEZinR5HxgEsoriTc0NjEzsjQyN7QwMjZXEud9/H9dmJBAemJJanZqakFqEUwf EwenVAOjAnvBrQ/SRS/dYhumNC6If3+ytmbfGs3DFxectdnCeHjbeeGJQXvr/6SHT808wzVh Jc8O15n5D9OzzIObT9Ut9NK7zpW2nXfqjbD1u0wyp6Ud1rV/NnvfhRV88t8FhLl+vHhb3nXU TFhyTfJKqdmZ3+Lmr1aueJ387N2UPevvhDSrtc1lei75S4mlOCPRUIu5qDgRAAbdJ/YKAwAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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