From patchwork Mon Dec 8 20:31:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Larsson X-Patchwork-Id: 5458471 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C87BDBEEA8 for ; Mon, 8 Dec 2014 20:31:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D2A2C20115 for ; Mon, 8 Dec 2014 20:31:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0CEE12015E for ; Mon, 8 Dec 2014 20:31:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754824AbaLHUbM (ORCPT ); Mon, 8 Dec 2014 15:31:12 -0500 Received: from smtp.bredband2.com ([83.219.192.166]:34864 "EHLO smtp.bredband2.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754816AbaLHUbK (ORCPT ); Mon, 8 Dec 2014 15:31:10 -0500 Received: from localhost.localdomain (92-244-23-216.customers.ownit.se [92.244.23.216]) (Authenticated sender: ed8153) by smtp.bredband2.com (Postfix) with ESMTPA id 04EAA105C0D; Mon, 8 Dec 2014 21:31:07 +0100 (CET) From: Benjamin Larsson To: Antti Palosaari Cc: Linux Media Mailing List Subject: [PATCH 2/2] mn88472: implement firmware parity check Date: Mon, 8 Dec 2014 21:31:07 +0100 Message-Id: <1418070667-13349-2-git-send-email-benjamin@southpole.se> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1418070667-13349-1-git-send-email-benjamin@southpole.se> References: <1418070667-13349-1-git-send-email-benjamin@southpole.se> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Benjamin Larsson Reviewed-by: Antti Palosaari --- drivers/staging/media/mn88472/mn88472.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/staging/media/mn88472/mn88472.c b/drivers/staging/media/mn88472/mn88472.c index df7dbe9..1df85a7 100644 --- a/drivers/staging/media/mn88472/mn88472.c +++ b/drivers/staging/media/mn88472/mn88472.c @@ -294,6 +294,7 @@ static int mn88472_init(struct dvb_frontend *fe) int ret, len, remaining; const struct firmware *fw = NULL; u8 *fw_file = MN88472_FIRMWARE; + unsigned int csum; dev_dbg(&client->dev, "\n"); @@ -346,6 +347,20 @@ static int mn88472_init(struct dvb_frontend *fe) } } + /* parity check of firmware */ + ret = regmap_read(dev->regmap[0], 0xf8, &csum); + if (ret) { + dev_err(&client->dev, + "parity reg read failed=%d\n", ret); + goto err; + } + if (csum & 0x10) { + dev_err(&client->dev, + "firmware parity check failed=0x%x\n", csum); + goto err; + } + dev_err(&client->dev, "firmware parity check succeeded=0x%x\n", csum); + ret = regmap_write(dev->regmap[0], 0xf5, 0x00); if (ret) goto err;