From patchwork Sun Apr 5 10:18:01 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uri Shkolnik X-Patchwork-Id: 16411 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 n35AIDdm024317 for ; Sun, 5 Apr 2009 10:18:13 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757054AbZDEKSH (ORCPT ); Sun, 5 Apr 2009 06:18:07 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757235AbZDEKSG (ORCPT ); Sun, 5 Apr 2009 06:18:06 -0400 Received: from web110807.mail.gq1.yahoo.com ([67.195.13.230]:31169 "HELO web110807.mail.gq1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1757054AbZDEKSF (ORCPT ); Sun, 5 Apr 2009 06:18:05 -0400 Received: (qmail 7974 invoked by uid 60001); 5 Apr 2009 10:18:01 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1238926681; bh=/xijm7B+F+liC53aCOFW1jbv4lBZQaGl7rOMGIoZN6Q=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=0W4Xtkx6CwnU0Dnd/D/cKj7gOK1j3UtgKSZWzpv74RiKNApZ/M+tR9zX23NrAN7w8sqdVZM4imXhUMjj9PSw5wTtwOB0pitJfcp/YopqRZrIw5N1gf92Kk7uv5hgddoNJNTL7QI2SQT92XH5ZVDLnaWeJ04xdMvLQ0KiJx2pc/I= 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=oQ6AK5sX2dVIp07M5/BXX6YvmdDZq+oEJjQ1aqLpuntJq1wKvBrZGmaifoWs89OZIboTQxAP9Wbdgv+oerdBONpi7XNkIXA4WS+5Z0Pfj19At3XoVgK/IVzybnOKlIpkC9NWcHRzehJXyjOjL/8Y/0LOvr3zcJnLFIc6QKYixHk=; Message-ID: <827426.7180.qm@web110807.mail.gq1.yahoo.com> X-YMail-OSG: zBGLrQ0VM1mJkRtVKcR809XYlszc9wbswUvzVLK.1PD5Jdzr.gvLnolkcwkIDHIVtrnGMVzHk0ta52Ogp0YGjFuvSKdDQV71DLJCWwc.m3kNfCh_JtnT3h5o5DVCG4IPtobid2MHGfHCR4m0HeQLobz9L1zVb3QP3JGmUaDN9gb9edNH5V9sksnHhE72bK64VcNfrQBSPw6OJ0K94v0jT0MWuHVZN5Krk01awEywNJH.VxofXIQAiqk1BCNm5XLjL.aSjHfCexTm1NqE6NriBIR449hNV8vkXKl9r_SgeSErLPh4igTUiW_16sOUdPjcbE3PEwXsVQmeqmSivCOD4BD5WndQIY24.CG.VPqr Received: from [199.203.99.233] by web110807.mail.gq1.yahoo.com via HTTP; Sun, 05 Apr 2009 03:18:01 PDT X-Mailer: YahooMailClassic/5.2.15 YahooMailWebService/0.7.289.1 Date: Sun, 5 Apr 2009 03:18:01 -0700 (PDT) From: Uri Shkolnik Subject: [PATCH] [0904_10] Siano: smsdvb - add events mechanism 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 1238742622 -10800 # Node ID ec7ee486fb86d51bdb48e6a637a6ddd52e9e08c2 # Parent 020ba7b31c963bd36d607848198e9e4258a6f80e [PATCH] [0904_10] Siano: smsdvb - add events mechanism From: Uri Shkolnik Add events mechanism that will notify the "cards" component (which represent the specific hardware target) for DVB related events. 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 020ba7b31c96 -r ec7ee486fb86 linux/drivers/media/dvb/siano/smsdvb.c --- a/linux/drivers/media/dvb/siano/smsdvb.c Thu Apr 02 21:33:14 2009 +0300 +++ b/linux/drivers/media/dvb/siano/smsdvb.c Fri Apr 03 10:10:22 2009 +0300 @@ -66,6 +66,45 @@ static int sms_dbg; static int sms_dbg; module_param_named(debug, sms_dbg, int, 0644); MODULE_PARM_DESC(debug, "set debug level (info=1, adv=2 (or-able))"); + +/* Events that may come from DVB v3 adapter */ +static void sms_board_dvb3_event(struct smscore_device_t *coredev, + enum SMS_DVB3_EVENTS event) { + switch (event) { + case DVB3_EVENT_INIT: + sms_debug("DVB3_EVENT_INIT"); + /* sms_board_event(coredev, BOARD_EVENT_BIND); */ + break; + case DVB3_EVENT_SLEEP: + sms_debug("DVB3_EVENT_SLEEP"); + /* sms_board_event(coredev, BOARD_EVENT_POWER_SUSPEND); */ + break; + case DVB3_EVENT_HOTPLUG: + sms_debug("DVB3_EVENT_HOTPLUG"); + /* sms_board_event(coredev, BOARD_EVENT_POWER_INIT); */ + break; + case DVB3_EVENT_FE_LOCK: + sms_debug("DVB3_EVENT_FE_LOCK"); + /* sms_board_event(coredev, BOARD_EVENT_FE_LOCK); */ + break; + case DVB3_EVENT_FE_UNLOCK: + sms_debug("DVB3_EVENT_FE_UNLOCK"); + /* sms_board_event(coredev, BOARD_EVENT_FE_UNLOCK); */ + break; + case DVB3_EVENT_UNC_OK: + sms_debug("DVB3_EVENT_UNC_OK"); + /* sms_board_event(coredev, BOARD_EVENT_MULTIPLEX_OK); */ + break; + case DVB3_EVENT_UNC_ERR: + sms_debug("DVB3_EVENT_UNC_ERR"); + /* sms_board_event(coredev, BOARD_EVENT_MULTIPLEX_ERRORS); */ + break; + + default: + sms_err("Unknown dvb3 api event"); + break; + } +} static int smsdvb_onresponse(void *context, struct smscore_buffer_t *cb) { @@ -174,17 +213,15 @@ static int smsdvb_onresponse(void *conte client->fe_status = 0; } - /* - if (client->fe_status & FE_HAS_LOCK) - sms_board_dvb3_event(client->coredev, DVB3_EVENT_FE_LOCK); - else - sms_board_dvb3_event(client->coredev, DVB3_EVENT_FE_UNLOCK); + if (client->fe_status & FE_HAS_LOCK) + sms_board_dvb3_event(client->coredev, DVB3_EVENT_FE_LOCK); + else + sms_board_dvb3_event(client->coredev, DVB3_EVENT_FE_UNLOCK); - if (client->sms_stat_dvb.ReceptionData.ErrorTSPackets == 0) - sms_board_dvb3_event(client->coredev, DVB3_EVENT_UNC_OK); - else - sms_board_dvb3_event(client->coredev, DVB3_EVENT_UNC_ERR); - */ + if (client->sms_stat_dvb.ReceptionData.ErrorTSPackets == 0) + sms_board_dvb3_event(client->coredev, DVB3_EVENT_UNC_OK); + else + sms_board_dvb3_event(client->coredev, DVB3_EVENT_UNC_ERR); if (client->fe_status & FE_HAS_LOCK) sms_board_led_feedback(client->coredev, @@ -346,13 +383,12 @@ static int smsdvb_set_frontend(struct dv struct dvb_frontend_parameters *fep) { struct smsdvb_client_t *client = - container_of(fe, struct smsdvb_client_t, frontend); + container_of(fe, struct smsdvb_client_t, frontend); struct { struct SmsMsgHdr_ST Msg; u32 Data[3]; } Msg; - int ret; Msg.Msg.msgSrcId = DVBT_BDA_CONTROL_MSG_ID; Msg.Msg.msgDstId = HIF_TASK; @@ -387,7 +423,8 @@ static int smsdvb_set_frontend(struct dv } /* Disable LNA, if any. An error is returned if no LNA is present */ - ret = sms_board_lna_control(client->coredev, 0); + { + int ret = sms_board_lna_control(client->coredev, 0); if (ret == 0) { fe_status_t status; @@ -403,7 +440,7 @@ static int smsdvb_set_frontend(struct dv /* previous tune didnt lock - enable LNA and tune again */ sms_board_lna_control(client->coredev, 1); } - + } return smsdvb_sendrequest_and_wait(client, &Msg, sizeof(Msg), &client->tune_done); } @@ -428,6 +465,7 @@ static int smsdvb_init(struct dvb_fronte struct smsdvb_client_t *client = container_of(fe, struct smsdvb_client_t, frontend); + sms_board_dvb3_event(client->coredev, DVB3_EVENT_INIT); sms_board_power(client->coredev, 1); return 0; @@ -438,6 +476,7 @@ static int smsdvb_sleep(struct dvb_front struct smsdvb_client_t *client = container_of(fe, struct smsdvb_client_t, frontend); + sms_board_dvb3_event(client->coredev, DVB3_EVENT_SLEEP); sms_board_led_feedback(client->coredev, SMS_LED_OFF); sms_board_power(client->coredev, 0); @@ -572,6 +611,7 @@ static int smsdvb_hotplug(struct smscore sms_info("success"); + sms_board_dvb3_event(coredev, DVB3_EVENT_HOTPLUG); sms_board_setup(coredev); return 0; @@ -614,8 +654,8 @@ void smsdvb_module_exit(void) kmutex_lock(&g_smsdvb_clientslock); while (!list_empty(&g_smsdvb_clients)) - smsdvb_unregister_client( - (struct smsdvb_client_t *) g_smsdvb_clients.next); + smsdvb_unregister_client((struct smsdvb_client_t *) + g_smsdvb_clients.next); kmutex_unlock(&g_smsdvb_clientslock); }