summaryrefslogtreecommitdiffstats
path: root/drivers/media/common
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2013-03-08 20:48:42 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-03-21 07:45:25 -0300
commitdfbf021c9e6c9de2296eae7b4e89148e7f68b28e (patch)
tree6d8f90296bb03493995a02bf4e0fffe69c2103ee /drivers/media/common
parent347d8f1fa69f4dd021f1ca3d69e1527d95f185e0 (diff)
downloadblackbird-obmc-linux-dfbf021c9e6c9de2296eae7b4e89148e7f68b28e.tar.gz
blackbird-obmc-linux-dfbf021c9e6c9de2296eae7b4e89148e7f68b28e.zip
[media] siano: Configure board's mtu and xtal
Backported from Doron Cohen's patch: http://patchwork.linuxtv.org/patch/7889/ Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/common')
-rw-r--r--drivers/media/common/siano/smscoreapi.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/drivers/media/common/siano/smscoreapi.c b/drivers/media/common/siano/smscoreapi.c
index 67d0319dc013..6b53367f74dc 100644
--- a/drivers/media/common/siano/smscoreapi.c
+++ b/drivers/media/common/siano/smscoreapi.c
@@ -825,6 +825,57 @@ static int smscore_init_ir(struct smscore_device_t *coredev)
}
/**
+ * configures device features according to board configuration structure.
+ *
+ * @param coredev pointer to a coredev object returned by
+ * smscore_register_device
+ *
+ * @return 0 on success, <0 on error.
+ */
+int smscore_configure_board(struct smscore_device_t *coredev)
+{
+ struct sms_board *board;
+
+ board = sms_get_board(coredev->board_id);
+ if (!board) {
+ sms_err("no board configuration exist.");
+ return -EINVAL;
+ }
+
+ if (board->mtu) {
+ struct SmsMsgData_ST MtuMsg;
+ sms_debug("set max transmit unit %d", board->mtu);
+
+ MtuMsg.xMsgHeader.msgSrcId = 0;
+ MtuMsg.xMsgHeader.msgDstId = HIF_TASK;
+ MtuMsg.xMsgHeader.msgFlags = 0;
+ MtuMsg.xMsgHeader.msgType = MSG_SMS_SET_MAX_TX_MSG_LEN_REQ;
+ MtuMsg.xMsgHeader.msgLength = sizeof(MtuMsg);
+ MtuMsg.msgData[0] = board->mtu;
+
+ smsendian_handle_tx_message((struct SmsMsgHdr_ST *)&MtuMsg);
+ coredev->sendrequest_handler(coredev->context, &MtuMsg,
+ sizeof(MtuMsg));
+ }
+
+ if (board->crystal) {
+ struct SmsMsgData_ST CrysMsg;
+ sms_debug("set crystal value %d", board->crystal);
+
+ SMS_INIT_MSG(&CrysMsg.xMsgHeader,
+ MSG_SMS_NEW_CRYSTAL_REQ,
+ sizeof(CrysMsg));
+ CrysMsg.msgData[0] = board->crystal;
+
+ smsendian_handle_tx_message((struct SmsMsgHdr_S *)&CrysMsg);
+ coredev->sendrequest_handler(coredev->context, &CrysMsg,
+ sizeof(CrysMsg));
+ }
+
+ return 0;
+}
+
+/**
* sets initial device mode and notifies client hotplugs that device is ready
*
* @param coredev pointer to a coredev object returned by
@@ -840,6 +891,11 @@ int smscore_start_device(struct smscore_device_t *coredev)
sms_info("set device mode faile , rc %d", rc);
return rc;
}
+ rc = smscore_configure_board(coredev);
+ if (rc < 0) {
+ sms_info("configure board failed , rc %d", rc);
+ return rc;
+ }
kmutex_lock(&g_smscore_deviceslock);
OpenPOWER on IntegriCloud