Re: [PATCH v5 4/4] tpm: tpm_tis_spi: Support cr50 devices

From: Jarkko Sakkinen
Date: Thu Aug 29 2019 - 14:05:02 EST


On Thu, Aug 29, 2019 at 09:48:50AM -0700, Stephen Boyd wrote:
> > > +int tpm_tis_spi_resume(struct device *dev)
> > > +{
> > > + struct tpm_chip *chip = dev_get_drvdata(dev);
> > > + struct tpm_tis_data *data = dev_get_drvdata(&chip->dev);
> > > + struct tpm_tis_spi_phy *phy = to_tpm_tis_spi_phy(data);
> > > + struct cr50_spi_phy *cr50_phy;
> > > +
> > > + if (phy->is_cr50) {
> > > + cr50_phy = to_cr50_spi_phy(phy);
> > > + /*
> > > + * Jiffies not increased during suspend, so we need to reset
> > > + * the time to wake Cr50 after resume.
> > > + */
> > > + cr50_phy->wake_after = jiffies;
> > > + }
> >
> > To simplify the code I would just put also wake_after to
> > tpm_tis_spi_phy.
>
> Ok. But keep the other members in cr50_spi_phy as they are?

Yes, just want to get rid of that boolean and branching since the
operations done have insignificant cost.

/Jarkko