linux/drivers/gpio/gpio-hlwd.c

// SPDX-License-Identifier: GPL-2.0+
// Copyright (C) 2008-2009 The GameCube Linux Team
// Copyright (C) 2008,2009 Albert Herranz
// Copyright (C) 2017-2018 Jonathan Neuschäfer
//
// Nintendo Wii (Hollywood) GPIO driver

#include <linux/gpio/driver.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/seq_file.h>
#include <linux/slab.h>

/*
 * Register names and offsets courtesy of WiiBrew:
 * https://wiibrew.org/wiki/Hardware/Hollywood_GPIOs
 *
 * Note that for most registers, there are two versions:
 * - HW_GPIOB_* Is always accessible by the Broadway PowerPC core, but does
 *   always give access to all GPIO lines
 * - HW_GPIO_* Is only accessible by the Broadway PowerPC code if the memory
 *   firewall (AHBPROT) in the Hollywood chipset has been configured to allow
 *   such access.
 *
 * The ownership of each GPIO line can be configured in the HW_GPIO_OWNER
 * register: A one bit configures the line for access via the HW_GPIOB_*
 * registers, a zero bit indicates access via HW_GPIO_*. This driver uses
 * HW_GPIOB_*.
 */
#define HW_GPIOB_OUT
#define HW_GPIOB_DIR
#define HW_GPIOB_IN
#define HW_GPIOB_INTLVL
#define HW_GPIOB_INTFLAG
#define HW_GPIOB_INTMASK
#define HW_GPIOB_INMIR
#define HW_GPIO_ENABLE
#define HW_GPIO_OUT
#define HW_GPIO_DIR
#define HW_GPIO_IN
#define HW_GPIO_INTLVL
#define HW_GPIO_INTFLAG
#define HW_GPIO_INTMASK
#define HW_GPIO_INMIR
#define HW_GPIO_OWNER

struct hlwd_gpio {};

static void hlwd_gpio_irqhandler(struct irq_desc *desc)
{}

static void hlwd_gpio_irq_ack(struct irq_data *data)
{}

static void hlwd_gpio_irq_mask(struct irq_data *data)
{}

static void hlwd_gpio_irq_unmask(struct irq_data *data)
{}

static void hlwd_gpio_irq_enable(struct irq_data *data)
{}

static void hlwd_gpio_irq_setup_emulation(struct hlwd_gpio *hlwd, int hwirq,
					  unsigned int flow_type)
{}

static int hlwd_gpio_irq_set_type(struct irq_data *data, unsigned int flow_type)
{}

static void hlwd_gpio_irq_print_chip(struct irq_data *data, struct seq_file *p)
{}

static const struct irq_chip hlwd_gpio_irq_chip =;

static int hlwd_gpio_probe(struct platform_device *pdev)
{}

static const struct of_device_id hlwd_gpio_match[] =;
MODULE_DEVICE_TABLE(of, hlwd_gpio_match);

static struct platform_driver hlwd_gpio_driver =;
module_platform_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();