From: Mark Brown <broonie@kernel.org>
To: masonccyang@mxic.com.tw
Cc: tpiepho@impinj.com, linux-kernel@vger.kernel.org,
linux-spi@vger.kernel.org, boris.brezillon@bootlin.com,
juliensu@mxic.com.tw, zhengxunli@mxic.com.tw
Subject: Re: [PATCH 1/2] spi: Add MXIC controller driver
Date: Wed, 19 Sep 2018 10:46:12 -0700 [thread overview]
Message-ID: <20180919174612.GG2471@sirena.org.uk> (raw)
In-Reply-To: <1537168579-31593-2-git-send-email-masonccyang@mxic.com.tw>
[-- Attachment #1: Type: text/plain, Size: 963 bytes --]
On Mon, Sep 17, 2018 at 03:16:18PM +0800, masonccyang@mxic.com.tw wrote:
> +static void mxic_spi_set_cs(struct spi_device *spi, bool lvl)
> +{
> + struct mxic_spi *mxic = spi_master_get_devdata(spi->master);
> +
> + if (!lvl) {
> + if (mxic_spi_clk_setup(spi))
> + return;
> + if (mxic_spi_clk_enable(mxic))
> + return;
> + writel(readl(mxic->regs + HC_CFG) | HC_CFG_MAN_CS_EN,
> + mxic->regs + HC_CFG);
> + writel(HC_EN_BIT, mxic->regs + HC_EN);
> + writel(readl(mxic->regs + HC_CFG) | HC_CFG_MAN_CS_ASSERT,
> + mxic->regs + HC_CFG);
Like Boris says having the clock management in the chip select
operations is not good - it's not just redundant with runtime PM, it's
potentially broken if a device does something like using an inverted
chip select. The chip select operation should just be managing the chip
select, nothing else. If it does other things it's going to end up
being broken for some cases.
Otherwise this looks good.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2018-09-19 17:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-17 7:16 [PATCH 0/2] spi: Add Macronix " masonccyang
2018-09-17 7:16 ` [PATCH 1/2] spi: Add MXIC " masonccyang
2018-09-17 12:09 ` Boris Brezillon
[not found] ` <OF74F67ECA.BEFB2D2A-ON48258316.002C2CD6-48258316.002DE896@mxic.com.tw>
2018-09-28 8:29 ` Boris Brezillon
2018-09-19 17:46 ` Mark Brown [this message]
2018-09-17 7:16 ` [PATCH 2/2] dt-binding: spi: Document Macronix controller bindings masonccyang
2018-09-25 15:20 ` [PATCH 0/2] spi: Add Macronix controller driver Boris Brezillon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180919174612.GG2471@sirena.org.uk \
--to=broonie@kernel.org \
--cc=boris.brezillon@bootlin.com \
--cc=juliensu@mxic.com.tw \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=masonccyang@mxic.com.tw \
--cc=tpiepho@impinj.com \
--cc=zhengxunli@mxic.com.tw \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome