Private
Public Access
2
0

mmap: remove implementation of mmap gpio

Instead of trying to have an implementation that covers most platforms
Leave all mmap up to platform definition. Through function pointers.

gpio_mmap_setup sets up the mmap

Within the internal gpio context struct two more function pointers now
exist mmap_read & mmap_write. They exist there so each context can its
own function for handling a write and read.

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
This commit is contained in:
Thomas Ingleby
2014-11-07 02:02:29 +00:00
parent d1f9e98060
commit 3865bebe8d
5 changed files with 13 additions and 95 deletions

View File

@@ -264,25 +264,6 @@ mraa_pin_mode_test(int pin, mraa_pinmodes_t mode)
return 0;
}
mraa_mmap_pin_t*
mraa_setup_mmap_gpio(int pin)
{
if (plat == NULL)
return NULL;
if (plat->pins[pin].capabilites.fast_gpio != 1)
return NULL;
if (plat->pins[pin].mmap.gpio.mux_total > 0)
if (mraa_setup_mux_mapped(plat->pins[pin].mmap.gpio) != MRAA_SUCCESS)
return NULL;
if (mraa_setup_mux_mapped(plat->pins[pin].mmap.gpio) != MRAA_SUCCESS)
return NULL;
mraa_mmap_pin_t *ret = &(plat->pins[pin].mmap);
return ret;
}
mraa_platform_t mraa_get_platform_type()
{
return platform_type;