1a3c950f2SKarol Herbst /* 2a3c950f2SKarol Herbst * Copyright 2016 Karol Herbst 3a3c950f2SKarol Herbst * 4a3c950f2SKarol Herbst * Permission is hereby granted, free of charge, to any person obtaining a 5a3c950f2SKarol Herbst * copy of this software and associated documentation files (the "Software"), 6a3c950f2SKarol Herbst * to deal in the Software without restriction, including without limitation 7a3c950f2SKarol Herbst * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8a3c950f2SKarol Herbst * and/or sell copies of the Software, and to permit persons to whom the 9a3c950f2SKarol Herbst * Software is furnished to do so, subject to the following conditions: 10a3c950f2SKarol Herbst * 11a3c950f2SKarol Herbst * The above copyright notice and this permission notice shall be included in 12a3c950f2SKarol Herbst * all copies or substantial portions of the Software. 13a3c950f2SKarol Herbst * 14a3c950f2SKarol Herbst * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15a3c950f2SKarol Herbst * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16a3c950f2SKarol Herbst * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17a3c950f2SKarol Herbst * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 18a3c950f2SKarol Herbst * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 19a3c950f2SKarol Herbst * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 20a3c950f2SKarol Herbst * OTHER DEALINGS IN THE SOFTWARE. 21a3c950f2SKarol Herbst * 22a3c950f2SKarol Herbst * Authors: Karol Herbst 23a3c950f2SKarol Herbst */ 24a3c950f2SKarol Herbst #include "priv.h" 25a3c950f2SKarol Herbst 26a3c950f2SKarol Herbst static const struct nvkm_volt_func 27a3c950f2SKarol Herbst gf100_volt = { 28a3c950f2SKarol Herbst .vid_get = nvkm_voltgpio_get, 29a3c950f2SKarol Herbst .vid_set = nvkm_voltgpio_set, 30a3c950f2SKarol Herbst }; 31a3c950f2SKarol Herbst 32a3c950f2SKarol Herbst int 33a3c950f2SKarol Herbst gf100_volt_new(struct nvkm_device *device, int index, struct nvkm_volt **pvolt) 34a3c950f2SKarol Herbst { 35a3c950f2SKarol Herbst struct nvkm_volt *volt; 36a3c950f2SKarol Herbst int ret; 37a3c950f2SKarol Herbst 38a3c950f2SKarol Herbst ret = nvkm_volt_new_(&gf100_volt, device, index, &volt); 39a3c950f2SKarol Herbst *pvolt = volt; 40a3c950f2SKarol Herbst if (ret) 41a3c950f2SKarol Herbst return ret; 42a3c950f2SKarol Herbst 43a3c950f2SKarol Herbst return nvkm_voltgpio_init(volt); 44a3c950f2SKarol Herbst } 45