From patchwork Fri Feb 18 01:19:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Walls X-Patchwork-Id: 572781 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p1I1JAxH024502 for ; Fri, 18 Feb 2011 01:19:10 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758144Ab1BRBTJ (ORCPT ); Thu, 17 Feb 2011 20:19:09 -0500 Received: from proofpoint-cluster.metrocast.net ([65.175.128.136]:57232 "EHLO proofpoint-cluster.metrocast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757617Ab1BRBTH (ORCPT ); Thu, 17 Feb 2011 20:19:07 -0500 Received: from [192.168.1.2] (d-216-36-28-191.cpe.metrocast.net [216.36.28.191]) (authenticated bits=0) by mango.metrocast.net (8.13.8/8.13.8) with ESMTP id p1I1J1ca020589 for ; Fri, 18 Feb 2011 01:19:04 GMT Subject: [PATCH 09/13] lirc_zilog: Move constants from ir_probe() into the lirc_driver template From: Andy Walls To: linux-media@vger.kernel.org In-Reply-To: <1297991502.9399.16.camel@localhost> References: <1297991502.9399.16.camel@localhost> Date: Thu, 17 Feb 2011 20:19:14 -0500 Message-ID: <1297991954.9399.25.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 (2.28.3-1.fc12) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.2.15, 1.0.148, 0.0.0000 definitions=2011-02-18_01:2011-02-17, 2011-02-18, 1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=3 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=5.0.0-1012030000 definitions=main-1102170207 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 18 Feb 2011 01:19:10 +0000 (UTC) diff --git a/drivers/staging/lirc/lirc_zilog.c b/drivers/staging/lirc/lirc_zilog.c index a94b10a..8ab60e9 100644 --- a/drivers/staging/lirc/lirc_zilog.c +++ b/drivers/staging/lirc/lirc_zilog.c @@ -1116,13 +1116,6 @@ static int close(struct inode *node, struct file *filep) return 0; } -static struct lirc_driver lirc_template = { - .name = "lirc_zilog", - .set_use_inc = set_use_inc, - .set_use_dec = set_use_dec, - .owner = THIS_MODULE -}; - static int ir_remove(struct i2c_client *client); static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id); @@ -1161,6 +1154,19 @@ static const struct file_operations lirc_fops = { .release = close }; +static struct lirc_driver lirc_template = { + .name = "lirc_zilog", + .minor = -1, + .code_length = 13, + .buffer_size = BUFLEN / 2, + .sample_rate = 0, /* tell lirc_dev to not start its own kthread */ + .chunk_size = 2, + .set_use_inc = set_use_inc, + .set_use_dec = set_use_dec, + .fops = &lirc_fops, + .owner = THIS_MODULE, +}; + static void destroy_rx_kthread(struct IR_rx *rx) { /* end up polling thread */ @@ -1292,14 +1298,9 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) /* set lirc_dev stuff */ memcpy(&ir->l, &lirc_template, sizeof(struct lirc_driver)); ir->l.minor = minor; /* module option */ - ir->l.code_length = 13; - ir->l.chunk_size = 2; - ir->l.buffer_size = BUFLEN / 2; ir->l.rbuf = &ir->rbuf; - ir->l.fops = &lirc_fops; ir->l.data = ir; ir->l.dev = &adap->dev; - ir->l.sample_rate = 0; ret = lirc_buffer_init(ir->l.rbuf, ir->l.chunk_size, ir->l.buffer_size); if (ret) @@ -1314,6 +1315,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) goto out_free_xx; } + ir->l.features |= LIRC_CAN_SEND_PULSE; ir->tx->c = client; ir->tx->need_boot = 1; ir->tx->post_tx_ready_poll = @@ -1326,6 +1328,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) goto out_free_xx; } + ir->l.features |= LIRC_CAN_REC_LIRCCODE; ir->rx->c = client; ir->rx->hdpvr_data_fmt = (id->driver_data & ID_FLAG_HDPVR) ? true : false;