Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1333965lqm; Thu, 2 May 2024 11:22:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX08xfeBRltbf9Ps00j5d4LuYBc6EU6zq9D4Ym21oLIsLIBc6BqgJg0H/qzscAElANjecCVHcaM2huwursfSDjHcVWJiwQ/hXv1Snw+lg== X-Google-Smtp-Source: AGHT+IFs8qPpq/EHLRn0faoEl92xwBTpvhkCZ6ZdnJ3W/i5MF3o9+Nj0aLTIuiMPxgxwkVAQt1tV X-Received: by 2002:ac2:48a5:0:b0:51d:a78e:9036 with SMTP id u5-20020ac248a5000000b0051da78e9036mr371500lfg.69.1714674173485; Thu, 02 May 2024 11:22:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714674173; cv=pass; d=google.com; s=arc-20160816; b=UNPSpugB7aXehPFbY5ZIxK6WnWEGrPmpMdF7vPT3gd730rDytpxSq2FrYoRuL/xLTZ J+4paXN+z02yfTlVksZq2o17gjPMi31Tz9FrcJsWGgk+7iGqpQQs/XfGk/JaN49qglXf yt+Ncy81kgLLg7V+YM3zGhb0pjwtpOXTRO8iwzMNlvU+a6ISqTxoG6jMAoAsnKu0+p2P tLABfZ3auFn96GaHwY3A/kb0rcP1MOwEMPxR9zjn+VmrGno8xcmnEX/HGOhhawfojzU8 1BToUhWossBW4ReaSRrOyey8h+80M5OhBhbmzyT/5XMzeiBMGcef+xJ4nbgQmLYimzvq o9Jw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :sender:dkim-signature; bh=U+RaPVn6HkrrIM33dEK9K9ChnzChCLl6eDfX1JTLZWM=; fh=yO1pewgfY/F5x5tSTz9ISx4Zej3pdZc68tqsbnFtcyQ=; b=ew56fsZUOZAy7hgXnS5n3UljGCfR2K3vQcVbCkJjVmCMBX4z4WSAR2o2N6/6IoH46B b7JdDpJBLD6YyV1PK5LJUGzthjOm6+f4p/OceSCrAi9cIXpGzCFqbRLwbmiP6u+dn5WI fztOg+ax8Pwq0KuwdvQy7vcJVk5Wsef56XKTWgP/Lwgv2kgGVo1FsWks6icdHTTjOV7h etje7Hc0ZCewa3mrusMlUXFI2YT9tDDXSpblH35wq8XW5wQtPoFmxX5OKXzNY6CzZd9M OX7gUoPA7ajpGJSN/sabhlYlJjmTRz5EEW332sb9mDtFZgoDdJJToag8zeS6cN8axLkD kv0w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=PEIYCLjg; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-166833-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166833-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id e16-20020a50fb90000000b00572a9843795si699834edq.608.2024.05.02.11.22.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 11:22:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-166833-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=PEIYCLjg; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-166833-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166833-linux.lists.archive=gmail.com@vger.kernel.org" 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 057361F242BF for ; Thu, 2 May 2024 18:22:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7DB5F173343; Thu, 2 May 2024 18:22:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PEIYCLjg" Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (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 01B37171068; Thu, 2 May 2024 18:22:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714674165; cv=none; b=ohX7ftqWA4dEPeWm2UoO9XYrfL4ZGyv3xdxNpsQgdqny0htgXqkx4+XDJMEDoIldp73M5ugL7UO0l3OVhNUc396Tg1NrQ6b/RFMp63DsPwn+puTJZHPq2Kf2CE/RSWNyydlUprxwPDSYOg5SXFfYNteC1bzuOzg8bNORsuNuZfg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714674165; c=relaxed/simple; bh=My+0Rd5lz0MXO7wxfA9MZxTeduLaR5NO1sttRqiTYzo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=X82fyPfsspspwJyhtc0bLxHrp8VRHZmrfxrIeozh/7BHtIBx46pnzjot4Db+8v91tI+IWJePFV8XuJUm+Qlf0Sj/5ezM0vmkpvpQuDPmeou0/NMWTO6poNfN/2fHu9BLM2jxT4lqT/d1+V2W0Bc0B6hUBLlJyut7FC3kb6Jz9fM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=PEIYCLjg; arc=none smtp.client-ip=209.85.214.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-1e3c3aa8938so55164125ad.1; Thu, 02 May 2024 11:22:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714674163; x=1715278963; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:sender:from:to:cc:subject:date:message-id:reply-to; bh=U+RaPVn6HkrrIM33dEK9K9ChnzChCLl6eDfX1JTLZWM=; b=PEIYCLjgAhsimedo1aZw9swqsbWG1nxkfk0bSj19MDYdxy1gAoic9yYiTAt26npddZ K/qrDurCWi8eUVbnuC4pfePYmH1f0kHxT05HchQwoVr/ZiYyGSHQw9ILZyE2ArOfUxDi dIja5+clEZCvRUq/+oPucqSSzMwEO/NEFeTnB7uSBbaOgvbZkubaxofh7G94WGhAI1lE 7wokZyx/NEes54b7Qrt8O315NStWnuoQkul9+BNE865BmGCXiN6LLUrakUqnR1G9pqzH tGSP2JCydn+SGlG9b1ONzV03v733XnKU3geBshE0JI40eAFi5Agdg7QO+sFljA6s7IOu 9AgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714674163; x=1715278963; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=U+RaPVn6HkrrIM33dEK9K9ChnzChCLl6eDfX1JTLZWM=; b=PFLLTLfCbwwcwJYTlwsiM5pAJOQsa0uUW4VaBS1wMb5KR9XFf9KWB3E7pveloZdVjQ Ij3fTeldWhgou33IBnQpb5tz+Nuz1yvTRerU0VrSDe1bfystn3WP4eie/Sxcju+163qz kAqeZkEEbgoL+u+VFI54GPm52EJvws8k3DepF+mSgHlRWm/S/zuwUQ6nHQXu1itFxW1/ ZTMk+KPypVFiZ+AeBb8KBGvn7CcYOHqZF1/fIYBMG4K33bKsOSzjnzxzyMTCPbUeyvG5 EMW0TAj17ymmsZsia/tscuMDlg6y5Rh58K7o7VDR9P5y1/nR8wRBjg9pAMUmMrR6c/pF sV0Q== X-Forwarded-Encrypted: i=1; AJvYcCW8/HcAy4svEL+LQxglgJfp4w+mzi7lQmirSP5L+JY/MonPu+W5AacdDQQZ8TUYBlZZMg00ZPhcmfGdRfrZt3xns+N5+hhD0drbX3erOVRjtUOw3vVQqSEYTxBXLrmKJAPTGgya3JBI3OU= X-Gm-Message-State: AOJu0YxZDdKUsbVx+NdFhjQaHf6p75Uw8RmpCs2HWjA6jpSYeWIPHV8o 1oqXUcwH4CP5ilau30TdE+rztO8qowodIMWp6GU4pzxj3lhr3t7pPgaUQA== X-Received: by 2002:a17:903:18b:b0:1ec:c6d1:8950 with SMTP id z11-20020a170903018b00b001ecc6d18950mr478825plg.63.1714674163207; Thu, 02 May 2024 11:22:43 -0700 (PDT) Received: from ?IPV6:2600:1700:e321:62f0:329c:23ff:fee3:9d7c? ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id w9-20020a1709026f0900b001e2a7ed52d0sm1651881plk.239.2024.05.02.11.22.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 May 2024 11:22:42 -0700 (PDT) Sender: Guenter Roeck Message-ID: Date: Thu, 2 May 2024 11:22:40 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] hwmon (max6639): Use regmap To: Naresh Solanki Cc: Jean Delvare , linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240430210539.935040-1-naresh.solanki@9elements.com> <52e7692c-abaa-4201-8248-3f42bb250335@roeck-us.net> Content-Language: en-US From: Guenter Roeck Autocrypt: addr=linux@roeck-us.net; keydata= xsFNBE6H1WcBEACu6jIcw5kZ5dGeJ7E7B2uweQR/4FGxH10/H1O1+ApmcQ9i87XdZQiB9cpN RYHA7RCEK2dh6dDccykQk3bC90xXMPg+O3R+C/SkwcnUak1UZaeK/SwQbq/t0tkMzYDRxfJ7 nyFiKxUehbNF3r9qlJgPqONwX5vJy4/GvDHdddSCxV41P/ejsZ8PykxyJs98UWhF54tGRWFl 7i1xvaDB9lN5WTLRKSO7wICuLiSz5WZHXMkyF4d+/O5ll7yz/o/JxK5vO/sduYDIlFTvBZDh gzaEtNf5tQjsjG4io8E0Yq0ViobLkS2RTNZT8ICq/Jmvl0SpbHRvYwa2DhNsK0YjHFQBB0FX IdhdUEzNefcNcYvqigJpdICoP2e4yJSyflHFO4dr0OrdnGLe1Zi/8Xo/2+M1dSSEt196rXaC kwu2KgIgmkRBb3cp2vIBBIIowU8W3qC1+w+RdMUrZxKGWJ3juwcgveJlzMpMZNyM1jobSXZ0 VHGMNJ3MwXlrEFPXaYJgibcg6brM6wGfX/LBvc/haWw4yO24lT5eitm4UBdIy9pKkKmHHh7s jfZJkB5fWKVdoCv/omy6UyH6ykLOPFugl+hVL2Prf8xrXuZe1CMS7ID9Lc8FaL1ROIN/W8Vk BIsJMaWOhks//7d92Uf3EArDlDShwR2+D+AMon8NULuLBHiEUQARAQABzTJHdWVudGVyIFJv ZWNrIChMaW51eCBhY2NvdW50KSA8bGludXhAcm9lY2stdXMubmV0PsLBgQQTAQIAKwIbAwYL CQg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Gqvg9os4rNkUWmrCfLLsZDHD8FnU mDW4+i+XlNFUPUYMrIKi9joBhu18ssf5i5Q= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 ? Thanks, Guenter