Lines Matching refs:sr_info

80 	struct omap_sr *sr_info;  in _sr_lookup()  local
87 list_for_each_entry(sr_info, &sr_list, node) { in _sr_lookup()
88 if (voltdm == sr_info->voltdm) in _sr_lookup()
89 return sr_info; in _sr_lookup()
97 struct omap_sr *sr_info = data; in sr_interrupt() local
100 switch (sr_info->ip_type) { in sr_interrupt()
103 status = sr_read_reg(sr_info, ERRCONFIG_V1); in sr_interrupt()
106 sr_write_reg(sr_info, ERRCONFIG_V1, status); in sr_interrupt()
110 status = sr_read_reg(sr_info, IRQSTATUS); in sr_interrupt()
113 sr_write_reg(sr_info, IRQSTATUS, status); in sr_interrupt()
116 dev_err(&sr_info->pdev->dev, "UNKNOWN IP type %d\n", in sr_interrupt()
117 sr_info->ip_type); in sr_interrupt()
122 sr_class->notify(sr_info, status); in sr_interrupt()
199 static int sr_late_init(struct omap_sr *sr_info) in sr_late_init() argument
201 struct omap_sr_data *pdata = sr_info->pdev->dev.platform_data; in sr_late_init()
204 if (sr_class->notify && sr_class->notify_flags && sr_info->irq) { in sr_late_init()
205 ret = devm_request_irq(&sr_info->pdev->dev, sr_info->irq, in sr_late_init()
206 sr_interrupt, 0, sr_info->name, sr_info); in sr_late_init()
209 disable_irq(sr_info->irq); in sr_late_init()
213 sr_start_vddautocomp(sr_info); in sr_late_init()
218 list_del(&sr_info->node); in sr_late_init()
219 …dev_err(&sr_info->pdev->dev, "%s: ERROR in registering interrupt handler. Smartreflex will not fun… in sr_late_init()
653 struct omap_sr *sr_info; in sr_register_class() local
673 list_for_each_entry(sr_info, &sr_list, node) in sr_register_class()
674 sr_late_init(sr_info); in sr_register_class()
777 struct omap_sr *sr_info = data; in omap_sr_autocomp_show() local
779 if (!sr_info) { in omap_sr_autocomp_show()
784 *val = sr_info->autocomp_active; in omap_sr_autocomp_show()
791 struct omap_sr *sr_info = data; in omap_sr_autocomp_store() local
793 if (!sr_info) { in omap_sr_autocomp_store()
805 if (sr_info->autocomp_active != val) { in omap_sr_autocomp_store()
807 sr_stop_vddautocomp(sr_info); in omap_sr_autocomp_store()
809 sr_start_vddautocomp(sr_info); in omap_sr_autocomp_store()
820 struct omap_sr *sr_info; in omap_sr_probe() local
826 sr_info = devm_kzalloc(&pdev->dev, sizeof(struct omap_sr), GFP_KERNEL); in omap_sr_probe()
827 if (!sr_info) in omap_sr_probe()
830 sr_info->name = devm_kzalloc(&pdev->dev, in omap_sr_probe()
832 if (!sr_info->name) in omap_sr_probe()
835 platform_set_drvdata(pdev, sr_info); in omap_sr_probe()
843 sr_info->base = devm_ioremap_resource(&pdev->dev, mem); in omap_sr_probe()
844 if (IS_ERR(sr_info->base)) in omap_sr_probe()
845 return PTR_ERR(sr_info->base); in omap_sr_probe()
851 sr_info->irq = ret; in omap_sr_probe()
853 sr_info->fck = devm_clk_get(pdev->dev.parent, "fck"); in omap_sr_probe()
854 if (IS_ERR(sr_info->fck)) in omap_sr_probe()
855 return PTR_ERR(sr_info->fck); in omap_sr_probe()
856 clk_prepare(sr_info->fck); in omap_sr_probe()
860 snprintf(sr_info->name, SMARTREFLEX_NAME_LEN, "%s", pdata->name); in omap_sr_probe()
862 sr_info->pdev = pdev; in omap_sr_probe()
863 sr_info->srid = pdev->id; in omap_sr_probe()
864 sr_info->voltdm = pdata->voltdm; in omap_sr_probe()
865 sr_info->nvalue_table = pdata->nvalue_table; in omap_sr_probe()
866 sr_info->nvalue_count = pdata->nvalue_count; in omap_sr_probe()
867 sr_info->senn_mod = pdata->senn_mod; in omap_sr_probe()
868 sr_info->senp_mod = pdata->senp_mod; in omap_sr_probe()
869 sr_info->err_weight = pdata->err_weight; in omap_sr_probe()
870 sr_info->err_maxlimit = pdata->err_maxlimit; in omap_sr_probe()
871 sr_info->accum_data = pdata->accum_data; in omap_sr_probe()
872 sr_info->senn_avgweight = pdata->senn_avgweight; in omap_sr_probe()
873 sr_info->senp_avgweight = pdata->senp_avgweight; in omap_sr_probe()
874 sr_info->autocomp_active = false; in omap_sr_probe()
875 sr_info->ip_type = pdata->ip_type; in omap_sr_probe()
877 sr_set_clk_length(sr_info); in omap_sr_probe()
879 list_add(&sr_info->node, &sr_list); in omap_sr_probe()
886 ret = sr_late_init(sr_info); in omap_sr_probe()
897 sr_info->dbg_dir = debugfs_create_dir(sr_info->name, sr_dbg_dir); in omap_sr_probe()
899 debugfs_create_file("autocomp", S_IRUGO | S_IWUSR, sr_info->dbg_dir, in omap_sr_probe()
900 sr_info, &pm_sr_fops); in omap_sr_probe()
901 debugfs_create_x32("errweight", S_IRUGO, sr_info->dbg_dir, in omap_sr_probe()
902 &sr_info->err_weight); in omap_sr_probe()
903 debugfs_create_x32("errmaxlimit", S_IRUGO, sr_info->dbg_dir, in omap_sr_probe()
904 &sr_info->err_maxlimit); in omap_sr_probe()
906 nvalue_dir = debugfs_create_dir("nvalue", sr_info->dbg_dir); in omap_sr_probe()
908 if (sr_info->nvalue_count == 0 || !sr_info->nvalue_table) { in omap_sr_probe()
910 __func__, sr_info->name); in omap_sr_probe()
916 for (i = 0; i < sr_info->nvalue_count; i++) { in omap_sr_probe()
920 sr_info->nvalue_table[i].volt_nominal); in omap_sr_probe()
922 &(sr_info->nvalue_table[i].nvalue)); in omap_sr_probe()
924 sr_info->nvalue_table[i].volt_nominal); in omap_sr_probe()
926 &(sr_info->nvalue_table[i].errminlimit)); in omap_sr_probe()
933 debugfs_remove_recursive(sr_info->dbg_dir); in omap_sr_probe()
936 list_del(&sr_info->node); in omap_sr_probe()
937 clk_unprepare(sr_info->fck); in omap_sr_probe()
946 struct omap_sr *sr_info; in omap_sr_remove() local
953 sr_info = _sr_lookup(pdata->voltdm); in omap_sr_remove()
954 if (IS_ERR(sr_info)) { in omap_sr_remove()
957 return PTR_ERR(sr_info); in omap_sr_remove()
960 if (sr_info->autocomp_active) in omap_sr_remove()
961 sr_stop_vddautocomp(sr_info); in omap_sr_remove()
962 debugfs_remove_recursive(sr_info->dbg_dir); in omap_sr_remove()
965 clk_unprepare(sr_info->fck); in omap_sr_remove()
966 list_del(&sr_info->node); in omap_sr_remove()
973 struct omap_sr *sr_info; in omap_sr_shutdown() local
980 sr_info = _sr_lookup(pdata->voltdm); in omap_sr_shutdown()
981 if (IS_ERR(sr_info)) { in omap_sr_shutdown()
987 if (sr_info->autocomp_active) in omap_sr_shutdown()
988 sr_stop_vddautocomp(sr_info); in omap_sr_shutdown()