dm: core: Replace of_offset with accessor
[oweals/u-boot.git] / board / atmel / at91rm9200ek / led.c
index 2298e3619c4ee0d4e2ff9b9aebc4ed7f785ecac5..5986ac08f981d1c99b22311885d06822747f9ce3 100644 (file)
@@ -4,7 +4,7 @@
  * Ulf Samuelsson <ulf@atmel.com>
  *
  * (C) Copyright 2010
- * Andreas Bießmann <andreas.devel@gmail.com>
+ * Andreas Bießmann <andreas@biessmann.org>
  *
  * SPDX-License-Identifier:    GPL-2.0+
  */
@@ -12,8 +12,9 @@
 #include <common.h>
 #include <asm/io.h>
 #include <asm/arch/hardware.h>
-#include <asm/arch/at91_pmc.h>
+#include <asm/arch/clk.h>
 #include <asm/arch/at91_pio.h>
+#include <status_led.h>
 
 /* bit mask in PIO port B */
 #define        GREEN_LED       (1<<0)
@@ -58,11 +59,9 @@ void red_led_off(void)
 
 void coloured_LED_init (void)
 {
-       at91_pmc_t *pmc = (at91_pmc_t *)ATMEL_BASE_PMC;
        at91_pio_t *pio = (at91_pio_t *)ATMEL_BASE_PIO;
 
-       /* Enable PIOB clock */
-       writel(1 << ATMEL_ID_PIOB, &pmc->pcer);
+       at91_periph_clk_enable(ATMEL_ID_PIOB);
 
        /* Disable peripherals on LEDs */
        writel(GREEN_LED | YELLOW_LED | RED_LED, &pio->piob.per);