da8xx-mstpri.c (b9bccf35acc94e1972029abb0b41cd5a0f4dc54c) | da8xx-mstpri.c (48c28337380ac499df5e370bc1ec1d6217ac35bc) |
---|---|
1/* 2 * TI da8xx master peripheral priority driver 3 * 4 * Copyright (C) 2016 BayLibre SAS 5 * 6 * Author: 7 * Bartosz Golaszewski <bgolaszewski@baylibre.com.com> 8 * 9 * This program is free software; you can redistribute it and/or modify 10 * it under the terms of the GNU General Public License version 2 as 11 * published by the Free Software Foundation. 12 */ 13 14#include <linux/module.h> 15#include <linux/of.h> 16#include <linux/platform_device.h> 17#include <linux/io.h> 18#include <linux/regmap.h> | 1/* 2 * TI da8xx master peripheral priority driver 3 * 4 * Copyright (C) 2016 BayLibre SAS 5 * 6 * Author: 7 * Bartosz Golaszewski <bgolaszewski@baylibre.com.com> 8 * 9 * This program is free software; you can redistribute it and/or modify 10 * it under the terms of the GNU General Public License version 2 as 11 * published by the Free Software Foundation. 12 */ 13 14#include <linux/module.h> 15#include <linux/of.h> 16#include <linux/platform_device.h> 17#include <linux/io.h> 18#include <linux/regmap.h> |
19#include <linux/of_fdt.h> | |
20 21/* 22 * REVISIT: Linux doesn't have a good framework for the kind of performance 23 * knobs this driver controls. We can't use device tree properties as it deals 24 * with hardware configuration rather than description. We also don't want to 25 * commit to maintaining some random sysfs attributes. 26 * 27 * For now we just hardcode the register values for the boards that need --- 193 unchanged lines hidden (view full) --- 221 mstpri = devm_ioremap_resource(dev, res); 222 if (IS_ERR(mstpri)) { 223 dev_err(dev, "unable to map MSTPRI registers\n"); 224 return PTR_ERR(mstpri); 225 } 226 227 prio_list = da8xx_mstpri_get_board_prio(); 228 if (!prio_list) { | 19 20/* 21 * REVISIT: Linux doesn't have a good framework for the kind of performance 22 * knobs this driver controls. We can't use device tree properties as it deals 23 * with hardware configuration rather than description. We also don't want to 24 * commit to maintaining some random sysfs attributes. 25 * 26 * For now we just hardcode the register values for the boards that need --- 193 unchanged lines hidden (view full) --- 220 mstpri = devm_ioremap_resource(dev, res); 221 if (IS_ERR(mstpri)) { 222 dev_err(dev, "unable to map MSTPRI registers\n"); 223 return PTR_ERR(mstpri); 224 } 225 226 prio_list = da8xx_mstpri_get_board_prio(); 227 if (!prio_list) { |
229 dev_err(dev, "no master priotities defined for board '%s'\n", 230 of_flat_dt_get_machine_name()); | 228 dev_err(dev, "no master priorities defined for this board\n"); |
231 return -EINVAL; 232 } 233 234 for (i = 0; i < prio_list->numprio; i++) { 235 prio = &prio_list->priorities[i]; 236 prio_descr = &da8xx_mstpri_priority_list[prio->which]; 237 238 if (prio_descr->reg + sizeof(u32) > resource_size(res)) { --- 31 unchanged lines hidden --- | 229 return -EINVAL; 230 } 231 232 for (i = 0; i < prio_list->numprio; i++) { 233 prio = &prio_list->priorities[i]; 234 prio_descr = &da8xx_mstpri_priority_list[prio->which]; 235 236 if (prio_descr->reg + sizeof(u32) > resource_size(res)) { --- 31 unchanged lines hidden --- |