Skip to contentSkip to conversation

IIO: ak8975: Why adding OF compatible string without vendor prefix?

DISCUSSION Axel Lin 2 participants 2 messages Aug 31, 2015 IIO

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

Hi,
I just found the ak8975_of_match table has compatible string without vendor prefix.

static const struct of_device_id ak8975_of_match[] = {
        { .compatible = "asahi-kasei,ak8975", },
        { .compatible = "ak8975", },
        { .compatible = "asahi-kasei,ak8963", },
        { .compatible = "ak8963", },
        { .compatible = "asahi-kasei,ak09911", },
        { .compatible = "ak09911", },
        { .compatible = "asahi-kasei,ak09912", },
        { .compatible = "ak09912", },
        {}
};

This seems unusual, just curious why below compatible strings are required?

        { .compatible = "ak8975", },
        { .compatible = "ak8963", },
        { .compatible = "ak09911", },
        { .compatible = "ak09912", },

Regards,
Axel

maintainer
#1 lore raw
Quoted 16 lines · Axel Lin

Hi,
I just found the ak8975_of_match table has compatible string without vendor prefix.

static const struct of_device_id ak8975_of_match[] = {
        { .compatible = "asahi-kasei,ak8975", },
        { .compatible = "ak8975", },
        { .compatible = "asahi-kasei,ak8963", },
        { .compatible = "ak8963", },
        { .compatible = "asahi-kasei,ak09911", },
        { .compatible = "ak09911", },
        { .compatible = "asahi-kasei,ak09912", },
        { .compatible = "ak09912", },
        {}
};
Quoted 9 lines

This seems unusual, just curious why below compatible strings are required?

        { .compatible = "ak8975", },
        { .compatible = "ak8963", },
        { .compatible = "ak09911", },
        { .compatible = "ak09912", },

Regards,
Axel

This is an historical artefact. I2C (and for that matter SPI) subsystems handled device tree registration in their cores. Unfortunately they did it by matching against the registered driver names and those don't include vendors.

This is still being unwound, but the upshot is that we have boards with device trees out in the wild using the version without a vendor string. Hence for backwards compatibility, both need to be in the table.

Jonathan