| // Copyright 2024 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| struct mmc; |
| |
| /** |
| * aml_sd_poll_io() - Polls and updates the status of an IO transaction. |
| * |
| * @mmc: The pointer to `struct mmc`. |
| * Return: 0 if no error, error code otherwise. |
| */ |
| int aml_sd_poll_io(struct mmc *mmc); |
| |
| /** |
| * aml_sd_read_async() - Reads the eMMC devices. |
| * |
| * @mmc: The pointer to `struct mmc`. |
| * @blk_off: Offset in number of blocks. |
| * @blk_cnt: Size in number of block. |
| * @buffer: Address of the IO buffer. |
| * Return: 0 if no error, error code otherwise. |
| */ |
| int aml_sd_read_async(struct mmc *mmc, unsigned long blk_off, |
| unsigned long blk_cnt, void *buffer); |
| |
| /** |
| * aml_sd_write_async() - Writes the eMMC device. |
| * |
| * @mmc: The pointer to `struct mmc`. |
| * @blk_off: Offset in number of blocks. |
| * @blk_cnt: Size in number of block. |
| * @buffer: Address of the IO buffer. |
| * Return: 0 if no error, error code otherwise. |
| */ |
| int aml_sd_write_async(struct mmc *mmc, unsigned long blk_off, |
| unsigned long blk_cnt, const void *buffer); |
| |
| /** |
| * aml_sd_sync() - Syncs the eMMC device. |
| * |
| * @mmc: The pointer to `struct mmc`. |
| * Return: 0 if no error, error code otherwise. |
| */ |
| int aml_sd_sync(struct mmc *mmc); |
| |
| /** |
| * aml_sd_is_busy() - Checks if the eMMC device is busy. |
| * |
| * @mmc: The pointer to `struct mmc`. |
| * Return: True if busy. |
| */ |
| bool aml_sd_is_busy(struct mmc *mmc); |
| |
| /** |
| * is_aml_sd_mmc() - Checks if the eMMC device is a Amlogic SD. |
| * |
| * @mmc: The pointer to `struct mmc`. |
| * Return: True if it is. |
| */ |
| bool is_aml_sd_mmc(struct mmc *mmc); |