diff mbox series

[v42,10/98] hw/sd/sdcard: Assign SDCardStates enum values

Message ID 20240628070216.92609-11-philmd@linaro.org (mailing list archive)
State New, archived
Headers show
Series hw/sd/sdcard: Add eMMC support | expand

Commit Message

Philippe Mathieu-Daudé June 28, 2024, 7 a.m. UTC
SDCardStates enum values are specified, so assign them
correspondingly. It will be useful later when we add
states from later specs, which might not be continuous.

See CURRENT_STATE bits in section 4.10.1 "Card Status".

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Tested-by: Cédric Le Goater <clg@redhat.com>
---
 hw/sd/sd.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

Comments

Cédric Le Goater June 28, 2024, 7:29 a.m. UTC | #1
On 6/28/24 9:00 AM, Philippe Mathieu-Daudé wrote:
> SDCardStates enum values are specified, so assign them
> correspondingly. It will be useful later when we add
> states from later specs, which might not be continuous.
> 
> See CURRENT_STATE bits in section 4.10.1 "Card Status".
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Tested-by: Cédric Le Goater <clg@redhat.com>


Reviewed-by: Cédric Le Goater <clg@redhat.com>

Thanks,

C.


> ---
>   hw/sd/sd.c | 20 ++++++++++----------
>   1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/hw/sd/sd.c b/hw/sd/sd.c
> index 135b7d2e23..fbdfafa3a6 100644
> --- a/hw/sd/sd.c
> +++ b/hw/sd/sd.c
> @@ -75,16 +75,16 @@ enum SDCardModes {
>   };
>   
>   enum SDCardStates {
> -    sd_inactive_state = -1,
> -    sd_idle_state = 0,
> -    sd_ready_state,
> -    sd_identification_state,
> -    sd_standby_state,
> -    sd_transfer_state,
> -    sd_sendingdata_state,
> -    sd_receivingdata_state,
> -    sd_programming_state,
> -    sd_disconnect_state,
> +    sd_inactive_state       = -1,
> +    sd_idle_state           = 0,
> +    sd_ready_state          = 1,
> +    sd_identification_state = 2,
> +    sd_standby_state        = 3,
> +    sd_transfer_state       = 4,
> +    sd_sendingdata_state    = 5,
> +    sd_receivingdata_state  = 6,
> +    sd_programming_state    = 7,
> +    sd_disconnect_state     = 8,
>   };
>   
>   typedef sd_rsp_type_t (*sd_cmd_handler)(SDState *sd, SDRequest req);
diff mbox series

Patch

diff --git a/hw/sd/sd.c b/hw/sd/sd.c
index 135b7d2e23..fbdfafa3a6 100644
--- a/hw/sd/sd.c
+++ b/hw/sd/sd.c
@@ -75,16 +75,16 @@  enum SDCardModes {
 };
 
 enum SDCardStates {
-    sd_inactive_state = -1,
-    sd_idle_state = 0,
-    sd_ready_state,
-    sd_identification_state,
-    sd_standby_state,
-    sd_transfer_state,
-    sd_sendingdata_state,
-    sd_receivingdata_state,
-    sd_programming_state,
-    sd_disconnect_state,
+    sd_inactive_state       = -1,
+    sd_idle_state           = 0,
+    sd_ready_state          = 1,
+    sd_identification_state = 2,
+    sd_standby_state        = 3,
+    sd_transfer_state       = 4,
+    sd_sendingdata_state    = 5,
+    sd_receivingdata_state  = 6,
+    sd_programming_state    = 7,
+    sd_disconnect_state     = 8,
 };
 
 typedef sd_rsp_type_t (*sd_cmd_handler)(SDState *sd, SDRequest req);