From patchwork Tue Jan 10 17:11:24 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 9428 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1RkfQA-0001LI-FR for patchwork@linuxtv.org; Tue, 10 Jan 2012 18:23:38 +0100 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-3) with esmtp for id 1RkfQA-0007Zy-Cy; Tue, 10 Jan 2012 18:23:38 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932625Ab2AJRWy (ORCPT ); Tue, 10 Jan 2012 12:22:54 -0500 Received: from mail.pripojeni.net ([178.22.112.14]:36065 "EHLO smtp.pripojeni.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932080Ab2AJRWx (ORCPT ); Tue, 10 Jan 2012 12:22:53 -0500 Received: from anemoi.localdomain ([178.22.113.142]) by smtp.pripojeni.net (Kerio Connect 7.2.2); Tue, 10 Jan 2012 18:11:26 +0100 From: Jiri Slaby To: mchehab@infradead.org Cc: mikekrufky@gmail.com, linux-media@vger.kernel.org, jirislaby@gmail.com, linux-kernel@vger.kernel.org, Jiri Slaby Subject: [PATCH 3/4] DVB: dib0700, add corrected Nova-TD frontend_attach Date: Tue, 10 Jan 2012 18:11:24 +0100 Message-Id: <1326215485-20846-3-git-send-email-jslaby@suse.cz> X-Mailer: git-send-email 1.7.8 In-Reply-To: <1326215485-20846-1-git-send-email-jslaby@suse.cz> References: <1326215485-20846-1-git-send-email-jslaby@suse.cz> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.1.10.171214 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_2000_2999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, __ANY_URI 0, __CP_URI_IN_BODY 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS ' This means cut & paste from the former f. attach. But while at it write to the right GPIO to turn on the right LED. Also turn the other two off jsut for sure. Signed-off-by: Jiri Slaby --- drivers/media/dvb/dvb-usb/dib0700_devices.c | 36 +++++++++++++++++++++++++- 1 files changed, 34 insertions(+), 2 deletions(-) diff --git a/drivers/media/dvb/dvb-usb/dib0700_devices.c b/drivers/media/dvb/dvb-usb/dib0700_devices.c index e5c2bd2..3ab45ae 100644 --- a/drivers/media/dvb/dvb-usb/dib0700_devices.c +++ b/drivers/media/dvb/dvb-usb/dib0700_devices.c @@ -3105,6 +3105,38 @@ static int stk7070pd_frontend_attach1(struct dvb_usb_adapter *adap) return adap->fe_adap[0].fe == NULL ? -ENODEV : 0; } +/** + * novatd_frontend_attach - Nova-TD specific attach + * + * Nova-TD has GPIO0, 1 and 2 for LEDs. So do not fiddle with them except for + * information purposes. + */ +static int novatd_frontend_attach(struct dvb_usb_adapter *adap) +{ + struct dvb_usb_device *dev = adap->dev; + + if (adap->id == 0) { + stk7070pd_init(dev); + + /* turn the power LED on, the other two off (just in case) */ + dib0700_set_gpio(dev, GPIO0, GPIO_OUT, 0); + dib0700_set_gpio(dev, GPIO1, GPIO_OUT, 0); + dib0700_set_gpio(dev, GPIO2, GPIO_OUT, 1); + + if (dib7000p_i2c_enumeration(&dev->i2c_adap, 2, 18, + stk7070pd_dib7000p_config) != 0) { + err("%s: dib7000p_i2c_enumeration failed. Cannot continue\n", + __func__); + return -ENODEV; + } + } + + adap->fe_adap[0].fe = dvb_attach(dib7000p_attach, &dev->i2c_adap, + adap->id == 0 ? 0x80 : 0x82, + &stk7070pd_dib7000p_config[adap->id]); + return adap->fe_adap[0].fe == NULL ? -ENODEV : 0; +} + /* S5H1411 */ static struct s5h1411_config pinnacle_801e_config = { .output_mode = S5H1411_PARALLEL_OUTPUT, @@ -3876,7 +3908,7 @@ struct dvb_usb_device_properties dib0700_devices[] = { .pid_filter_count = 32, .pid_filter = stk70x0p_pid_filter, .pid_filter_ctrl = stk70x0p_pid_filter_ctrl, - .frontend_attach = stk7070pd_frontend_attach0, + .frontend_attach = novatd_frontend_attach, .tuner_attach = dib7070p_tuner_attach, DIB0700_DEFAULT_STREAMING_CONFIG(0x02), @@ -3889,7 +3921,7 @@ struct dvb_usb_device_properties dib0700_devices[] = { .pid_filter_count = 32, .pid_filter = stk70x0p_pid_filter, .pid_filter_ctrl = stk70x0p_pid_filter_ctrl, - .frontend_attach = stk7070pd_frontend_attach1, + .frontend_attach = novatd_frontend_attach, .tuner_attach = dib7070p_tuner_attach, DIB0700_DEFAULT_STREAMING_CONFIG(0x03),