diff options
Diffstat (limited to 'drivers/gpio/gpio-mcp23s08.c')
-rw-r--r-- | drivers/gpio/gpio-mcp23s08.c | 41 |
1 files changed, 34 insertions, 7 deletions
diff --git a/drivers/gpio/gpio-mcp23s08.c b/drivers/gpio/gpio-mcp23s08.c index d96bf8a76f5c..2deb0c5e54a4 100644 --- a/drivers/gpio/gpio-mcp23s08.c +++ b/drivers/gpio/gpio-mcp23s08.c | |||
@@ -483,10 +483,21 @@ fail: | |||
483 | #ifdef CONFIG_SPI_MASTER | 483 | #ifdef CONFIG_SPI_MASTER |
484 | static struct of_device_id mcp23s08_spi_of_match[] = { | 484 | static struct of_device_id mcp23s08_spi_of_match[] = { |
485 | { | 485 | { |
486 | .compatible = "mcp,mcp23s08", .data = (void *) MCP_TYPE_S08, | 486 | .compatible = "microchip,mcp23s08", |
487 | .data = (void *) MCP_TYPE_S08, | ||
487 | }, | 488 | }, |
488 | { | 489 | { |
489 | .compatible = "mcp,mcp23s17", .data = (void *) MCP_TYPE_S17, | 490 | .compatible = "microchip,mcp23s17", |
491 | .data = (void *) MCP_TYPE_S17, | ||
492 | }, | ||
493 | /* NOTE: The use of the mcp prefix is deprecated and will be removed. */ | ||
494 | { | ||
495 | .compatible = "mcp,mcp23s08", | ||
496 | .data = (void *) MCP_TYPE_S08, | ||
497 | }, | ||
498 | { | ||
499 | .compatible = "mcp,mcp23s17", | ||
500 | .data = (void *) MCP_TYPE_S17, | ||
490 | }, | 501 | }, |
491 | { }, | 502 | { }, |
492 | }; | 503 | }; |
@@ -496,10 +507,21 @@ MODULE_DEVICE_TABLE(of, mcp23s08_spi_of_match); | |||
496 | #if IS_ENABLED(CONFIG_I2C) | 507 | #if IS_ENABLED(CONFIG_I2C) |
497 | static struct of_device_id mcp23s08_i2c_of_match[] = { | 508 | static struct of_device_id mcp23s08_i2c_of_match[] = { |
498 | { | 509 | { |
499 | .compatible = "mcp,mcp23008", .data = (void *) MCP_TYPE_008, | 510 | .compatible = "microchip,mcp23008", |
511 | .data = (void *) MCP_TYPE_008, | ||
512 | }, | ||
513 | { | ||
514 | .compatible = "microchip,mcp23017", | ||
515 | .data = (void *) MCP_TYPE_017, | ||
500 | }, | 516 | }, |
517 | /* NOTE: The use of the mcp prefix is deprecated and will be removed. */ | ||
501 | { | 518 | { |
502 | .compatible = "mcp,mcp23017", .data = (void *) MCP_TYPE_017, | 519 | .compatible = "mcp,mcp23008", |
520 | .data = (void *) MCP_TYPE_008, | ||
521 | }, | ||
522 | { | ||
523 | .compatible = "mcp,mcp23017", | ||
524 | .data = (void *) MCP_TYPE_017, | ||
503 | }, | 525 | }, |
504 | { }, | 526 | { }, |
505 | }; | 527 | }; |
@@ -620,10 +642,15 @@ static int mcp23s08_probe(struct spi_device *spi) | |||
620 | if (match) { | 642 | if (match) { |
621 | type = (int)match->data; | 643 | type = (int)match->data; |
622 | status = of_property_read_u32(spi->dev.of_node, | 644 | status = of_property_read_u32(spi->dev.of_node, |
623 | "mcp,spi-present-mask", &spi_present_mask); | 645 | "microchip,spi-present-mask", &spi_present_mask); |
624 | if (status) { | 646 | if (status) { |
625 | dev_err(&spi->dev, "DT has no spi-present-mask\n"); | 647 | status = of_property_read_u32(spi->dev.of_node, |
626 | return -ENODEV; | 648 | "mcp,spi-present-mask", &spi_present_mask); |
649 | if (status) { | ||
650 | dev_err(&spi->dev, | ||
651 | "DT has no spi-present-mask\n"); | ||
652 | return -ENODEV; | ||
653 | } | ||
627 | } | 654 | } |
628 | if ((spi_present_mask <= 0) || (spi_present_mask >= 256)) { | 655 | if ((spi_present_mask <= 0) || (spi_present_mask >= 256)) { |
629 | dev_err(&spi->dev, "invalid spi-present-mask\n"); | 656 | dev_err(&spi->dev, "invalid spi-present-mask\n"); |