Lines Matching refs:mmc

76 static int mmc_set_blockcount(struct mmc *mmc, unsigned int blockcount,  in mmc_set_blockcount()  argument
87 return mmc_send_cmd(mmc, &cmd, NULL); in mmc_set_blockcount()
89 static int mmc_rpmb_request(struct mmc *mmc, const struct s_rpmb *s, in mmc_rpmb_request() argument
96 ret = mmc_set_blockcount(mmc, count, is_rel_write); in mmc_rpmb_request()
113 ret = mmc_send_cmd(mmc, &cmd, &data); in mmc_rpmb_request()
122 static int mmc_rpmb_response(struct mmc *mmc, struct s_rpmb *s, in mmc_rpmb_response() argument
129 ret = mmc_set_blockcount(mmc, 1, false); in mmc_rpmb_response()
145 ret = mmc_send_cmd(mmc, &cmd, &data); in mmc_rpmb_response()
170 static int mmc_rpmb_status(struct mmc *mmc, unsigned short expected) in mmc_rpmb_status() argument
176 if (mmc_rpmb_request(mmc, rpmb_frame, 1, false)) in mmc_rpmb_status()
180 return mmc_rpmb_response(mmc, rpmb_frame, expected); in mmc_rpmb_status()
226 int mmc_rpmb_get_counter(struct mmc *mmc, unsigned long *pcounter) in mmc_rpmb_get_counter() argument
234 if (mmc_rpmb_request(mmc, rpmb_frame, 1, false)) in mmc_rpmb_get_counter()
238 ret = mmc_rpmb_response(mmc, rpmb_frame, RPMB_RESP_WCOUNTER); in mmc_rpmb_get_counter()
245 int mmc_rpmb_set_key(struct mmc *mmc, void *key) in mmc_rpmb_set_key() argument
253 if (mmc_rpmb_request(mmc, rpmb_frame, 1, true)) in mmc_rpmb_set_key()
257 return mmc_rpmb_status(mmc, RPMB_RESP_KEY); in mmc_rpmb_set_key()
259 int mmc_rpmb_read(struct mmc *mmc, void *addr, unsigned short blk, in mmc_rpmb_read() argument
270 if (mmc_rpmb_request(mmc, rpmb_frame, 1, false)) in mmc_rpmb_read()
274 if (mmc_rpmb_response(mmc, rpmb_frame, RPMB_RESP_READ_DATA)) in mmc_rpmb_read()
292 int mmc_rpmb_write(struct mmc *mmc, void *addr, unsigned short blk, in mmc_rpmb_write() argument
300 if (mmc_rpmb_get_counter(mmc, &wcount)) { in mmc_rpmb_write()
315 if (mmc_rpmb_request(mmc, rpmb_frame, 1, true)) in mmc_rpmb_write()
319 if (mmc_rpmb_status(mmc, RPMB_RESP_WRITE_DATA)) in mmc_rpmb_write()