From patchwork Tue May 19 16:46:07 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uri Shkolnik X-Patchwork-Id: 24761 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n4JGkBpX009233 for ; Tue, 19 May 2009 16:46:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753060AbZESQqH (ORCPT ); Tue, 19 May 2009 12:46:07 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753289AbZESQqH (ORCPT ); Tue, 19 May 2009 12:46:07 -0400 Received: from web110802.mail.gq1.yahoo.com ([67.195.13.225]:33350 "HELO web110802.mail.gq1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1753060AbZESQqG (ORCPT ); Tue, 19 May 2009 12:46:06 -0400 Received: (qmail 71182 invoked by uid 60001); 19 May 2009 16:46:07 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1242751567; bh=p4CXCaQ1Y6tWoE1IA0XiOlXixsi3XpaiblMfI8LEGIo=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=GxwkH7nppKEXsyj53DMfesw4UIZhFKrB5xcwkcGzz/YJEWJ6HBOixxCqZhv6wQCdabszVS9EaktLdwcHGkeAx6K17MkeZ8mtxXtDWN9abE3iwH0EeL9A8rENJGE7VkZ9JGLfdowgjzKtE62vJswG3Wbat12tdlSvleqKEY0EWuU= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=agwtw5eZIw1lFxqfsOLaaupD6aZVRrmFK9Irj7moYDNZmFwt1BJG+ifQOQ06YHY8fi+EGif8okmnl1u7yAH73xoVxZTl1dOsYPptDkynKRkpKoM2j94gKnU0C6edN3ZhTi5j5pMHdVateVd9JczOpzEuATCG3tkaMY2K0/0NAkA=; Message-ID: <281711.70090.qm@web110802.mail.gq1.yahoo.com> X-YMail-OSG: u1eYz24VM1kQ.KnJztflaRFHw6hInZ8uQZAfcUk3bgzzj4kSJUle3hP5q8UpdI5wN0BUaYQsz3yHJ7k0duV2a8Qb2gsWkMRYhmus7dqi1s6vitK3ELvgK_B7nQevHbKDY8.b7OOI6FRmxZR8y0TwA7FtS7.rstEzZslzfDXiCSvBsNlWCBztT_4ur3LEAQM.JKkAGYsGwdR3G8T20wp1XB2TduxVnvpzJtjvdiQ_1uKmBFdXq.ifLWf7gYISAf92dpOxq.6CCgAX8rNvN9_n75GRG1vuoR4XHvs6lqwrD_MMGRHptAqHhT3T0Hr48CoBu19Vo8SVnPkjpi6v4SqnkXlz8.NHdMbc2XeEH9b0JLL9FTeeieXWQ1Iy_w-- Received: from [199.203.99.233] by web110802.mail.gq1.yahoo.com via HTTP; Tue, 19 May 2009 09:46:07 PDT X-Mailer: YahooMailClassic/5.3.9 YahooMailWebService/0.7.289.10 Date: Tue, 19 May 2009 09:46:07 -0700 (PDT) From: Uri Shkolnik Subject: [PATCH] [09051_57] Siano: smscards - remove redundant code To: LinuxML MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org # HG changeset patch # User Uri Shkolnik # Date 1242751824 -10800 # Node ID fd16bcd8b9f1fffe0b605ca5b3b2138fc920e927 # Parent f78cbc153c82ebe58a1bbe82271b91f5a4a90642 [09051_57] Siano: smscards - remove redundant code From: Uri Shkolnik Remove code that has been duplicate with the new boards events manager Priority: normal Signed-off-by: Uri Shkolnik --- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff -r f78cbc153c82 -r fd16bcd8b9f1 linux/drivers/media/dvb/siano/sms-cards.c --- a/linux/drivers/media/dvb/siano/sms-cards.c Tue May 19 19:45:05 2009 +0300 +++ b/linux/drivers/media/dvb/siano/sms-cards.c Tue May 19 19:50:24 2009 +0300 @@ -281,98 +281,3 @@ int sms_board_event(struct smscore_devic return 0; } EXPORT_SYMBOL_GPL(sms_board_event); - -static int sms_set_gpio(struct smscore_device_t *coredev, int pin, int enable) -{ - int lvl, ret; - u32 gpio; - struct smscore_config_gpio gpioconfig = { - .direction = SMS_GPIO_DIRECTION_OUTPUT, - .pullupdown = SMS_GPIO_PULLUPDOWN_NONE, - .inputcharacteristics = SMS_GPIO_INPUTCHARACTERISTICS_NORMAL, - .outputslewrate = SMS_GPIO_OUTPUTSLEWRATE_FAST, - .outputdriving = SMS_GPIO_OUTPUTDRIVING_4mA, - }; - - if (pin == 0) - return -EINVAL; - - if (pin < 0) { - /* inverted gpio */ - gpio = pin * -1; - lvl = enable ? 0 : 1; - } else { - gpio = pin; - lvl = enable ? 1 : 0; - } - - ret = smscore_configure_gpio(coredev, gpio, &gpioconfig); - if (ret < 0) - return ret; - - return smscore_set_gpio(coredev, gpio, lvl); -} - -int sms_board_power(struct smscore_device_t *coredev, int onoff) -{ - int board_id = smscore_get_board_id(coredev); - struct sms_board *board = sms_get_board(board_id); - - switch (board_id) { - case SMS1XXX_BOARD_HAUPPAUGE_WINDHAM: - /* power LED */ - sms_set_gpio(coredev, - board->led_power, onoff ? 1 : 0); - break; - case SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD_R2: - case SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD: - /* LNA */ - if (!onoff) - sms_set_gpio(coredev, board->lna_ctrl, 0); - break; - } - return 0; -} -EXPORT_SYMBOL_GPL(sms_board_power); - -int sms_board_led_feedback(struct smscore_device_t *coredev, int led) -{ - int board_id = smscore_get_board_id(coredev); - struct sms_board *board = sms_get_board(board_id); - - /* dont touch GPIO if LEDs are already set */ - if (smscore_led_state(coredev, -1) == led) - return 0; - - switch (board_id) { - case SMS1XXX_BOARD_HAUPPAUGE_WINDHAM: - sms_set_gpio(coredev, - board->led_lo, (led & SMS_LED_LO) ? 1 : 0); - sms_set_gpio(coredev, - board->led_hi, (led & SMS_LED_HI) ? 1 : 0); - - smscore_led_state(coredev, led); - break; - } - return 0; -} -EXPORT_SYMBOL_GPL(sms_board_led_feedback); - -int sms_board_lna_control(struct smscore_device_t *coredev, int onoff) -{ - int board_id = smscore_get_board_id(coredev); - struct sms_board *board = sms_get_board(board_id); - - sms_debug("%s: LNA %s", __func__, onoff ? "enabled" : "disabled"); - - switch (board_id) { - case SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD_R2: - case SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD: - sms_set_gpio(coredev, - board->rf_switch, onoff ? 1 : 0); - return sms_set_gpio(coredev, - board->lna_ctrl, onoff ? 1 : 0); - } - return -EINVAL; -} -EXPORT_SYMBOL_GPL(sms_board_lna_control); diff -r f78cbc153c82 -r fd16bcd8b9f1 linux/drivers/media/dvb/siano/sms-cards.h --- a/linux/drivers/media/dvb/siano/sms-cards.h Tue May 19 19:45:05 2009 +0300 +++ b/linux/drivers/media/dvb/siano/sms-cards.h Tue May 19 19:50:24 2009 +0300 @@ -110,11 +110,4 @@ int sms_board_event(struct smscore_devic int sms_board_event(struct smscore_device_t *coredev, enum SMS_BOARD_EVENTS gevent); -#define SMS_LED_OFF 0 -#define SMS_LED_LO 1 -#define SMS_LED_HI 2 -int sms_board_led_feedback(struct smscore_device_t *coredev, int led); -int sms_board_power(struct smscore_device_t *coredev, int onoff); -int sms_board_lna_control(struct smscore_device_t *coredev, int onoff); - #endif /* __SMS_CARDS_H__ */