ARM64: firefly: Add rk3399-firefly board support
[firefly-linux-kernel-4.4.55.git] / drivers / mmc / card / queue.h
index 1dc4c99f52a17585f67820d428001a8ae6f7bb14..bd0274e814c33d17cdfe3feb2dc23645837f2e30 100644 (file)
@@ -68,6 +68,42 @@ struct mmc_queue {
 #endif
 };
 
+/*
+ * There is one mmc_blk_data per slot.
+ */
+struct mmc_blk_data {
+       spinlock_t      lock;
+       struct gendisk  *disk;
+       struct mmc_queue queue;
+       struct list_head part;
+
+       unsigned int    flags;
+#define MMC_BLK_CMD23  (1 << 0)        /* Can do SET_BLOCK_COUNT for multiblock */
+#define MMC_BLK_REL_WR (1 << 1)        /* MMC Reliable write support */
+#define MMC_BLK_PACKED_CMD     (1 << 2)        /* MMC packed command support */
+
+       unsigned int    usage;
+       unsigned int    read_only;
+       unsigned int    part_type;
+       unsigned int    name_idx;
+       unsigned int    reset_done;
+#define MMC_BLK_READ           BIT(0)
+#define MMC_BLK_WRITE          BIT(1)
+#define MMC_BLK_DISCARD                BIT(2)
+#define MMC_BLK_SECDISCARD     BIT(3)
+#define MMC_BLK_RPMB            BIT(4)
+
+       /*
+        * Only set in main mmc_blk_data associated
+        * with mmc_card with mmc_set_drvdata, and keeps
+        * track of the current selected device partition.
+        */
+       unsigned int    part_curr;
+       struct device_attribute force_ro;
+       struct device_attribute power_ro_lock;
+       int     area_type;
+};
+
 extern int mmc_init_queue(struct mmc_queue *, struct mmc_card *, spinlock_t *,
                          const char *);
 extern void mmc_cleanup_queue(struct mmc_queue *);
@@ -83,5 +119,7 @@ extern int mmc_packed_init(struct mmc_queue *, struct mmc_card *);
 extern void mmc_packed_clean(struct mmc_queue *);
 
 extern int mmc_access_rpmb(struct mmc_queue *);
+void mmc_blk_emmc_remove(struct mmc_card *card);
+void mmc_blk_emmc_add(struct mmc_card *card, size_t data_size);
 
 #endif