#define SPMI_APB_SPMI_CMD_EN BIT(31)
#define SPMI_APB_SPMI_CMD_TYPE_OFFSET 24
#define SPMI_APB_SPMI_CMD_LENGTH_OFFSET 20
-
#define SPMI_APB_SPMI_CMD_SLAVEID_OFFSET 16
#define SPMI_APB_SPMI_CMD_ADDR_OFFSET 0
}
static int spmi_read_cmd(struct spmi_controller *ctrl,
- u8 opc, u8 sid, u16 addr, u8 *buf, size_t bc)
+ u8 opc, u8 sid, u16 addr, u8 *__buf, size_t bc)
{
struct spmi_controller_dev *spmi_controller = dev_get_drvdata(&ctrl->dev);
unsigned long flags;
+ u8 *buf = __buf;
u32 cmd, data;
int rc;
u32 chnl_ofst = SPMI_CHANNEL_OFFSET * spmi_controller->channel;
if (rc)
dev_err(spmi_controller->dev, "spmi read wait timeout op:0x%x sid:%d addr:0x%x bc:%ld\n",
opc, sid, addr, bc + 1);
+ else
+ dev_dbg(spmi_controller->dev, "%s: id:%d addr:0x%x, read value: %*ph\n",
+ __func__, sid, addr, (int)bc, __buf);
+
return rc;
}
static int spmi_write_cmd(struct spmi_controller *ctrl,
- u8 opc, u8 sid, u16 addr, const u8 *buf, size_t bc)
+ u8 opc, u8 sid, u16 addr, const u8 *__buf, size_t bc)
{
struct spmi_controller_dev *spmi_controller = dev_get_drvdata(&ctrl->dev);
+ const u8 *buf = __buf;
unsigned long flags;
u32 cmd, data;
int rc;
if (rc)
dev_err(spmi_controller->dev, "spmi write wait timeout op:0x%x sid:%d addr:0x%x bc:%ld\n",
opc, sid, addr, bc);
+ else
+ dev_dbg(spmi_controller->dev, "%s: id:%d addr:0x%x, wrote value: %*ph\n",
+ __func__, sid, addr, (int)bc, __buf);
return rc;
}
int ret = 0;
dev_info(&pdev->dev, "HISI SPMI probe\n");
+
ctrl = spmi_controller_alloc(&pdev->dev, sizeof(*spmi_controller));
if (!ctrl) {
dev_err(&pdev->dev, "can not allocate spmi_controller data\n");