#define SSBI_TIMEOUT_US 100
struct msm_ssbi {
- struct device *dev;
struct device *slave;
void __iomem *base;
spinlock_t lock;
udelay(1);
}
- dev_err(ssbi->dev, "%s: timeout (status %x set_mask %x clr_mask %x)\n",
- __func__, ssbi_readl(ssbi, SSBI2_STATUS), set_mask, clr_mask);
return -ETIMEDOUT;
}
while (timeout--) {
rd_status = ssbi_readl(ssbi, SSBI_PA_RD_STATUS);
- if (rd_status & SSBI_PA_RD_STATUS_TRANS_DENIED) {
- dev_err(ssbi->dev, "%s: transaction denied (0x%x)\n",
- __func__, rd_status);
+ if (rd_status & SSBI_PA_RD_STATUS_TRANS_DENIED)
return -EPERM;
- }
if (rd_status & SSBI_PA_RD_STATUS_TRANS_DONE) {
if (data)
udelay(1);
}
- dev_err(ssbi->dev, "%s: timeout, status 0x%x\n", __func__, rd_status);
return -ETIMEDOUT;
}
unsigned long flags;
int ret;
- if (ssbi->dev != dev)
- return -ENXIO;
-
spin_lock_irqsave(&ssbi->lock, flags);
ret = ssbi->read(ssbi, addr, buf, len);
spin_unlock_irqrestore(&ssbi->lock, flags);
unsigned long flags;
int ret;
- if (ssbi->dev != dev)
- return -ENXIO;
-
spin_lock_irqsave(&ssbi->lock, flags);
ret = ssbi->write(ssbi, addr, buf, len);
spin_unlock_irqrestore(&ssbi->lock, flags);
ret = -EINVAL;
goto err_ioremap;
}
- ssbi->dev = &pdev->dev;
platform_set_drvdata(pdev, ssbi);
type = of_get_property(np, "qcom,controller-type", NULL);