From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.167.46 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796363916; b=cUssSM1PwSj2sA2aGu87x7kFe2bFZhbYPHSZtAebDv2RR8J/iMSum5TN9mXsPdcCPxgH 69yNx6epKsrLqnAXe1FFfXBY45E73VOVT2unqFwLC4y7EwG3PfXcJRSm45W/3Fd89dzz1 t8eHdvdT0KV+Byosz9QFkK/UENJ/L/HuGQks61tyHdLa/mwp5alLy3AJ8bqq4ZpLilDZt E34IoYBx5njzz3svvv252/7d3rc4aPSaSQHlOgaDdtTKcq1SsKnCpLHO0pJIl/zT+ml1k 3ut4WW/f05eVoBnrgeK64msMbZ0D73hjx+XUWdIqqOMWNjjMDh1FQNbu+UD9EVLtbZg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796363916; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Message-ID:Date:MIME-Version:User-Agent:Subject:To:Cc:References: Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; bh=60iDqJyfmcOvT2rglRRRI0RPjqtax3udNgCfrJGnBjs=; b=ERxOai+twqse++W/sd4cpKsl9bujC2DA7z6NZXbnoglvT3Aat7UQPmRj0Yo1jbPMEgga XliQCXlLp7vNwRPby8KzrIKtkeBJABUYzlmQ0X0wUez6tmL47FfVLyjmzPLktOXhJgpTQ FtCb474hAtycqWHwd7Rlo7mF9wewiMJw8ynRk0Q7XkcRVeSgWTM+zEZJ8MfRt+VsI/UYC 5uH2C1CKWDIedD5gupoTXFdaToXrX4fhC/HIT3r+gjgScHtk+VlsmLPSoa+ANS8d72N0d BHxtkzKJpkh/Q2OWklh7Z63H0+SfLQV3UH49IMRnstuPFZmLNoGtUFoShfhSntZIXGQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=W+qdvGEw; arc=none smtp.remote-ip=209.85.167.46 Received: from mail-lf1-f46.google.com (mail-lf1-f46.google.com [209.85.167.46]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 97484606A32C for ; Fri, 4 Dec 2026 05:58:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 97484606A32C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=W+qdvGEw Received: by mail-lf1-f46.google.com with SMTP id 2adb3069b0e04-5c07c7306e1so321701e87.1 for ; Thu, 03 Dec 2026 21:58:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796363915; x=1796968715; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=60iDqJyfmcOvT2rglRRRI0RPjqtax3udNgCfrJGnBjs=; b=W+qdvGEwrZ9tU4SakqVGSB+McW/8rJM6J4CR0O84mawIaz0xzZI4XEs2mPrHAyu4UT YjL/00QTnOJ4ATKiaiJj+jj61jpAWDE3k9Vunx88RdASCxBdxuL5I5wNqLma5eUlmsI9 8Bm/TjuLvMi0uyDi2ynOe8692JIg45QTNsxY/1SH3KigItFZO55QPTSnRohtZOiGV4NR b3KWfjGNM+qsmZLuBTpVSuej3U+A2wXabRLq7DeAFfoZEQjGGUmaxAnlPKLj7MYpsmb/ tN0M1ZDrtAaUz2GuZnyDmcxY7uQN2N+m3TRqM9x9pnU7SYqJDR4krr5MF4jQWbW73Gb+ W01g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796363915; x=1796968715; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=60iDqJyfmcOvT2rglRRRI0RPjqtax3udNgCfrJGnBjs=; b=xnkWIM8+oYZnKcVtvVk+RNLSRVeQwWFwprz8+m5a+5zUiJrnbjVm6zOOkVorI0+1XV NAhMBD9nWsQgWIvqapRv2ZABfbvjBrY/y9v7XKrgzL9ojluBKX+h4b/vn7zSp2rTflZb dDyKJNNBtVPWlNgZurCkWl6tnrGU3V3hGSVeNXlIhVs6tyeZdrJKEgC6XdtMpE+AHQy8 i1ZlzrPcA9bIc6PHZKuS61XGo+S5ZaJwiAILSQXQAFaAd/QDPgUCf7spwovLq2U6o3xc 9e0GSeoH7UbOBxD+ISj3yjHb+EK7Bl9cy4tS7obpFnMWDsljpOjozgLL2EBQswKubbjl kb6g== X-Forwarded-Encrypted: i=1; AL+hErGc5ZLNDrlwm9Ve+3VnP0kJV+sirQU3WQZFb3PK3QfeJ9pUBlXjy5tWZ7py00x//idIcswkDKe6B0U=@vger.kernel.org X-Gm-Message-State: APuU4Z/DIrB3tt8Pw059YNH0s9ECBfBt0HMveGdY83+nAnPgroLZFP+Y TL4+GGuMG/Gn7kucumpYrhyiG8UUv+lFBUBN1xGUpE+YWiCgEVyq0vxo X-Gm-Gg: AZFdTZdgrywGOJiSeKmYEzUm1UvpCngq9amK9lNS65YTbb9RdM0zCiesbf8x5pJmdz/ bLVgHeorMpUIGMG0f2anvAZfPWDFwqf/5igFmptVduSsKEKXmp8Pd8/21SbLIovKimyfpXJJEZf efwDOIW/zY8+BkjphMWOD25tKHEN4uxqVaWWSI0j/DiF29mBIRp/kcmFMlQ5jCbuMIpxxv/jKKy w7WowhtHaGC2nT1+7aFLIVvney25F71899k7UkmLsyNP2gP6ke2uHvgJr8yN9QOArqccHigNiWs uULS0Di7oQs670BpkE0hBRUh3WmZXJTM/YyfKY3muEAmw26wcU6fplWKYjw0VvstUDR52TgH7+4 sb3Cpoz35jHHrLPMGafjijMh6ppyNkBTwGOGfdqXnENHTX2XkJHedwzxb8YhzwWfjARZcPmAtrb NG6xEz6t4FijXqJnwQIqo0IfM/PHPPL8GN2gq84UjydmBmMKLxFM0x/+pNe25IrWzCOcfpZvyCO TOqAXCz9G9/Kt2hGIVTdTozRJKfz0bOsUSRErEK+yj/0t/7SBhUi6m27bhYLg7c3T9MJK/ugEwZ DgFWA+0GdGRERd6Sot1oxjF9DmvZzeacPXw4mJIVVJCStQabumTLQ6fE3Z79YWEMB4ecViCdbDC cLFsTjFsN X-Received: by 2002:a05:6512:1044:b0:5c0:b5c:4052 with SMTP id 2adb3069b0e04-5c385f420b3mr182906e87.2.1796363914612; Thu, 03 Dec 2026 21:58:34 -0800 (PST) Received: from ?IPV6:2a10:a5c0:800d:dd00:8fdf:935a:2c85:d703? ([2a10:a5c0:800d:dd00:8fdf:935a:2c85:d703]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-3b0037d8608sm3921801fa.30.2026.12.03.21.58.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 03 Dec 2026 21:58:32 -0800 (PST) Message-ID: <5a147154-c37e-4438-86b6-2e4639781f4e@gmail.com> Date: Fri, 4 Dec 2026 07:58:30 +0200 X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 4/4] bd79703: Support ROHM BD7971x DACs To: Andy Shevchenko Cc: Matti Vaittinen , Matti Vaittinen , Jonathan Cameron , David Lechner , =?UTF-8?Q?Nuno_S=C3=A1?= , Andy Shevchenko , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: Content-Language: en-US, en-AU, en-GB, en-BW From: Matti Vaittinen In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 03/12/2026 19:09, Andy Shevchenko wrote: > On Wed, Dec 02, 2026 at 03:39:21PM +0200, Matti Vaittinen wrote: > >> The BD7971x are logically similar to BD7970x. Main difference is the >> amount of bits in DAC-word. The BD7970x had 8-bit DAC whereas the >> BD7971x use 10-bit DAC word. >> >> The SPI data format differs. The BD7971x requires two least significant >> bits to be zeroes, and carries the DAC word in following 10 bits. The >> channel number is in highest 4 bits. >> >> Add support for the BD7971x family of DACs. > > Subject went wrong (w/o required prefix). > > ... > >> +/* The BD7971X uses 16-bit data transfers. Four high bits define the channel >> + * and following 10 bits define the DAC word. Two last bits must be zero. >> + * >> + * Let's try having the 4 channel-bits as an address and following bits as data >> + */ > > /* > * The multi-line comment style should follow this > * example. It's even inconsistent to the one used > * in the driver. > */ > > ... > >> struct bd79703_data *data = iio_priv(idev); >> + unsigned int tmp = val; > > This signed->unsigned trick begs for a comment. It's quite easy to miss and > someone might introduce some issues due to that. I was a bit unsure whether to do this or not. With the data-sizes these DACs use, this assignment shouldn't really be needed. Still, leaving shifting to be done with signed int felt a bit error prone, in case things change. If you agree the assignment to unsigned makes sense, then I suppose adding a comment is good idea. Very valid points. Thanks Andy! Yours, -- Matti -- Matti Vaittinen Linux kernel developer at ROHM Semiconductor Oulu Finland ~~ When things go utterly wrong vim users can always type :help! ~~