Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3C313CA9EC3 for ; Thu, 31 Oct 2019 12:10:07 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A19CC2080F for ; Thu, 31 Oct 2019 12:10:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="u4/sUxsz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A19CC2080F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=realtek.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D01A520D5; Thu, 31 Oct 2019 13:09:14 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D01A520D5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1572523804; bh=RkswG6uL0Qqpp5UXidwXoQ7oDSmsjgxQ4EMoK/0qGeE=; h=From:To:Date:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=u4/sUxszdJ63bQhiOga2zuuu2DxxoL4jKJQBuEO3FjskqkP9yKfblh9zQ5nUPiqJR vMBN8Pwa9r9kaVR16NUgHUMT7fbvkBfHJKaUxsNiuC7MuQ/+F5TopOmBDnqz3kFSgE wG0QFPoSfvEoJHgWwSOtL+w1zMbEGsHNR0x3UpkQ= Received: from vmi242170.contaboserver.net (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 32FEAF80633; Thu, 31 Oct 2019 13:07:23 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8126EF802A0; Thu, 31 Oct 2019 13:04:48 +0100 (CET) Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 6BC2EF803D7 for ; Thu, 31 Oct 2019 12:54:44 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 6BC2EF803D7 Authenticated-By: X-SpamFilter-By: BOX Solutions SpamTrap 5.62 with qID x9VBsf16002000, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (RTITCAS11.realtek.com.tw[172.21.6.12]) by rtits2.realtek.com.tw (8.15.2/2.57/5.78) with ESMTPS id x9VBsf16002000 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 31 Oct 2019 19:54:41 +0800 Received: from localhost.localdomain (172.22.102.1) by RTITCAS11.realtek.com.tw (172.21.6.12) with Microsoft SMTP Server id 14.3.468.0; Thu, 31 Oct 2019 19:54:40 +0800 From: To: , Date: Thu, 31 Oct 2019 19:54:36 +0800 Message-ID: <20191031115436.21055-1-shumingf@realtek.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 X-Originating-IP: [172.22.102.1] Cc: oder_chiou@realtek.com, jack.yu@realtek.com, alsa-devel@alsa-project.org, lars@metafoo.de, tzungbi@google.com, derek.fang@realtek.com, Shuming Fan , flove@realtek.com Subject: [alsa-devel] [PATCH 4/5] ASoC: rt1011: add the range check for temperature_calib from device property X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Shuming Fan The driver will check the range for temperature_calib. It should be from 1 to 255. Signed-off-by: Shuming Fan --- sound/soc/codecs/rt1011.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/rt1011.c b/sound/soc/codecs/rt1011.c index 2f1de933f3ac..f2c581b66d32 100644 --- a/sound/soc/codecs/rt1011.c +++ b/sound/soc/codecs/rt1011.c @@ -2341,7 +2341,8 @@ static void rt1011_calibration_work(struct work_struct *work) rt1011_reg_init(component); /* Apply temperature and calibration data from device property */ - if (rt1011->temperature_calib) { + if (rt1011->temperature_calib <= 0xff && + rt1011->temperature_calib > 0) { snd_soc_component_update_bits(component, RT1011_STP_INITIAL_RESISTANCE_TEMP, 0x3ff, (rt1011->temperature_calib << 2)); -- 2.23.0 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org https://mailman.alsa-project.org/mailman/listinfo/alsa-devel