aboutsummaryrefslogtreecommitdiff
path: root/sys/arm/broadcom/bcm2835/bcm2835_fbd.c
diff options
context:
space:
mode:
authorAleksandr Rybalko <ray@FreeBSD.org>2013-12-17 15:34:38 +0000
committerAleksandr Rybalko <ray@FreeBSD.org>2013-12-17 15:34:38 +0000
commit86b04d42ec2627b9082ff1d34ca11d499383d223 (patch)
treea406627ff7d9761dc310556c02bfc2387b59e7e2 /sys/arm/broadcom/bcm2835/bcm2835_fbd.c
parent0f705e869b25fae6a4d551dd2a252b3a0571ed34 (diff)
downloadsrc-86b04d42ec2627b9082ff1d34ca11d499383d223.tar.gz
src-86b04d42ec2627b9082ff1d34ca11d499383d223.zip
Fix copyright and some style(9) things.
Sponsored by: The FreeBSD Foundation
Notes
Notes: svn path=/head/; revision=259518
Diffstat (limited to 'sys/arm/broadcom/bcm2835/bcm2835_fbd.c')
-rw-r--r--sys/arm/broadcom/bcm2835/bcm2835_fbd.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/sys/arm/broadcom/bcm2835/bcm2835_fbd.c b/sys/arm/broadcom/bcm2835/bcm2835_fbd.c
index c5e6c77a2e52..60a05631f2a9 100644
--- a/sys/arm/broadcom/bcm2835/bcm2835_fbd.c
+++ b/sys/arm/broadcom/bcm2835/bcm2835_fbd.c
@@ -1,7 +1,11 @@
/*-
* Copyright (c) 2012 Oleksandr Tymoshenko <gonzo@freebsd.org>
+ * Copyright (c) 2012, 2013 The FreeBSD Foundation
* All rights reserved.
*
+ * Portions of this software were developed by Oleksandr Rybalko
+ * under sponsorship from the FreeBSD Foundation.
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -99,13 +103,14 @@ struct bcmsc_softc {
static int bcm_fb_probe(device_t);
static int bcm_fb_attach(device_t);
-static void bcm_fb_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nseg, int err);
+static void bcm_fb_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nseg,
+ int err);
static void
bcm_fb_init(void *arg)
{
- struct bcmsc_softc *sc = arg;
- volatile struct bcm_fb_config* fb_config = sc->fb_config;
+ volatile struct bcm_fb_config *fb_config;
+ struct bcmsc_softc *sc;
struct fb_info *info;
phandle_t node;
pcell_t cell;
@@ -113,6 +118,8 @@ bcm_fb_init(void *arg)
device_t fbd;
int err = 0;
+ sc = arg;
+ fb_config = sc->fb_config;
node = ofw_bus_get_node(sc->dev);
fb_config->xres = 0;
@@ -153,23 +160,25 @@ bcm_fb_init(void *arg)
BUS_DMASYNC_POSTREAD);
if (fb_config->base != 0) {
- device_printf(sc->dev, "%dx%d(%dx%d@%d,%d) %dbpp\n",
+ device_printf(sc->dev, "%dx%d(%dx%d@%d,%d) %dbpp\n",
fb_config->xres, fb_config->yres,
fb_config->vxres, fb_config->vyres,
fb_config->xoffset, fb_config->yoffset,
fb_config->bpp);
- device_printf(sc->dev, "pitch %d, base 0x%08x, screen_size %d\n",
+ device_printf(sc->dev, "pitch %d, base 0x%08x, screen_size %d\n",
fb_config->pitch, fb_config->base,
fb_config->screen_size);
- info = malloc(sizeof(struct fb_info), M_DEVBUF, M_WAITOK | M_ZERO);
+ info = malloc(sizeof(struct fb_info), M_DEVBUF,
+ M_WAITOK | M_ZERO);
info->fb_name = device_get_nameunit(sc->dev);
- info->fb_vbase = (intptr_t)pmap_mapdev(fb_config->base, fb_config->screen_size);
+ info->fb_vbase = (intptr_t)pmap_mapdev(fb_config->base,
+ fb_config->screen_size);
info->fb_pbase = fb_config->base;
info->fb_size = fb_config->screen_size;
info->fb_bpp = info->fb_depth = fb_config->bpp;
@@ -179,7 +188,8 @@ bcm_fb_init(void *arg)
sc->info = info;
- fbd = device_add_child(sc->dev, "fbd", device_get_unit(sc->dev));
+ fbd = device_add_child(sc->dev, "fbd",
+ device_get_unit(sc->dev));
if (fbd == NULL) {
device_printf(sc->dev, "Failed to add fbd child\n");
return;
@@ -244,8 +254,8 @@ bcm_fb_attach(device_t dev)
goto fail;
}
- /*
- * We have to wait until interrupts are enabled.
+ /*
+ * We have to wait until interrupts are enabled.
* Mailbox relies on it to get data from VideoCore
*/
sc->init_hook.ich_func = bcm_fb_init;