From owner-p4-projects@FreeBSD.ORG Sun Feb 19 07:24:13 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2E3F216A44C; Sun, 19 Feb 2006 07:24:13 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D766E16A449 for ; Sun, 19 Feb 2006 07:24:12 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 92A4B43D45 for ; Sun, 19 Feb 2006 07:24:12 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k1J7OCPn008104 for ; Sun, 19 Feb 2006 07:24:12 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k1J7OC55008101 for perforce@freebsd.org; Sun, 19 Feb 2006 07:24:12 GMT (envelope-from imp@freebsd.org) Date: Sun, 19 Feb 2006 07:24:12 GMT Message-Id: <200602190724.k1J7OC55008101@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 92028 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Feb 2006 07:24:14 -0000 http://perforce.freebsd.org/chv.cgi?CH=92028 Change 92028 by imp@imp_plunger on 2006/02/19 07:23:11 style nits Affected files ... .. //depot/projects/arm/src/sys/arm/at91/at91_pmc.c#4 edit Differences ... ==== //depot/projects/arm/src/sys/arm/at91/at91_pmc.c#4 (text+ko) ==== @@ -45,7 +45,7 @@ #include #include -static struct at91pmc_softc { +static struct at91_pmc_softc { bus_space_tag_t sc_st; bus_space_handle_t sc_sh; device_t dev; @@ -53,13 +53,13 @@ uint32_t pllb_init; } *pmc_softc; -struct at91pmc_clock +struct at91_pmc_clock { const char *name; uint32_t hz; - struct at91pmc_clock *parent; + struct at91_pmc_clock *parent; uint32_t pmc_mask; - void (*set_mode)(struct at91pmc_clock *, int); + void (*set_mode)(struct at91_pmc_clock *, int); uint32_t refcnt; unsigned id:2; unsigned primary:1; @@ -67,11 +67,11 @@ unsigned programmable:1; }; -static void at91pmc_set_pllb_mode(struct at91pmc_clock *, int); -static void at91pmc_set_sys_mode(struct at91pmc_clock *, int); -static void at91pmc_set_periph_mode(struct at91pmc_clock *, int); +static void at91_pmc_set_pllb_mode(struct at91_pmc_clock *, int); +static void at91_pmc_set_sys_mode(struct at91_pmc_clock *, int); +static void at91_pmc_set_periph_mode(struct at91_pmc_clock *, int); -static struct at91pmc_clock slck = { +static struct at91_pmc_clock slck = { .name = "slck", // 32,768 Hz slow clock .hz = 32768, .refcnt = 1, @@ -79,7 +79,7 @@ .primary = 1, }; -static struct at91pmc_clock main_ck = { +static struct at91_pmc_clock main_ck = { .name = "main", // Main clock .refcnt = 1, .id = 1, @@ -87,7 +87,7 @@ .pmc_mask = PMC_IER_MOSCS, }; -static struct at91pmc_clock plla = { +static struct at91_pmc_clock plla = { .name = "plla", // PLLA Clock, used for CPU clocking .parent = &main_ck, .refcnt = 1, @@ -97,7 +97,7 @@ .pmc_mask = PMC_IER_LOCKA, }; -static struct at91pmc_clock pllb = { +static struct at91_pmc_clock pllb = { .name = "pllb", // PLLB Clock, used for USB functions .parent = &main_ck, .refcnt = 1, @@ -105,44 +105,44 @@ .primary = 1, .pll = 1, .pmc_mask = PMC_IER_LOCKB, - .set_mode = &at91pmc_set_pllb_mode, + .set_mode = &at91_pmc_set_pllb_mode, }; -static struct at91pmc_clock udpck = { +static struct at91_pmc_clock udpck = { .name = "udpck", .parent = &pllb, .pmc_mask = PMC_SCER_UDP, - .set_mode = at91pmc_set_sys_mode + .set_mode = at91_pmc_set_sys_mode }; -static struct at91pmc_clock uhpck = { +static struct at91_pmc_clock uhpck = { .name = "uhpck", .parent = &pllb, .pmc_mask = PMC_SCER_UHP, - .set_mode = at91pmc_set_sys_mode + .set_mode = at91_pmc_set_sys_mode }; -static struct at91pmc_clock mck = { +static struct at91_pmc_clock mck = { .name = "mck", .pmc_mask = PMC_IER_MCKRDY, .refcnt = 1, }; -static struct at91pmc_clock udc_clk = { +static struct at91_pmc_clock udc_clk = { .name = "udc_clk", .parent = &mck, .pmc_mask = 1 << AT91RM92_IRQ_UDP, - .set_mode = &at91pmc_set_periph_mode + .set_mode = &at91_pmc_set_periph_mode }; -static struct at91pmc_clock ohci_clk = { +static struct at91_pmc_clock ohci_clk = { .name = "ohci_clk", .parent = &mck, .pmc_mask = 1 << AT91RM92_IRQ_UDP, - .set_mode = &at91pmc_set_periph_mode + .set_mode = &at91_pmc_set_periph_mode }; -static struct at91pmc_clock *const clock_list[] = { +static struct at91_pmc_clock *const clock_list[] = { &slck, &main_ck, &plla, @@ -160,22 +160,22 @@ bus_space_write_4(pmc_softc->sc_st, pmc_softc->sc_sh, (off), (val)) static void -at91pmc_set_pllb_mode(struct at91pmc_clock *clk, int on) +at91_pmc_set_pllb_mode(struct at91_pmc_clock *clk, int on) { } static void -at91pmc_set_sys_mode(struct at91pmc_clock *clk, int on) +at91_pmc_set_sys_mode(struct at91_pmc_clock *clk, int on) { } static void -at91pmc_set_periph_mode(struct at91pmc_clock *clk, int on) +at91_pmc_set_periph_mode(struct at91_pmc_clock *clk, int on) { } static int -at91pmc_pll_rate(int freq, uint32_t reg, int is_pllb) +at91_pmc_pll_rate(int freq, uint32_t reg, int is_pllb) { uint32_t mul, div; @@ -193,7 +193,7 @@ } static uint32_t -at91pmc_pll_calc(uint32_t main_freq, uint32_t out_freq) +at91_pmc_pll_calc(uint32_t main_freq, uint32_t out_freq) { uint32_t i, div = 0, mul = 0, diff = 1 << 30; unsigned ret = (out_freq > 155000000) ? 0xbe00 : 0x3e00; @@ -241,7 +241,7 @@ } static void -at91pmc_init_clock(struct at91pmc_softc *sc, int main_clock) +at91_pmc_init_clock(struct at91_pmc_softc *sc, int main_clock) { uint32_t mckr; int freq; @@ -252,8 +252,8 @@ * Initialize the usb clock. This sets up pllb, but disables the * actual clock. */ - sc->pllb_init = at91pmc_pll_calc(main_clock, 48000000 * 2) |0x10000000; - pllb.hz = at91pmc_pll_rate(main_clock, sc->pllb_init, 1); + sc->pllb_init = at91_pmc_pll_calc(main_clock, 48000000 * 2) |0x10000000; + pllb.hz = at91_pmc_pll_rate(main_clock, sc->pllb_init, 1); WR4(PMC_PCDR, (1 << AT91RM92_IRQ_UHP) | (1 << AT91RM92_IRQ_UDP)); WR4(PMC_SCDR, PMC_SCER_UHP | PMC_SCER_UDP); WR4(CKGR_PLLBR, 0); @@ -274,14 +274,14 @@ device_printf(sc->dev, "main clock = %d Hz PLLA = %d Hz CPU %d Hz main %d Hz\n", sc->main_clock_hz, - at91pmc_pll_rate(main_clock, RD4(CKGR_PLLAR), 0), + at91_pmc_pll_rate(main_clock, RD4(CKGR_PLLAR), 0), freq, mck.hz); WR4(PMC_SCDR, PMC_SCER_PCK0 | PMC_SCER_PCK1 | PMC_SCER_PCK2 | PMC_SCER_PCK3); } static int -at91pmc_probe(device_t dev) +at91_pmc_probe(device_t dev) { device_set_desc(dev, "PMC"); @@ -289,7 +289,7 @@ } static int -at91pmc_attach(device_t dev) +at91_pmc_attach(device_t dev) { struct at91_softc *sc = device_get_softc(device_get_parent(dev)); @@ -299,22 +299,22 @@ if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91RM92_PMC_BASE, AT91RM92_PMC_SIZE, &pmc_softc->sc_sh) != 0) panic("couldn't subregion timer registers"); - at91pmc_init_clock(pmc_softc, 10000000); + at91_pmc_init_clock(pmc_softc, 10000000); return (0); } -static device_method_t at91pmc_methods[] = { - DEVMETHOD(device_probe, at91pmc_probe), - DEVMETHOD(device_attach, at91pmc_attach), +static device_method_t at91_pmc_methods[] = { + DEVMETHOD(device_probe, at91_pmc_probe), + DEVMETHOD(device_attach, at91_pmc_attach), {0, 0}, }; -static driver_t at91pmc_driver = { +static driver_t at91_pmc_driver = { "at91_pmc", - at91pmc_methods, - sizeof(struct at91pmc_softc), + at91_pmc_methods, + sizeof(struct at91_pmc_softc), }; -static devclass_t at91pmc_devclass; +static devclass_t at91_pmc_devclass; -DRIVER_MODULE(at91_pmc, atmelarm, at91pmc_driver, at91pmc_devclass, 0, 0); +DRIVER_MODULE(at91_pmc, atmelarm, at91_pmc_driver, at91_pmc_devclass, 0, 0);