forked from analogdevicesinc/linux
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branches 'ib-mfd-iio-input-4.20', 'ib-mfd-irqchip-4.20', 'ib-mf…
…d-rtc-4.20' and 'ib-mfd-spi-tty-4.20-1' into ibs-for-mfd-merged
- Loading branch information
Showing
13 changed files
with
618 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9502,6 +9502,7 @@ M: Richard Genoud <[email protected]> | |
S: Maintained | ||
F: drivers/tty/serial/atmel_serial.c | ||
F: drivers/tty/serial/atmel_serial.h | ||
F: Documentation/devicetree/bindings/mfd/atmel-usart.txt | ||
|
||
MICROCHIP / ATMEL DMA DRIVER | ||
M: Ludovic Desroches <[email protected]> | ||
|
@@ -9533,6 +9534,21 @@ S: Supported | |
F: drivers/mtd/nand/raw/atmel/* | ||
F: Documentation/devicetree/bindings/mtd/atmel-nand.txt | ||
|
||
MICROCHIP AT91 USART MFD DRIVER | ||
M: Radu Pirea <[email protected]> | ||
L: [email protected] | ||
S: Supported | ||
F: drivers/mfd/at91-usart.c | ||
F: include/dt-bindings/mfd/at91-usart.h | ||
F: Documentation/devicetree/bindings/mfd/atmel-usart.txt | ||
|
||
MICROCHIP AT91 USART SPI DRIVER | ||
M: Radu Pirea <[email protected]> | ||
L: [email protected] | ||
S: Supported | ||
F: drivers/spi/spi-at91-usart.c | ||
F: Documentation/devicetree/bindings/mfd/atmel-usart.txt | ||
|
||
MICROCHIP KSZ SERIES ETHERNET SWITCH DRIVER | ||
M: Woojung Huh <[email protected]> | ||
M: Microchip Linux Driver Support <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
// SPDX-License-Identifier: GPL-2.0 | ||
/* | ||
* Driver for AT91 USART | ||
* | ||
* Copyright (C) 2018 Microchip Technology | ||
* | ||
* Author: Radu Pirea <[email protected]> | ||
* | ||
*/ | ||
|
||
#include <dt-bindings/mfd/at91-usart.h> | ||
|
||
#include <linux/module.h> | ||
#include <linux/mfd/core.h> | ||
#include <linux/of.h> | ||
#include <linux/property.h> | ||
|
||
static struct mfd_cell at91_usart_spi_subdev = { | ||
.name = "at91_usart_spi", | ||
.of_compatible = "microchip,at91sam9g45-usart-spi", | ||
}; | ||
|
||
static struct mfd_cell at91_usart_serial_subdev = { | ||
.name = "atmel_usart_serial", | ||
.of_compatible = "atmel,at91rm9200-usart-serial", | ||
}; | ||
|
||
static int at91_usart_mode_probe(struct platform_device *pdev) | ||
{ | ||
struct mfd_cell cell; | ||
u32 opmode = AT91_USART_MODE_SERIAL; | ||
|
||
device_property_read_u32(&pdev->dev, "atmel,usart-mode", &opmode); | ||
|
||
switch (opmode) { | ||
case AT91_USART_MODE_SPI: | ||
cell = at91_usart_spi_subdev; | ||
break; | ||
case AT91_USART_MODE_SERIAL: | ||
cell = at91_usart_serial_subdev; | ||
break; | ||
default: | ||
dev_err(&pdev->dev, "atmel,usart-mode has an invalid value %u\n", | ||
opmode); | ||
return -EINVAL; | ||
} | ||
|
||
return devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO, &cell, 1, | ||
NULL, 0, NULL); | ||
} | ||
|
||
static const struct of_device_id at91_usart_mode_of_match[] = { | ||
{ .compatible = "atmel,at91rm9200-usart" }, | ||
{ .compatible = "atmel,at91sam9260-usart" }, | ||
{ /* sentinel */ } | ||
}; | ||
|
||
MODULE_DEVICE_TABLE(of, at91_usart_mode_of_match); | ||
|
||
static struct platform_driver at91_usart_mfd = { | ||
.probe = at91_usart_mode_probe, | ||
.driver = { | ||
.name = "at91_usart_mode", | ||
.of_match_table = at91_usart_mode_of_match, | ||
}, | ||
}; | ||
|
||
module_platform_driver(at91_usart_mfd); | ||
|
||
MODULE_AUTHOR("Radu Pirea <[email protected]>"); | ||
MODULE_DESCRIPTION("AT91 USART MFD driver"); | ||
MODULE_LICENSE("GPL v2"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.