From patchwork Fri Sep 6 15:49:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 826000 Delivered-To: patch@linaro.org Received: by 2002:adf:a345:0:b0:367:895a:4699 with SMTP id d5csp872982wrb; Fri, 6 Sep 2024 08:50:26 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUYILT2HLmx1iLHiLGaidvN2ummSOGaFrLLPsKU3RdKevRRvDvCAvQgZo4HfjLJrYoxp5lasg==@linaro.org X-Google-Smtp-Source: AGHT+IHjn8XdoOqhzrxUQTm33fOXZowuSEyEaaBvIrUczcQTNkwELxj6JQw5YXErhEUf2Jee8YnD X-Received: by 2002:a05:620a:25ce:b0:79f:12fb:ed1 with SMTP id af79cd13be357-7a8041b2bb2mr3194788285a.16.1725637826177; Fri, 06 Sep 2024 08:50:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725637826; cv=none; d=google.com; s=arc-20240605; b=YFWrWHB3jYj+oJ83HLdRBqSj/HdUdd9pjR7koUghp/tobZJoHYRYWnflIzqTPodX3w JkdyWdOG1/wITmHTZ/N+t55s73uI4o/U1WUB5vx2FreP5zZiwz+TlVPS6duW3tEGavx8 Kl4GtmPrL/sXbcXV5Jj+k97WCGYCyZeuocQzan3Z7uRB+gMtRUHw0dAB3gYlvNH+jKDq sEejp+pihzlCINXBDcnxC9JQnZebSAGP/OJ2g+BjaHXyFjQp1vdVBBld3V+AkybBdCiU glpncAuH6fMa+wujc34VGegQfxz0d9G6qOY52F7Zm+zLcCeCejggDhiPNfAatWL4oMeD kSig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vC9WnbFOdrpXQUX3BWmGZJypN5/VBj5S9SdVEOdGWIc=; fh=XHQmldol60HUOyyUh43aTGymNqmcQlnvhYKBBJVPfXY=; b=WMxNliXx2gjWsL4DWMbHIf8QKYmfgB+9O3NXIkQIm+qwcJG0rrSXzTao+bhSbfET9H 9vVZK515yuac2l4tpcDufyB66MGqqMHbDJCNvlfjJB3T71oat+RDuPJByIVevBJ7DvRS aVWk3YUotfzU0kD+zuo9Yy+XowI4ghdqqxRTTY2CDazn2zzJ3RZDVDD5yaTZhp/R15dT bsrkFoIAXoMJR0C3zOh5W/H8MKJ2SLekuOd2TeORkESuyP8Ecst/TfO34XXT+asrIKuu OOSH3MWJNqjxqnixxOCkTJj3ApzUUnfARSoG83FL+YwRWyQsmswQT2pWOWOjFxtq1Q1n pUEA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jDt1OGHn; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7a9a1027519si66945685a.168.2024.09.06.08.50.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Sep 2024 08:50:26 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jDt1OGHn; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1smbDV-0001NL-Lt; Fri, 06 Sep 2024 11:49:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1smbDU-0001GG-3i for qemu-devel@nongnu.org; Fri, 06 Sep 2024 11:49:44 -0400 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1smbDS-0008Bn-Ff for qemu-devel@nongnu.org; Fri, 06 Sep 2024 11:49:43 -0400 Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-5c263118780so2446265a12.2 for ; Fri, 06 Sep 2024 08:49:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725637781; x=1726242581; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vC9WnbFOdrpXQUX3BWmGZJypN5/VBj5S9SdVEOdGWIc=; b=jDt1OGHnD8SKd1floQySmZjpOHrHVcOgvpHtQo1QYPePn/n2/N2yka7aS6wikMBs49 LZO/nVrIfcDj0ECe/qE8ABNAn59Hq5ojtzU+Y7hDc7hLw4i/Jlad9i3ZM7XSr7zDVjNw nzp4EYpsIq+KEU1af8ynZN9HLoklmKy00CyaLoiAWNSgJHRwEsCmVJfuq7MA7Pfqu59g 8M1d1r1oBgnXjROlPSXlq3zhK/1Mtp02Y6Mg8Y/T2hFpipMLueorgSs3DrzaoDLAj8Zw aRSbF0ISEeFtCujRkfcfFWIDgv7opwsjo1sowVVRfogd9kk57+3BrQNpHpYKVMR+1EMX QGCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725637781; x=1726242581; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vC9WnbFOdrpXQUX3BWmGZJypN5/VBj5S9SdVEOdGWIc=; b=ps4YPZYOHo8xd6GHJgmvKHizDxNWRQq6rXMMEOwiTTuLPxIy34EZt8mC6OCvbr9U69 USAylC/ybSvxuouQgrH+caNiBIwCaHOw1iTVcWJJh8jHcXDC/Oev30iD3K5MTGWwxj+T pnEzOAzPW62SlwOpb8IPPCkK69yKfoqUAlwou+L5W4eABCIm5CURcU7QsrE7kTvYRHwA D2AFByHUpBZuyWmzREgt3NzrlegKaV0W5Pmh1bn4LcmIMvbAEC9hhPaRVN5EXn6IC3yQ 8j8zPDc6WhisKb70bK3l6Kp0epjQB/3nIA1b0ImWnQrl+y7drBGLtza025gxw8JnfApQ mdbA== X-Forwarded-Encrypted: i=1; AJvYcCUmpGmg3RD3bNRnzOc92a10GyKJoIWn5jQwUShFK/rEA2tMXGFaYqrg3T93WdXBAx0aGmuzQWtNregV@nongnu.org X-Gm-Message-State: AOJu0Ywwo8/goS2tYKk9/GqSSxzECFP28He8xJZviYUx54Q+Wwe8wS+4 Zzt5siZGI/eWQeF1QcaHXN4GXQeoa+yMz8l+UQl5pXt8UIj7uZSnjZGuuWVxQlY= X-Received: by 2002:a17:907:3689:b0:a86:7d62:4c28 with SMTP id a640c23a62f3a-a8a886667b6mr252359666b.30.1725637780821; Fri, 06 Sep 2024 08:49:40 -0700 (PDT) Received: from localhost.localdomain (225.13.23.93.rev.sfr.net. [93.23.13.225]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8a8e439feesm98449766b.74.2024.09.06.08.49.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 06 Sep 2024 08:49:40 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Guenter Roeck , qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?C?= =?utf-8?q?=C3=A9dric_Le_Goater?= Subject: [PATCH v2 5/5] hw/sensor/tmp105: Lower 4 bit of limit registers are always 0 Date: Fri, 6 Sep 2024 17:49:11 +0200 Message-ID: <20240906154911.86803-6-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240906154911.86803-1-philmd@linaro.org> References: <20240906154911.86803-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::531; envelope-from=philmd@linaro.org; helo=mail-ed1-x531.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Guenter Roeck Per datasheet, "HIGH AND LOW LIMIT REGISTERS", the lower 4 bit of the limit registers are unused and always report 0. The lower 4 bit should not be used for temperature comparisons, so mask the unused bits before storing the limits. Signed-off-by: Guenter Roeck Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Cédric Le Goater --- hw/sensor/tmp105.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/sensor/tmp105.c b/hw/sensor/tmp105.c index f5101af919..9d7b911f59 100644 --- a/hw/sensor/tmp105.c +++ b/hw/sensor/tmp105.c @@ -171,7 +171,7 @@ static void tmp105_write(TMP105State *s) case TMP105_REG_T_HIGH: if (s->len >= 3) { s->limit[s->pointer & 1] = (int16_t) - ((((uint16_t) s->buf[0]) << 8) | s->buf[1]); + ((((uint16_t) s->buf[0]) << 8) | (s->buf[1] & 0xf0)); } tmp105_alarm_update(s, false); break;