lkml.org 
[lkml]   [2021]   [Oct]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v1 1/2] i2c:busses:Register PCI1XXXX adapter to I2C subsystem
On Thu, Oct 07, 2021 at 07:40:04PM +0300, Dmitry Osipenko wrote:
> 29.09.2021 09:22, LakshmiPraveen Kopparthi пишет:

...

> > +static int pci1xxxx_i2c_suspend(struct device *dev)
> > +{
> > + struct pci1xxxx_i2c *i2c = dev_get_drvdata(dev);
> > + struct pci_dev *pdev = to_pci_dev(dev);

How pdev is used?

> > + u32 regval;
> > +
> > + i2c_mark_adapter_suspended(&i2c->adap);
> > +
> > + pci1xxxx_ack_high_level_intr(i2c, ALL_HIGH_LAYER_INTR);
> > + pci1xxxx_i2c_config_high_level_intr(i2c, ALL_HIGH_LAYER_INTR, false);
> > +
> > + /*
> > + * Enable the PERST_DIS bit to mask the PERST from
> > + * resetting the core regs
> > + */
> > + regval = readl(i2c->i2c_base + SMBUS_RESET_REG);
> > + regval |= PERI_SMBUS_D3_RESET_DIS;
> > + writel(regval, i2c->i2c_base + SMBUS_RESET_REG);
> > +
> > + return 0;
> > +}
> > +
> > +static int pci1xxxx_i2c_resume(struct device *dev)
> > +{
> > + struct pci1xxxx_i2c *i2c = dev_get_drvdata(dev);

> > + struct pci_dev *pdev = to_pci_dev(dev);

Ditto.

> > + u32 regval;
> > +
> > + i2c_mark_adapter_resumed(&i2c->adap);
> > +
> > + regval = readl(i2c->i2c_base + SMBUS_RESET_REG);
> > + regval &= ~PERI_SMBUS_D3_RESET_DIS;
> > + writel(regval, i2c->i2c_base + SMBUS_RESET_REG);
> > +
> > + return 0;
> > +}

--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2021-10-07 19:08    [W:1.102 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site