Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp370692ybk; Wed, 13 May 2020 02:22:29 -0700 (PDT) X-Google-Smtp-Source: APiQypJrNPwEHhrQew4IZ60sJR86SGAHhpTiQ+w9lN15y5N3ZqBDOAjIW1dFRsR02FbJkYPZBCqy X-Received: by 2002:a50:eb0a:: with SMTP id y10mr21457752edp.312.1589361749672; Wed, 13 May 2020 02:22:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589361749; cv=none; d=google.com; s=arc-20160816; b=TpqFanL6Z+1DSi4oHV0IYOtQwxAEwu/PNgZ3E5ebj8HgJDaipJyFH9NmqwnmvP15Qh TgEMlYk/liH9opB/uXXPSx5Lj8ArrWq68vrAesQUyWo28zZuNM8GUt7q1H19/+7AhcwW dRtAOJRTwVoWFfePezdGL5/LdnG95EEpQxHds07SKd0THMGWBk+COgabSxiTBPJkDxJb Vq4dYWw3j2RGD9D1FN0W0Hj6eROb9oG8zn9Vr7bVPsm4kXaApjwpBZfRC9WxN/meHLzA p1VC9aQ9PWxRs6ptzQZDZ1FxhqyVLgP7SZiiRkopk57/TPHJwKRehxmNniNabFKOmt+J 8GxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dmarc-filter :dkim-signature; bh=T6dxEfKekbNc9oWN1bm57JzamwT0E2LE9YYffgNFdYo=; b=EIRICZrGR7Kx0N+lTLhcz2ekMtiYM5cPj84YQbSVJZv1WPeoT8YwAQYGbGJHJ+EZzF akQ+8I+7Fnkg+t8I35XzJ3etF1sE1dp8sHVegLHNZzlyQ15R/J4Ug6ONHS0FDLfEEv+Y aSMsEYlBLkRQarE0jBxN166YYmE+5Et2zWOjXI7wAen5ZT1HRX1X67fyZw7BXI3oFzrD bVQyp/UzkkMFO3RcWvXaNkPs37ojf/H0aFl1hWKNGfjBnpAbFm80hmFDUoUvUBkXNNTh UOZ2Jphn/arQXwPNFGe/gUodaXUDCDY2wa1Rw7RgvZVmakJZU5iYeZTzrzgqgYiwzyxy FcWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b="N/esBg+H"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z15si8237191ede.558.2020.05.13.02.22.06; Wed, 13 May 2020 02:22:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b="N/esBg+H"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727118AbgEMJU2 (ORCPT + 99 others); Wed, 13 May 2020 05:20:28 -0400 Received: from mail26.static.mailgun.info ([104.130.122.26]:19860 "EHLO mail26.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726891AbgEMJU1 (ORCPT ); Wed, 13 May 2020 05:20:27 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1589361627; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: From: References: Cc: To: Subject: Sender; bh=T6dxEfKekbNc9oWN1bm57JzamwT0E2LE9YYffgNFdYo=; b=N/esBg+HkimQXNQK0I3/tozMsoIKh7WZSnzDyBtFJUIwmoHjji3N6xeaUfiuPfrOaSmwEDBh qHyf5NmRWTxs25PebvIB2SaWxx5hFDGNo5KMApBjpuP5a4ODF3g0dkz2bgcqio+XQEyfkPT5 Y8frx5YT+I2TwJ56ED5uoHxZSTc= X-Mailgun-Sending-Ip: 104.130.122.26 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by mxa.mailgun.org with ESMTP id 5ebbbbd2.7fa74bc33340-smtp-out-n02; Wed, 13 May 2020 09:20:18 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 5EB55C43637; Wed, 13 May 2020 09:20:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.0 Received: from [192.168.1.101] (unknown [157.48.3.164]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: jprakash) by smtp.codeaurora.org (Postfix) with ESMTPSA id DDF16C433D2; Wed, 13 May 2020 09:20:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org DDF16C433D2 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=jprakash@codeaurora.org Subject: Re: [PATCH V2 3/3] iio: adc: Add support for PMIC7 ADC To: Andy Shevchenko Cc: agross@kernel.org, Bjorn Andersson , devicetree , Linux Kernel Mailing List , Matthias Kaehlcke , Linus Walleij , Jonathan Cameron , smohanad@codeaurora.org, kgunda@codeaurora.org, aghayal@codeaurora.org, Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , linux-arm-msm@vger.kernel.org, linux-iio , linux-arm-msm-owner@vger.kernel.org References: <1586942266-21480-1-git-send-email-jprakash@codeaurora.org> <1586942266-21480-4-git-send-email-jprakash@codeaurora.org> <68d9c770-b190-dd13-0869-fdae9fb1f16f@codeaurora.org> From: Jishnu Prakash Message-ID: Date: Wed, 13 May 2020 14:50:06 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andy, On 4/27/2020 6:58 PM, Andy Shevchenko wrote: > On Mon, Apr 27, 2020 at 3:56 PM Jishnu Prakash wrote: >> On 4/17/2020 3:51 PM, Andy Shevchenko wrote: >> On Thu, Apr 16, 2020 at 1:48 AM Jishnu Prakash wrote: > Stop using HTML. It breaks badly the reply and discussion. > > ... > >> +static const struct adc5_data adc7_data_pmic; >> >> Global variable? Hmm... >> >> adc7_data_pmic is referenced twice before its actual definition (which was added along with corresponding adc5_data struct for PMIC5 ADC), so I have given the initial declaration here. > Maybe you can realize how to avoid global variable at all? There is a way to remove this, I'll make this change with some other changes in the fifth patch of my latest post. > > ... > >> + buf[1] &= 0xff & ~ADC5_USR_FAST_AVG_CTL_SAMPLES_MASK; >> >> What the point of 0xff & part? >> >> This was something you suggested in my first post: >> >>> + buf[1] &= (u8) ~ADC5_USR_FAST_AVG_CTL_SAMPLES_MASK; >> Use '0xFF ^ _MASK' instead of casting. >> >> ... >> >>> + buf[3] &= (u8) ~ADC5_USR_HW_SETTLE_DELAY_MASK; >> Ditto. >> >> I think "0xff &" works as intended here in place of casting to (u8)... > Does it work without casting? (Note, I suggested slightly different expression) > I.o.w. what the problem casting solves? I checked this part again. It looks like casting is not strictly required here, I'll remove it in my latest post. > >> + buf[1] |= prop->avg_samples; >> + >> + /* Select ADC channel */ >> + buf[2] = prop->channel; >> + >> + /* Select HW settle delay for channel */ >> + buf[3] &= 0xff & ~ADC5_USR_HW_SETTLE_DELAY_MASK; >> >> Ditto. >> >> + buf[3] |= prop->hw_settle_time; >