svn commit: r261842 - in head/sys: conf dev/gpio

Luiz Otavio O Souza loos.br at gmail.com
Fri Feb 14 18:40:04 UTC 2014


On Feb 13, 2014, at 6:59 PM, Nathan Whitehorn <nwhitehorn at freebsd.org> wrote:
> On 02/13/14 11:08, Luiz Otavio O Souza wrote:
>> Author: loos
>> Date: Thu Feb 13 17:08:29 2014
>> New Revision: 261842
>> URL: http://svnweb.freebsd.org/changeset/base/261842
>> 
>> Log:
>>   Add an OFW GPIO compatible bus.  This allows the use of the DTS files to
>>   describe GPIO bindings in the system.
>>      Move the GPIOBUS lock macros to gpiobusvar.h as they are now shared between
>>   the OFW and the non OFW versions of GPIO bus.
>>      Export gpiobus_print_pins() so it can also be used on the OFW GPIO bus.
>>      Approved by:	adrian (mentor, implicit)
>> 
>> Added:
>>   head/sys/dev/gpio/ofw_gpiobus.c   (contents, props changed)
>> Modified:
>>   head/sys/conf/files
>>   head/sys/dev/gpio/gpiobus.c
>>   head/sys/dev/gpio/gpiobusvar.h
>> 
>> 
>> 
>> Added: head/sys/dev/gpio/ofw_gpiobus.c
>> ==============================================================================
>> --- /dev/null	00:00:00 1970	(empty, because file is newly added)
>> +++ head/sys/dev/gpio/ofw_gpiobus.c	Thu Feb 13 17:08:29 2014	(r261842)
>> @@ -0,0 +1,338 @@
>> +/*-
>> + * Copyright (c) 2009, Nathan Whitehorn <nwhitehorn at FreeBSD.org>
>> + * Copyright (c) 2013, Luiz Otavio O Souza <loos at FreeBSD.org>
>> + * Copyright (c) 2013 The FreeBSD Foundation
>> + * All rights reserved.
>> + *
>> + * Redistribution and use in source and binary forms, with or without
>> + * modification, are permitted provided that the following conditions
>> + * are met:
>> + * 1. Redistributions of source code must retain the above copyright
>> + *    notice unmodified, this list of conditions, and the following
>> + *    disclaimer.
>> + * 2. Redistributions in binary form must reproduce the above copyright
>> + *    notice, this list of conditions and the following disclaimer in the
>> + *    documentation and/or other materials provided with the distribution.
>> + *
>> + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
>> + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
>> + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
>> + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
>> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
>> + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
>> + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
>> + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
>> + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
>> + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
>> + */
>> +
>> +#include <sys/cdefs.h>
>> +__FBSDID("$FreeBSD$");
>> +
>> +#include <sys/param.h>
>> +#include <sys/bus.h>
>> +#include <sys/gpio.h>
>> +#include <sys/kernel.h>
>> +#include <sys/libkern.h>
>> +#include <sys/lock.h>
>> +#include <sys/module.h>
>> +#include <sys/mutex.h>
>> +
>> +#include <dev/fdt/fdt_common.h>
>> +#include <dev/gpio/gpiobusvar.h>
>> +#include <dev/ofw/ofw_bus.h>
>> +#include <dev/ofw/openfirm.h>
>> +
>> 
> 
> is there a reason you include fdt_common.h here? Nothing here seems to be FDT specific, rather than for Open Firmware generally.
> -Nathan

oops. It was used with fdt_is_enabled() to verify if the child device was enabled, but it was removed in the last update of the code. This is a leftover from this update.

I’ll check if it is okay to remove it and commit the fix.

Thanks for point that out.

Luiz


More information about the svn-src-all mailing list