tegra_pinmux.c (7bc28467ef3260635ad48dd170e04d9ea098c60c) tegra_pinmux.c (217d17bcd3f525fbdf124cfbc926f8033da69805)
1/*-
2 * Copyright (c) 2016 Michal Meloun <mmel@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 634 unchanged lines hidden (view full) ---

643}
644
645static int
646pinmux_read_node(struct pinmux_softc *sc, phandle_t node, struct pincfg *cfg,
647 char **pins, int *lpins)
648{
649 int rv, i;
650
1/*-
2 * Copyright (c) 2016 Michal Meloun <mmel@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 634 unchanged lines hidden (view full) ---

643}
644
645static int
646pinmux_read_node(struct pinmux_softc *sc, phandle_t node, struct pincfg *cfg,
647 char **pins, int *lpins)
648{
649 int rv, i;
650
651 *lpins = OF_getprop_alloc(node, "nvidia,pins", 1, (void **)pins);
651 *lpins = OF_getprop_alloc(node, "nvidia,pins", (void **)pins);
652 if (*lpins <= 0)
653 return (ENOENT);
654
655 /* Read function (mux) settings. */
652 if (*lpins <= 0)
653 return (ENOENT);
654
655 /* Read function (mux) settings. */
656 rv = OF_getprop_alloc(node, "nvidia,function", 1,
656 rv = OF_getprop_alloc(node, "nvidia,function",
657 (void **)&cfg->function);
658 if (rv <= 0)
659 cfg->function = NULL;
660
661 /* Read numeric properties. */
662 for (i = 0; i < PROP_ID_MAX_ID; i++) {
663 rv = OF_getencprop(node, prop_names[i].name, &cfg->params[i],
664 sizeof(cfg->params[i]));

--- 135 unchanged lines hidden ---
657 (void **)&cfg->function);
658 if (rv <= 0)
659 cfg->function = NULL;
660
661 /* Read numeric properties. */
662 for (i = 0; i < PROP_ID_MAX_ID; i++) {
663 rv = OF_getencprop(node, prop_names[i].name, &cfg->params[i],
664 sizeof(cfg->params[i]));

--- 135 unchanged lines hidden ---