From nobody Wed Dec 17 10:46:01 2025 Received: from smtp88.iad3b.emailsrvr.com (smtp88.iad3b.emailsrvr.com [146.20.161.88]) (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 DEE961922DC for ; Wed, 10 Jul 2024 18:02:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=146.20.161.88 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720634522; cv=none; b=nVGyRy+p/pqIHrHA2ejQIWiTHHNqg457VV3ZVT9EkME5CIrAFMybJTQXZnMqmH89edtqNkscBXYSJS4JFTMLey6VyFfEoWro2xfGwQV8qIhhtsfkelwIqMqEFtzi9jZIzXu0vpaN5zLty3rbCWwhwf6dx6eoRRn8ZdlAhVbgmuA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720634522; c=relaxed/simple; bh=HoXdi8YDPzKPfOk1K5QZ/YKUnApGodxvc1GCh+obPAw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=UgrsSujmXrnkv9EYkVNCWResoVgbWR3YDqSzkbkE1psl1OTV5PvTriwwydPGC59+7PK+aWeShkP1ctcvMZwvZvSGV9XJaD2Rwj9S9vCVBk9VlX/4x5xqjFY/1bwohly//0J8tHvKNGrVEumPyoN6xXmvSDVaDbQOxq4U2oyR6DM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mev.co.uk; spf=pass smtp.mailfrom=mev.co.uk; dkim=pass (1024-bit key) header.d=mev.co.uk header.i=@mev.co.uk header.b=A7ZmCc8l; arc=none smtp.client-ip=146.20.161.88 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mev.co.uk Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mev.co.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mev.co.uk header.i=@mev.co.uk header.b="A7ZmCc8l" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mev.co.uk; s=20221208-6x11dpa4; t=1720633977; bh=HoXdi8YDPzKPfOk1K5QZ/YKUnApGodxvc1GCh+obPAw=; h=From:To:Subject:Date:From; b=A7ZmCc8li9EupPTQhsSsAfWXZ10ZKV0ajZ3P6AGlhKtifUZavAL1wXVjDUbILoOxL 14xV39isjJN5WoT7gzx06zxypGTHvsSzmBHj7waYdV34bw6g2XOTQbhUt2gLlX2qIw REz+SVd+4g2KMx85vYfdYHYZnaySs09S63BQfBZ8= X-Auth-ID: abbotti@mev.co.uk Received: by smtp20.relay.iad3b.emailsrvr.com (Authenticated sender: abbotti-AT-mev.co.uk) with ESMTPSA id D7C82A019C; Wed, 10 Jul 2024 13:52:56 -0400 (EDT) From: Ian Abbott To: linux-rtc@vger.kernel.org Cc: Alexandre Belloni , linux-kernel@vger.kernel.org, Ian Abbott , stable@vger.kernel.org, Linus Walleij , Mark Brown Subject: [RESEND PATCH] rtc: ds1343: Force SPI chip select to be active high Date: Wed, 10 Jul 2024 18:52:07 +0100 Message-ID: <20240710175246.3560207-1-abbotti@mev.co.uk> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Classification-ID: cd498383-a11f-45b4-a4c9-74a0458dea8a-1-1 Content-Type: text/plain; charset="utf-8" Commit 3b52093dc917 ("rtc: ds1343: Do not hardcode SPI mode flags") bit-flips (^=3D) the existing SPI_CS_HIGH setting in the SPI mode during device probe. This will set it to the wrong value if the spi-cs-high property has been set in the devicetree node. Just force it to be set active high and get rid of some commentary that attempted to explain why flipping the bit was the correct choice. Fixes: 3b52093dc917 ("rtc: ds1343: Do not hardcode SPI mode flags") Cc: # 5.6+ Cc: Linus Walleij Cc: Mark Brown Signed-off-by: Ian Abbott --- drivers/rtc/rtc-ds1343.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/rtc/rtc-ds1343.c b/drivers/rtc/rtc-ds1343.c index ed5a6ba89a3e..484b5756b55c 100644 --- a/drivers/rtc/rtc-ds1343.c +++ b/drivers/rtc/rtc-ds1343.c @@ -361,13 +361,10 @@ static int ds1343_probe(struct spi_device *spi) if (!priv) return -ENOMEM; =20 - /* RTC DS1347 works in spi mode 3 and - * its chip select is active high. Active high should be defined as - * "inverse polarity" as GPIO-based chip selects can be logically - * active high but inverted by the GPIO library. + /* + * RTC DS1347 works in spi mode 3 and its chip select is active high. */ - spi->mode |=3D SPI_MODE_3; - spi->mode ^=3D SPI_CS_HIGH; + spi->mode |=3D SPI_MODE_3 | SPI_CS_HIGH; spi->bits_per_word =3D 8; res =3D spi_setup(spi); if (res) --=20 2.43.0