Re: [PATCH v6 4/4] i2c: designware: Add doorbell support for Mendocino

From: Mark Hasemeyer
Date: Mon Mar 27 2023 - 12:37:41 EST


> static int psp_send_i2c_req(enum psp_i2c_req_type i2c_req_type)
> {
> struct psp_i2c_req *req;
> @@ -87,7 +101,7 @@ static int psp_send_i2c_req(enum psp_i2c_req_type i2c_req_type)
> req->type = i2c_req_type;
>
> start = jiffies;
> - ret = read_poll_timeout(psp_send_i2c_req_cezanne, status,
> + ret = read_poll_timeout(_psp_send_i2c_req, status,
> (status != -EBUSY),
> PSP_I2C_REQ_RETRY_DELAY_US,
> PSP_I2C_REQ_RETRY_CNT * PSP_I2C_REQ_RETRY_DELAY_US,
The timeout error handling message after this has "acquire" and
"release" flopped.

> @@ -275,6 +291,13 @@ int i2c_dw_amdpsp_probe_lock_support(struct dw_i2c_dev *dev)
> if (psp_i2c_dev)
> return -EEXIST;
>
> + /* Cezanne uses platform mailbox, Mendocino and later use doorbell */
> + rdev = pci_get_domain_bus_and_slot(0, 0, PCI_DEVFN(0, 0));
> + if (rdev->device == 0x1630)
> + _psp_send_i2c_req = psp_send_i2c_req_cezanne;
> + else
> + _psp_send_i2c_req = psp_send_i2c_req_mendocino;
Thinking about naming again, perhaps "mendocino" should be dropped
from the function name as the logic applies to all platforms except
cezanne.