Quelle  at91-usart.c   Sprache: C

 
// SPDX-License-Identifier: GPL-2.0
/*
 * Driver for AT91 USART
 *
 * Copyright (C) 2018 Microchip Technology
 *
 * Author: Radu Pirea <radu.pirea@microchip.com>
 *
 */


#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 const struct mfd_cell at91_usart_spi_subdev =
 MFD_CELL_NAME("at91_usart_spi");

static const struct mfd_cell at91_usart_serial_subdev =
 MFD_CELL_NAME("atmel_usart_serial");

static int at91_usart_mode_probe(struct platform_device *pdev)
{
 const 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 ");
MODULE_DESCRIPTION("AT91 USART MFD driver");
MODULE_LICENSE("GPL v2");

Messung V0.5
C=96 H=100 G=97

¤ Dauer der Verarbeitung: 0.14 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge