* [PATCH 14/17]DVB:Siano drivers - support platform whcih doesn't have request firmware deamon (used in android)
@ 2011-09-20 10:31 Doron Cohen
2011-09-23 22:46 ` Mauro Carvalho Chehab
0 siblings, 1 reply; 2+ messages in thread
From: Doron Cohen @ 2011-09-20 10:31 UTC (permalink / raw)
To: linux-media
Hi,
This patch step support platform whcih doesn't have request firmware
deamon (used in android).
Thanks,
Doron Cohen
-----------------------
>From 3e0060fc7cfdbd5844e9a644b6d2927a406cde20 Mon Sep 17 00:00:00 2001
From: Doron Cohen <doronc@siano-ms.com>
Date: Tue, 20 Sep 2011 08:37:43 +0300
Subject: [PATCH 18/21] Support platform which doesn't have
request_firmware deamon. Allow loading firmware from application without
using request_firmware API
---
drivers/media/dvb/siano/smscoreapi.c | 77
++++++++++++++++++++++++++++++++-
1 files changed, 74 insertions(+), 3 deletions(-)
diff --git a/drivers/media/dvb/siano/smscoreapi.c
b/drivers/media/dvb/siano/smscoreapi.c
index 459c6e9..bb92351 100644
--- a/drivers/media/dvb/siano/smscoreapi.c
+++ b/drivers/media/dvb/siano/smscoreapi.c
@@ -507,12 +507,83 @@ static int smscore_init_ir(struct smscore_device_t
*coredev)
*/
int smscore_start_device(struct smscore_device_t *coredev)
{
- int rc = smscore_set_device_mode(
- coredev, smscore_registry_getmode(coredev->devpath));
+ int rc = 0;
+ int board_id = smscore_get_board_id(coredev);
+
+#ifdef REQUEST_FIRMWARE_SUPPORTED
+ int mode;
+ int type = sms_get_board(board_id)->type;
+ if (type == SMS_UNKNOWN_TYPE)
+ type = smscore_registry_gettype(coredev->devpath);
+ sms_info ("starting device type %d", type);
+ /*
+ * first, search operation mode in the registry, with
+ * the limitation of type-mode compatability.
+ * if firmware donload fails, get operation mode from
+ * sms_boards
+ * for spi, type = SMS_UNKNOWN_TYPE and board_id = SMS_BOARD_UNKNOWN
+ * so always default_mode is set
+ */
+ switch (type) {
+ case SMS_UNKNOWN_TYPE:
+ mode = default_mode;
+ break;
+ case SMS_STELLAR:
+ case SMS_NOVA_A0:
+ case SMS_NOVA_B0:
+ case SMS_PELE:
+ case SMS_RIO:
+ mode = smscore_registry_getmode(coredev->devpath);
+ sms_info ("mode for path %s in registry %d", coredev->devpath,
mode);
+ if (mode == SMSHOSTLIB_DEVMD_CMMB)
+ mode = (default_mode == SMSHOSTLIB_DEVMD_CMMB) ?
SMSHOSTLIB_DEVMD_NONE : default_mode;
+ break;
+ case SMS_DENVER_1530:
+ mode = SMSHOSTLIB_DEVMD_ATSC;
+ break;
+ case SMS_DENVER_2160:
+ mode = SMSHOSTLIB_DEVMD_DAB_TDMB;
+ break;
+ case SMS_VEGA:
+ case SMS_VENICE:
+ case SMS_MING:
+ mode = SMSHOSTLIB_DEVMD_CMMB;
+ break;
+ default:
+ mode = SMSHOSTLIB_DEVMD_NONE;
+ }
+
+ /* first try */
+ sms_info ("mode after adjustment %d", mode);
+ rc = smscore_set_device_mode(coredev, mode);
+
+ if (rc < 0) {
+ sms_info("set device mode to %d failed", mode);
+
+ /*
+ * don't try again on spi mode, or if the mode from
+ * sms_boards is identical to the previous mode
+ */
+ if ((board_id == SMS_BOARD_UNKNOWN) ||
+ (mode == sms_get_board(board_id)->default_mode))
+ return -ENOEXEC;
+
+ /* second try */
+ mode = sms_get_board(board_id)->default_mode;
+ rc = smscore_set_device_mode(coredev, mode);
+ if (rc < 0) {
+ sms_info("set device mode to %d failed", mode);
+ return -ENOEXEC ;
+ }
+ }
+ sms_info("set device mode succeeded");
+
+ rc = smscore_configure_board(coredev);
if (rc < 0) {
sms_info("configure board failed , rc %d", rc);
return rc;
}
+#endif
kmutex_lock(&g_smscore_deviceslock);
@@ -1614,7 +1685,7 @@ void smscore_unregister_client(struct
smscore_client_t *client)
kfree(identry);
}
- sms_info("%p", client->context);
+ sms_info("unregister client 0x%p", client->context);
list_del(&client->entry);
kfree(client);
--
1.7.4.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 14/17]DVB:Siano drivers - support platform whcih doesn't have request firmware deamon (used in android)
2011-09-20 10:31 [PATCH 14/17]DVB:Siano drivers - support platform whcih doesn't have request firmware deamon (used in android) Doron Cohen
@ 2011-09-23 22:46 ` Mauro Carvalho Chehab
0 siblings, 0 replies; 2+ messages in thread
From: Mauro Carvalho Chehab @ 2011-09-23 22:46 UTC (permalink / raw)
To: doronc; +Cc: linux-media
Em 20-09-2011 07:31, Doron Cohen escreveu:
> Hi,
> This patch step support platform whcih doesn't have request firmware
> deamon (used in android).
> Thanks,
> Doron Cohen
>
> -----------------------
>>From 3e0060fc7cfdbd5844e9a644b6d2927a406cde20 Mon Sep 17 00:00:00 2001
> From: Doron Cohen <doronc@siano-ms.com>
> Date: Tue, 20 Sep 2011 08:37:43 +0300
> Subject: [PATCH 18/21] Support platform which doesn't have
> request_firmware deamon. Allow loading firmware from application without
> using request_firmware API
NACK.
>
> ---
> drivers/media/dvb/siano/smscoreapi.c | 77
> ++++++++++++++++++++++++++++++++-
> 1 files changed, 74 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/media/dvb/siano/smscoreapi.c
> b/drivers/media/dvb/siano/smscoreapi.c
> index 459c6e9..bb92351 100644
> --- a/drivers/media/dvb/siano/smscoreapi.c
> +++ b/drivers/media/dvb/siano/smscoreapi.c
> @@ -507,12 +507,83 @@ static int smscore_init_ir(struct smscore_device_t
> *coredev)
> */
> int smscore_start_device(struct smscore_device_t *coredev)
> {
> - int rc = smscore_set_device_mode(
> - coredev, smscore_registry_getmode(coredev->devpath));
> + int rc = 0;
> + int board_id = smscore_get_board_id(coredev);
> +
> +#ifdef REQUEST_FIRMWARE_SUPPORTED
> + int mode;
> + int type = sms_get_board(board_id)->type;
> + if (type == SMS_UNKNOWN_TYPE)
> + type = smscore_registry_gettype(coredev->devpath);
> + sms_info ("starting device type %d", type);
> + /*
> + * first, search operation mode in the registry, with
> + * the limitation of type-mode compatability.
> + * if firmware donload fails, get operation mode from
> + * sms_boards
> + * for spi, type = SMS_UNKNOWN_TYPE and board_id = SMS_BOARD_UNKNOWN
> + * so always default_mode is set
> + */
> + switch (type) {
> + case SMS_UNKNOWN_TYPE:
> + mode = default_mode;
> + break;
> + case SMS_STELLAR:
> + case SMS_NOVA_A0:
> + case SMS_NOVA_B0:
> + case SMS_PELE:
> + case SMS_RIO:
> + mode = smscore_registry_getmode(coredev->devpath);
> + sms_info ("mode for path %s in registry %d", coredev->devpath,
> mode);
> + if (mode == SMSHOSTLIB_DEVMD_CMMB)
> + mode = (default_mode == SMSHOSTLIB_DEVMD_CMMB) ?
> SMSHOSTLIB_DEVMD_NONE : default_mode;
> + break;
> + case SMS_DENVER_1530:
> + mode = SMSHOSTLIB_DEVMD_ATSC;
> + break;
> + case SMS_DENVER_2160:
> + mode = SMSHOSTLIB_DEVMD_DAB_TDMB;
> + break;
> + case SMS_VEGA:
> + case SMS_VENICE:
> + case SMS_MING:
> + mode = SMSHOSTLIB_DEVMD_CMMB;
> + break;
> + default:
> + mode = SMSHOSTLIB_DEVMD_NONE;
> + }
> +
> + /* first try */
> + sms_info ("mode after adjustment %d", mode);
> + rc = smscore_set_device_mode(coredev, mode);
> +
> + if (rc < 0) {
> + sms_info("set device mode to %d failed", mode);
> +
> + /*
> + * don't try again on spi mode, or if the mode from
> + * sms_boards is identical to the previous mode
> + */
> + if ((board_id == SMS_BOARD_UNKNOWN) ||
> + (mode == sms_get_board(board_id)->default_mode))
> + return -ENOEXEC;
> +
> + /* second try */
> + mode = sms_get_board(board_id)->default_mode;
> + rc = smscore_set_device_mode(coredev, mode);
> + if (rc < 0) {
> + sms_info("set device mode to %d failed", mode);
> + return -ENOEXEC ;
> + }
> + }
> + sms_info("set device mode succeeded");
> +
> + rc = smscore_configure_board(coredev);
> if (rc < 0) {
> sms_info("configure board failed , rc %d", rc);
> return rc;
> }
> +#endif
>
> kmutex_lock(&g_smscore_deviceslock);
>
> @@ -1614,7 +1685,7 @@ void smscore_unregister_client(struct
> smscore_client_t *client)
> kfree(identry);
> }
>
> - sms_info("%p", client->context);
> + sms_info("unregister client 0x%p", client->context);
>
> list_del(&client->entry);
> kfree(client);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-09-23 22:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-20 10:31 [PATCH 14/17]DVB:Siano drivers - support platform whcih doesn't have request firmware deamon (used in android) Doron Cohen
2011-09-23 22:46 ` Mauro Carvalho Chehab
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).