1*e51b3d8eSEmmanuel Vadot /*- 2*e51b3d8eSEmmanuel Vadot * Copyright 2018 Emmanuel Vadot <manu@FreeBSD.org> 3*e51b3d8eSEmmanuel Vadot * 4*e51b3d8eSEmmanuel Vadot * Redistribution and use in source and binary forms, with or without 5*e51b3d8eSEmmanuel Vadot * modification, are permitted provided that the following conditions 6*e51b3d8eSEmmanuel Vadot * are met: 7*e51b3d8eSEmmanuel Vadot * 1. Redistributions of source code must retain the above copyright 8*e51b3d8eSEmmanuel Vadot * notice, this list of conditions and the following disclaimer. 9*e51b3d8eSEmmanuel Vadot * 2. Redistributions in binary form must reproduce the above copyright 10*e51b3d8eSEmmanuel Vadot * notice, this list of conditions and the following disclaimer in the 11*e51b3d8eSEmmanuel Vadot * documentation and/or other materials provided with the distribution. 12*e51b3d8eSEmmanuel Vadot * 13*e51b3d8eSEmmanuel Vadot * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 14*e51b3d8eSEmmanuel Vadot * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15*e51b3d8eSEmmanuel Vadot * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16*e51b3d8eSEmmanuel Vadot * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 17*e51b3d8eSEmmanuel Vadot * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18*e51b3d8eSEmmanuel Vadot * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 19*e51b3d8eSEmmanuel Vadot * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20*e51b3d8eSEmmanuel Vadot * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21*e51b3d8eSEmmanuel Vadot * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22*e51b3d8eSEmmanuel Vadot * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23*e51b3d8eSEmmanuel Vadot * SUCH DAMAGE. 24*e51b3d8eSEmmanuel Vadot */ 25*e51b3d8eSEmmanuel Vadot 26*e51b3d8eSEmmanuel Vadot #ifndef _DEV_NVMEM_H_ 27*e51b3d8eSEmmanuel Vadot #define _DEV_NVMEM_H_ 28*e51b3d8eSEmmanuel Vadot 29*e51b3d8eSEmmanuel Vadot int nvmem_get_cell_len(phandle_t node, const char *name); 30*e51b3d8eSEmmanuel Vadot int nvmem_read_cell_by_name(phandle_t node, const char *name, void *cell, size_t buflen); 31*e51b3d8eSEmmanuel Vadot int nvmem_read_cell_by_idx(phandle_t node, int idx, void *cell, size_t buflen); 32*e51b3d8eSEmmanuel Vadot int nvmem_write_cell_by_name(phandle_t node, const char *name, void *cell, size_t buflen); 33*e51b3d8eSEmmanuel Vadot int nvmem_write_cell_by_idx(phandle_t node, int idx, void *cell, size_t buflen); 34*e51b3d8eSEmmanuel Vadot 35*e51b3d8eSEmmanuel Vadot #endif /* _DEV_NVMEM_H_ */ 36