Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1340194lqm; Thu, 2 May 2024 11:35:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUiHYzWpwwYfCDXFYVqzVHAj2CIirEcI3Rd4j9OE5tLJMz+k8OI4bEeFw+oiSPxZcsQxYfE25QG/4VOOcbXZbebwKFg4fWjueK8ys0UZw== X-Google-Smtp-Source: AGHT+IHBRhQemyP+ZXK04deRzWX3rVxzCeAJZa+QO5fFFDy0to9ofrrc+Oy3Jp4fAd7WCrtuROJM X-Received: by 2002:a17:902:e949:b0:1eb:ed2:f74c with SMTP id b9-20020a170902e94900b001eb0ed2f74cmr674380pll.67.1714674901842; Thu, 02 May 2024 11:35:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714674901; cv=pass; d=google.com; s=arc-20160816; b=HDqSKNixmHLRPSIz/mQLfdCsqg7gVpstsdkME4buIlG+JkcfgEORH0SGZwfb5/GR/z gyjRG9DHWU+1IO+TXbHK625PlKeEteysfkxJp2VGpQzYPXOMFYlJAPYYZ6d80xAvvJYM DFBSIClvzJMiytotfBnsQ9naWOY/oVOmlT5dY2gBi63cv73GIaVD+XKbbK/ZIwfpYiEO E2fJs45sC0W9f++wVRKJP2gFpnG/xM7CEbqq0K1CZe/uf44aeWXGEdypg22YtjkerFYV 3Mvh5uCuzvzS/UWWGpRPT0TFgiqIueikuRRzeGMXvd2lEpAmmNe5JJ0Fed4odaUC1oHF PT/A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=+25HyXOoGfU3yjmqt9OUckjepNjR3C/KJDAxWQF5ZQM=; fh=w3cAlZsi+bu7rwRTMqK5DFz4RntsmzeD+SCFn19kSVI=; b=S+gFnTiOcSm2R2EvwAxaMSZq2fjEX3Fec0XBUJP4a2/J+JO3tUeYsXf4ZUaj9IWfLr rxk6OQUyr2ONrS2KVh84keyfJq5lMoxiCFYvTMDkRYLYAieGNlflU2VIhqb+CXcHQnWv a08h2nyOUsMaG5NA/iWKIX5E9JIoyMK3TdDUvuOFfri8+THCnVoCndKRj7FTYV/D2Khq T/jmfwEKxlu/cF1YbBmY5KORHbiuBhFmJrOmuOMhlaPdCJFupcWxzScK+SeFNWUrin9K 1jkEbhSEEDRpzhOzW+aTXjOnx0TV0xYZLIGDiO4jcAgaOCTHuxUjNblZpN52IEn2ShUe PdGg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@9elements.com header.s=google header.b=CGXQvnFq; arc=pass (i=1 spf=pass spfdomain=9elements.com dkim=pass dkdomain=9elements.com dmarc=pass fromdomain=9elements.com); spf=pass (google.com: domain of linux-kernel+bounces-166839-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166839-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=9elements.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id w13-20020a170902e88d00b001ec5ebb206asi1457447plg.468.2024.05.02.11.35.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 11:35:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-166839-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@9elements.com header.s=google header.b=CGXQvnFq; arc=pass (i=1 spf=pass spfdomain=9elements.com dkim=pass dkdomain=9elements.com dmarc=pass fromdomain=9elements.com); spf=pass (google.com: domain of linux-kernel+bounces-166839-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166839-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=9elements.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 24879286219 for ; Thu, 2 May 2024 18:34:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 87227174EE1; Thu, 2 May 2024 18:34:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=9elements.com header.i=@9elements.com header.b="CGXQvnFq" Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5DE5A174EC6 for ; Thu, 2 May 2024 18:34:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714674882; cv=none; b=l25BTUlCEnvkOjZRlIAO5AW1D2m1hWHRGIqNIZ3zpbFYBONrVbXtSN11Wt9zHYClFvlfLsqTv+4FQADCJA14gFhMsA1KrVRsy4unUrlrJNIh94xpoo1qp2U8UpumOeb7xbxms9BwHwY5W7MFg2FFTTk+RWIcp8949LyznRjeI84= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714674882; c=relaxed/simple; bh=hkUdLfPttpQ9Uizzjig3dHmfdmmvYzwn26n5H3T3jCw=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=mJ3s5BDZmP3Nxr+4jVNT1/THGS10xR+XxmWEwL3LAi7/jrXzUB1oOIPmZQ1KAKtV6Asx+q0mbnSCUiJ23H9Fz4d4+E4RR7UMSwKbmRTc6ZxvPwfEj8VrXoo3nzcF8Yyl7zLisvdhSDu2T0Vh41+Ryb1tNBLTuGKDklymFv3LWrA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=9elements.com; spf=pass smtp.mailfrom=9elements.com; dkim=pass (2048-bit key) header.d=9elements.com header.i=@9elements.com header.b=CGXQvnFq; arc=none smtp.client-ip=209.85.216.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=9elements.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=9elements.com Received: by mail-pj1-f53.google.com with SMTP id 98e67ed59e1d1-2b346712919so1299882a91.2 for ; Thu, 02 May 2024 11:34:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=9elements.com; s=google; t=1714674880; x=1715279680; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=+25HyXOoGfU3yjmqt9OUckjepNjR3C/KJDAxWQF5ZQM=; b=CGXQvnFqZsvP5ZzwsDHTs5ZFXeMn7t0PGgM+nEv7urTzHdMq7FcX+6grEIM5pjPa5a mPJbK6mvkArrCxE372YstWSkK3XmvGAoRdQ7wtnI2Et8sqdnkWcWhTWorweh6rv3rXLp OnDsbBKYD6Nd+R1Trb4zRreMHBnLbVgMqIPUd6WX5yf7QubfrfLLMfDSdscTcoSAZFgC 11x89bt4AqLNhsJOXSsvIKPpwLw1nfmDXxK6t2zK47IJKmtW6dRSv84ySUeR937NUsNW 9JCIQQFxV0HU8h7WjV7DfwrXTfn1VIZwAlme7s0HDC7q37c9Wpsrde4gT5TOuULP9Pdx ecnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714674880; x=1715279680; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+25HyXOoGfU3yjmqt9OUckjepNjR3C/KJDAxWQF5ZQM=; b=YBHT22pRIqBuhG+374Jn2wYdoFych7fBjtrOedzEihdXnO0RT+JOuEglGd+J7uPyDj QGWYbbhYAjAqG6FG06sC7b0kIMD0uH3vrNtgoyR1ly0UTWS5CW1/+sf93hmMLy6Je70L dmsApXWWZHKMbFNJgJxiwpnADEbD3OBwcOjCWCg/x85iHPtqcK8neFP1fy4One4MBW5X EXBuxQ2u3ChZhSIjf0wJ/C2OeK1foysIpP0y5f5u+j8rFw79ys/pnp7Wai0dYZ/Airi/ fzVv9nDy/Y91VwkNGfB+zWY368c/7yul4L8qAg3WklPkGY/1Xe4IUKYcqrmVl4xJRj+I YvzQ== X-Forwarded-Encrypted: i=1; AJvYcCXUFMWaNctBxAETBMyiEyRV+eKLHTXmf2SAk7MARLWsjMwV2dy5eoOmgGazq3ybrDXg965Rqnw5E9hpnydZgqlLVi8GbYGTn1ONVpBz X-Gm-Message-State: AOJu0YzkFBMlPUfxvgEXzeaa9P+2xDM4w3ucl4RalVLWD6rhYWKK9GBV 93P1m29zxuQ6ntiCoSh+nq1f1vKWNh09v6gI31cmczyp5lQB6qzV0Vz0KIJWf8cH+wGyEFd0Y5y hhIHzkXR2h94vOS9OIBsJwlRVmLH+YJnjgTw2Dw== X-Received: by 2002:a17:90b:4388:b0:2a6:9c5f:828e with SMTP id in8-20020a17090b438800b002a69c5f828emr700244pjb.22.1714674880502; Thu, 02 May 2024 11:34:40 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240430210539.935040-1-naresh.solanki@9elements.com> <52e7692c-abaa-4201-8248-3f42bb250335@roeck-us.net> In-Reply-To: From: Naresh Solanki Date: Fri, 3 May 2024 00:04:29 +0530 Message-ID: Subject: Re: [PATCH v2] hwmon (max6639): Use regmap To: Guenter Roeck Cc: Jean Delvare , linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Hi Guenter, On Thu, 2 May 2024 at 23:52, Guenter Roeck wrote: > > On 5/2/24 10:25, Naresh Solanki wrote: > [ ... ] > > >>> + u8 pwm[MAX6639_NDEV]; /* Register value: Duty cycle 0..120 */ > >> > >> pwm caching needs to be dropped as well. It is no longer initialized in > >> max6639_init_client(), but updated and later used in pwm_store() and > >> pwm_show(). Looking at the datasheet, the pwm registers are volatile > >> and should not be cached in the first place. > > Yes. I did that but found that the register is write only. i.e., > > Odd. The datasheet says that it is r/w or, rather, that reading it returns > the _current_ pwm value and writing it sets the target pwm value in pwm mode. > > What happens when the register is read ? Upon revisiting the datasheet and conducting further testing, it appears that my previous response was inaccurate. After testing, it's clear that it reads what is being written & hence it's perfectly fine to remove variable pwm[] from local caching. Verified using below command: ---- i2cset -f -y 130 0x2e 0x26 0x10; i2cget -f -y 130 0x2e 0x26 0x10 ---- Regards, Naresh > > Thanks, > Guenter >