Loading drivers/devfreq/bimc-bwmon.c +40 −23 Original line number Diff line number Diff line Loading @@ -554,14 +554,30 @@ static int resume_bw_hwmon(struct bw_hwmon *hw) /*************************************************************************/ static const struct bwmon_spec spec[] = { { .wrap_on_thres = true, .overflow = false, .throt_adj = false, .hw_sampling = false}, { .wrap_on_thres = false, .overflow = true, .throt_adj = false, .hw_sampling = false}, { .wrap_on_thres = false, .overflow = true, .throt_adj = true, .hw_sampling = false}, { .wrap_on_thres = false, .overflow = true, .throt_adj = true, .hw_sampling = true}, [0] = { .wrap_on_thres = true, .overflow = false, .throt_adj = false, .hw_sampling = false }, [1] = { .wrap_on_thres = false, .overflow = true, .throt_adj = false, .hw_sampling = false }, [2] = { .wrap_on_thres = false, .overflow = true, .throt_adj = true, .hw_sampling = false }, [3] = { .wrap_on_thres = false, .overflow = true, .throt_adj = true, .hw_sampling = true }, }; static const struct of_device_id bimc_bwmon_match_table[] = { Loading @@ -577,7 +593,6 @@ static int bimc_bwmon_driver_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct resource *res; struct bwmon *m; const struct of_device_id *id; int ret; u32 data; Loading @@ -593,16 +608,15 @@ static int bimc_bwmon_driver_probe(struct platform_device *pdev) } m->mport = data; id = of_match_device(bimc_bwmon_match_table, dev); if (!id) { m->spec = of_device_get_match_data(dev); if (!m->spec) { dev_err(dev, "Unknown device type!\n"); return -ENODEV; } m->spec = id->data; if (has_hw_sampling(m)) { ret = of_property_read_u32(dev->of_node, "qcom,hw-timer-hz", &data); ret = of_property_read_u32(dev->of_node, "qcom,hw-timer-hz", &data); if (ret) { dev_err(dev, "HW sampling rate not specified!\n"); return ret; Loading Loading @@ -641,17 +655,20 @@ static int bimc_bwmon_driver_probe(struct platform_device *pdev) m->hw.of_node = of_parse_phandle(dev->of_node, "qcom,target-dev", 0); if (!m->hw.of_node) return -EINVAL; m->hw.start_hwmon = &start_bw_hwmon; m->hw.stop_hwmon = &stop_bw_hwmon; m->hw.suspend_hwmon = &suspend_bw_hwmon; m->hw.resume_hwmon = &resume_bw_hwmon; m->hw.get_bytes_and_clear = &get_bytes_and_clear; m->hw.set_thres = &set_thres; m->hw.start_hwmon = start_bw_hwmon; m->hw.stop_hwmon = stop_bw_hwmon; m->hw.suspend_hwmon = suspend_bw_hwmon; m->hw.resume_hwmon = resume_bw_hwmon; m->hw.get_bytes_and_clear = get_bytes_and_clear; m->hw.set_thres = set_thres; if (has_hw_sampling(m)) m->hw.set_hw_events = &set_hw_events; m->hw.set_hw_events = set_hw_events; if (m->spec->throt_adj) { m->hw.set_throttle_adj = &mon_set_throttle_adj; m->hw.get_throttle_adj = &mon_get_throttle_adj; m->hw.set_throttle_adj = mon_set_throttle_adj; m->hw.get_throttle_adj = mon_get_throttle_adj; } ret = register_bw_hwmon(dev, &m->hw); Loading Loading
drivers/devfreq/bimc-bwmon.c +40 −23 Original line number Diff line number Diff line Loading @@ -554,14 +554,30 @@ static int resume_bw_hwmon(struct bw_hwmon *hw) /*************************************************************************/ static const struct bwmon_spec spec[] = { { .wrap_on_thres = true, .overflow = false, .throt_adj = false, .hw_sampling = false}, { .wrap_on_thres = false, .overflow = true, .throt_adj = false, .hw_sampling = false}, { .wrap_on_thres = false, .overflow = true, .throt_adj = true, .hw_sampling = false}, { .wrap_on_thres = false, .overflow = true, .throt_adj = true, .hw_sampling = true}, [0] = { .wrap_on_thres = true, .overflow = false, .throt_adj = false, .hw_sampling = false }, [1] = { .wrap_on_thres = false, .overflow = true, .throt_adj = false, .hw_sampling = false }, [2] = { .wrap_on_thres = false, .overflow = true, .throt_adj = true, .hw_sampling = false }, [3] = { .wrap_on_thres = false, .overflow = true, .throt_adj = true, .hw_sampling = true }, }; static const struct of_device_id bimc_bwmon_match_table[] = { Loading @@ -577,7 +593,6 @@ static int bimc_bwmon_driver_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct resource *res; struct bwmon *m; const struct of_device_id *id; int ret; u32 data; Loading @@ -593,16 +608,15 @@ static int bimc_bwmon_driver_probe(struct platform_device *pdev) } m->mport = data; id = of_match_device(bimc_bwmon_match_table, dev); if (!id) { m->spec = of_device_get_match_data(dev); if (!m->spec) { dev_err(dev, "Unknown device type!\n"); return -ENODEV; } m->spec = id->data; if (has_hw_sampling(m)) { ret = of_property_read_u32(dev->of_node, "qcom,hw-timer-hz", &data); ret = of_property_read_u32(dev->of_node, "qcom,hw-timer-hz", &data); if (ret) { dev_err(dev, "HW sampling rate not specified!\n"); return ret; Loading Loading @@ -641,17 +655,20 @@ static int bimc_bwmon_driver_probe(struct platform_device *pdev) m->hw.of_node = of_parse_phandle(dev->of_node, "qcom,target-dev", 0); if (!m->hw.of_node) return -EINVAL; m->hw.start_hwmon = &start_bw_hwmon; m->hw.stop_hwmon = &stop_bw_hwmon; m->hw.suspend_hwmon = &suspend_bw_hwmon; m->hw.resume_hwmon = &resume_bw_hwmon; m->hw.get_bytes_and_clear = &get_bytes_and_clear; m->hw.set_thres = &set_thres; m->hw.start_hwmon = start_bw_hwmon; m->hw.stop_hwmon = stop_bw_hwmon; m->hw.suspend_hwmon = suspend_bw_hwmon; m->hw.resume_hwmon = resume_bw_hwmon; m->hw.get_bytes_and_clear = get_bytes_and_clear; m->hw.set_thres = set_thres; if (has_hw_sampling(m)) m->hw.set_hw_events = &set_hw_events; m->hw.set_hw_events = set_hw_events; if (m->spec->throt_adj) { m->hw.set_throttle_adj = &mon_set_throttle_adj; m->hw.get_throttle_adj = &mon_get_throttle_adj; m->hw.set_throttle_adj = mon_set_throttle_adj; m->hw.get_throttle_adj = mon_get_throttle_adj; } ret = register_bw_hwmon(dev, &m->hw); Loading