Skip to content

Commit 78366e9

Browse files
paliUlf Hansson
authored andcommitted
mmc: sdio: Parse CISTPL_VERS_1 major and minor revision numbers
They should indicate compliance of standard. Signed-off-by: Pali Rohár <pali@kernel.org> Link: https://lore.kernel.org/r/20200727133837.19086-3-pali@kernel.org Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent 8ebe260 commit 78366e9

3 files changed

Lines changed: 12 additions & 0 deletions

File tree

‎drivers/mmc/core/sdio_cis.c‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,16 @@
2323
static int cistpl_vers_1(struct mmc_card *card, struct sdio_func *func,
2424
const unsigned char *buf, unsigned size)
2525
{
26+
u8 major_rev, minor_rev;
2627
unsigned i, nr_strings;
2728
char **buffer, *string;
2829

2930
if (size < 2)
3031
return 0;
3132

33+
major_rev = buf[0];
34+
minor_rev = buf[1];
35+
3236
/* Find all null-terminated (including zero length) strings in
3337
the TPLLV1_INFO field. Trailing garbage is ignored. */
3438
buf += 2;
@@ -60,9 +64,13 @@ static int cistpl_vers_1(struct mmc_card *card, struct sdio_func *func,
6064
}
6165

6266
if (func) {
67+
func->major_rev = major_rev;
68+
func->minor_rev = minor_rev;
6369
func->num_info = nr_strings;
6470
func->info = (const char**)buffer;
6571
} else {
72+
card->major_rev = major_rev;
73+
card->minor_rev = minor_rev;
6674
card->num_info = nr_strings;
6775
card->info = (const char**)buffer;
6876
}

‎include/linux/mmc/card.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,8 @@ struct mmc_card {
297297
struct sdio_cis cis; /* common tuple info */
298298
struct sdio_func *sdio_func[SDIO_MAX_FUNCS]; /* SDIO functions (devices) */
299299
struct sdio_func *sdio_single_irq; /* SDIO function when only one IRQ active */
300+
u8 major_rev; /* major revision number */
301+
u8 minor_rev; /* minor revision number */
300302
unsigned num_info; /* number of info strings */
301303
const char **info; /* info strings */
302304
struct sdio_func_tuple *tuples; /* unknown common tuples */

‎include/linux/mmc/sdio_func.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ struct sdio_func {
5151

5252
u8 *tmpbuf; /* DMA:able scratch buffer */
5353

54+
u8 major_rev; /* major revision number */
55+
u8 minor_rev; /* minor revision number */
5456
unsigned num_info; /* number of info strings */
5557
const char **info; /* info strings */
5658

0 commit comments

Comments
 (0)