Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp1283733lqt; Fri, 7 Jun 2024 13:29:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXMZH50lpp3M+POl+vYsUMadanBrb5WXslfcJ5bxN4Y/ywMiRw7X9AutDGcCCwQq3bxWT5cU++nFLU5+AX978k6z+LemRGqw7iWGqHYtg== X-Google-Smtp-Source: AGHT+IG8Z8C+ZeCCnyA1fkySmwdz/JTNLP1BG2K7T4JB5lZ0I9tFZ9Cvx+9sE6U8hYpOEzdGZTIw X-Received: by 2002:a17:90a:bf15:b0:2c2:ce08:d0e4 with SMTP id 98e67ed59e1d1-2c2ce08d1cbmr2021304a91.23.1717792190086; Fri, 07 Jun 2024 13:29:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717792190; cv=pass; d=google.com; s=arc-20160816; b=aNgR8Y2DTEFVddWGrsV1cJ2mIS2JGrQ/JhqPLnkpBhbrtA+WhzEeF7GHSZkNecW/5c mDeZXErbm9QGnIwzrKTWFGGjB9TK6Owwf2Jy3apc9xDanscuLjLIRDEQSo0yy5dKTI1y SSJhsFae+wmV836ePldEEI+wpBo0W9je8Jp/IsCX3YEpBaUneWe0Now/j2Gu4WY3xqp7 2oLkKxCQg+BjpBqo3csT3sgWIkpVvdm8fQWpQsBaFIL9Ioycw+R48zfE1us/tP1MReZe bnyp4YTXB6xj+UJ7gODZZ+phJ1kdVGIeBpgkkOveOMwwyVQB5b+d6WjUmlh2z3vbMPjU eZug== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:date:from; bh=KFjzWQuWxKgefqHvIbBOaJlYTODPcNkdRop8rZTu4AE=; fh=mMz3IhNNTxYqaAlva43MMME8O0Ik38e4SPRg5shaFmg=; b=MGYP7+CW9YC6ZeC8cqTssOU1V6kVQWGrEuJi3AqY5+UlY9bG/4E7IMPPY29LdvTrOY /bXVgHLyqNVPWzLsaW2EMFARx89qc7gQ11i50tZoaTiDkoHFMSoYiyhwrL0h9newy0oI 8tJwncbJkvylC/ubXSMEGiX4XlwvIUqz5R1gINlTVtrsggRp16Qavx8SZop/8hd56qs7 xdWUqS9d0Orgna8ZCHlbiKKaCzrNzNoDq+gMu8FKYwSrzqhkIWR1D2YHuXYCEn0O/QW2 XHwpY2Fq9Q5Bh2jZjbu/2IbXJf1aPhh5rF8/WaUgiTVxo3Y4tthF6uwsFvBX1PAgetEc jjlg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-206707-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206707-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2c2d113848asi862517a91.130.2024.06.07.13.29.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 13:29:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-206707-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; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-206707-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206707-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 11F1228A4B2 for ; Fri, 7 Jun 2024 20:29:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 30C5C1552F5; Fri, 7 Jun 2024 20:29:22 +0000 (UTC) Received: from fgw20-7.mail.saunalahti.fi (fgw20-7.mail.saunalahti.fi [62.142.5.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2AF0114E2FF for ; Fri, 7 Jun 2024 20:29:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.81 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717792161; cv=none; b=X5XOyAbu+d9VTX8OOJkbkPO60Rf4uonyYx/81RzaaZGWAr/wehhMNezrovEgl7T/sKeqoaVfpHqEA0bhhCNStnTM1JRQX6KhCn1KZAFyCbALMutpBjJY2ysHTk8sGiAKcZzjB+JRo/oqRI8MmJW/2JoPUxigDNz2nps6mtY7D9c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717792161; c=relaxed/simple; bh=LWkQbRGo51GW+7l4ahN+J4VoJhN2gJmJSiGsH0bZP28=; h=From:Date:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=oSaETWvg+JYfG3nd/ncSg8+XcQ6ki0ume90HdyfsgI3x30rwgJpnaSKscJWLOjpX1mjP0wQ85UxahPpGJ8tw0iyXogwvDWn9g1L0tiSC2Rael9dzHjLjbp3Bkcza6HketS6/fBhcHDNmsnFJyhz88Q7MPKxtOwgvYGVlrQv2AKo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=fail smtp.mailfrom=gmail.com; arc=none smtp.client-ip=62.142.5.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com Received: from localhost (88-113-26-230.elisa-laajakaista.fi [88.113.26.230]) by fgw21.mail.saunalahti.fi (Halon) with ESMTP id 99337689-250c-11ef-ab0a-005056bdd08f; Fri, 07 Jun 2024 23:29:11 +0300 (EEST) From: Andy Shevchenko Date: Fri, 7 Jun 2024 23:29:10 +0300 To: Andy Shevchenko Cc: Patrick Rudolph , Linus Walleij , naresh.solanki@9elements.com, broonie@kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/3] pinctrl: cy8c95x0: Use regmap ranges Message-ID: References: <20240521152602.1097764-1-patrick.rudolph@9elements.com> <20240521152602.1097764-2-patrick.rudolph@9elements.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Tue, May 21, 2024 at 08:34:18PM +0300, Andy Shevchenko kirjoitti: > On Tue, May 21, 2024 at 6:26 PM Patrick Rudolph > wrote: > > > > Instead of implementing a custom register paging mechanism in > > the driver use the existing regmap ranges feature. > > driver, use ... > > +static const struct regmap_range_cfg cy8c95x0_ranges[] = { > > + { > > + .range_min = CY8C95X0_VIRTUAL, > > + .range_max = 0, /* Updated at runtime */ > > This and similar comments are misleading since the data is defined as > const. Updated --> Filled or alike here and elsewhere. > > > + .selector_reg = CY8C95X0_PORTSEL, > > + .selector_mask = 0x07, > > + .selector_shift = 0x0, > > + .window_start = CY8C95X0_INTMASK, > > + .window_len = MUXED_STRIDE, > > + } > > }; ... > > + regcache_cache_only(chip->regmap, true); > > + regmap_update_bits(chip->regmap, off, mask & val, 0); > > + regcache_cache_only(chip->regmap, false); > > A side note: It's strange to see mask & val, 0 in the parameters of > regmap calls. Perhaps refactor this (in a separate patch) to use > standard approach? ... > > + memcpy(®map_range_conf, &cy8c95x0_ranges[0], sizeof(regmap_range_conf)); > > memcpy(®map_range_conf, cy8c95x0_ranges, sizeof(regmap_range_conf)); I hope the all above can be tweaked by Linus when applying. ... > Note, if you are not using --histogram diff algo, please start using > it from the next version of this series. > > P.S. I will test the next version on Intel Galileo Gen1 as currently I > have some issues with the HW I need to fix first. Unfortunately I wasn't able to ressurect the HW and now I'm going to be off for a while. Let's go with this and if any problem appears, I probably can try to fix myself. Reviewed-by: Andy Shevchenko -- With Best Regards, Andy Shevchenko