X-Git-Url: https://git.ayoreis.com/Adafruit_Blinka-hackapet.git/blobdiff_plain/a3770186a94117be56a8d9a8038a2d540bd2884c..03548b64a8d7b407b4ae6464c5ffc551be8fc0be:/src/adafruit_blinka/microcontroller/amlogic/meson_g12_common/pin.py diff --git a/src/adafruit_blinka/microcontroller/amlogic/meson_g12_common/pin.py b/src/adafruit_blinka/microcontroller/amlogic/meson_g12_common/pin.py index 165bca7..d920b1f 100644 --- a/src/adafruit_blinka/microcontroller/amlogic/meson_g12_common/pin.py +++ b/src/adafruit_blinka/microcontroller/amlogic/meson_g12_common/pin.py @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries +# +# SPDX-License-Identifier: MIT """ G12A, G12B, and SM1 Common Definitions Ref: @@ -9,8 +12,8 @@ Linux kernel 5.4.y (mainline) """ import re -from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin import gpiod +from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin chip0 = gpiod.Chip("0") chip1 = gpiod.Chip("1") @@ -110,7 +113,7 @@ uartPorts = ((1, UART1_TX, UART1_RX),) def get_dts_alias(device: str) -> str: """Get the Device Tree Alias""" uevent_path = "/sys/bus/platform/devices/" + device + "/uevent" - with open(uevent_path, "r") as fd: + with open(uevent_path, "r", encoding="utf-8") as fd: pattern = r"^OF_ALIAS_0=(.*)$" uevent = fd.read().split("\n") for line in uevent: