From: Pan Li <incarnation.p.lee@xxxxxxxxxxx> Add tcpci_write16_le for pd_message header type __le16. Signed-off-by: Pan Li <incarnation.p.lee@xxxxxxxxxxx> --- drivers/staging/typec/tcpci.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/staging/typec/tcpci.c b/drivers/staging/typec/tcpci.c index 8da4a38..5c3d91b 100644 --- a/drivers/staging/typec/tcpci.c +++ b/drivers/staging/typec/tcpci.c @@ -62,6 +62,11 @@ static int tcpci_write16(struct tcpci *tcpci, unsigned int reg, u16 val) return regmap_raw_write(tcpci->regmap, reg, &val, sizeof(u16)); } +static int tcpci_write16_le(struct tcpci *tcpci, unsigned int reg, __le16 val) +{ + return regmap_raw_write(tcpci->regmap, reg, &val, sizeof(__le16)); +} + static int tcpci_set_cc(struct tcpc_dev *tcpc, enum typec_cc_status cc) { struct tcpci *tcpci = tcpc_to_tcpci(tcpc); @@ -289,7 +294,8 @@ static int tcpci_pd_transmit(struct tcpc_dev *tcpc, const struct pd_message *msg) { struct tcpci *tcpci = tcpc_to_tcpci(tcpc); - unsigned int reg, cnt, header; + unsigned int reg, cnt; + __le16 header; int ret; cnt = msg ? pd_header_cnt_le(msg->header) * 4 : 0; @@ -298,7 +304,7 @@ static int tcpci_pd_transmit(struct tcpc_dev *tcpc, return ret; header = msg ? msg->header : 0; - ret = tcpci_write16(tcpci, TCPC_TX_HDR, header); + ret = tcpci_write16_le(tcpci, TCPC_TX_HDR, header); if (ret < 0) return ret; -- 1.9.1 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel