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
203 if (sr_class->notify && sr_class->notify_flags && sr_info->irq) { in sr_late_init()
204 ret = devm_request_irq(&sr_info->pdev->dev, sr_info->irq, in sr_late_init()
205 sr_interrupt, 0, sr_info->name, sr_info); in sr_late_init()
208 disable_irq(sr_info->irq); in sr_late_init()
214 list_del(&sr_info->node); in sr_late_init()
215 …dev_err(&sr_info->pdev->dev, "%s: ERROR in registering interrupt handler. Smartreflex will not fun… in sr_late_init()
649 struct omap_sr *sr_info; in sr_register_class() local
669 list_for_each_entry(sr_info, &sr_list, node) in sr_register_class()
670 sr_late_init(sr_info); in sr_register_class()
773 struct omap_sr *sr_info = data; in omap_sr_autocomp_show() local
775 if (!sr_info) { in omap_sr_autocomp_show()
780 *val = sr_info->autocomp_active; in omap_sr_autocomp_show()
787 struct omap_sr *sr_info = data; in omap_sr_autocomp_store() local
789 if (!sr_info) { in omap_sr_autocomp_store()
801 if (sr_info->autocomp_active != val) { in omap_sr_autocomp_store()
803 sr_stop_vddautocomp(sr_info); in omap_sr_autocomp_store()
805 sr_start_vddautocomp(sr_info); in omap_sr_autocomp_store()
816 struct omap_sr *sr_info; in omap_sr_probe() local
821 sr_info = devm_kzalloc(&pdev->dev, sizeof(struct omap_sr), GFP_KERNEL); in omap_sr_probe()
822 if (!sr_info) in omap_sr_probe()
825 sr_info->name = devm_kzalloc(&pdev->dev, in omap_sr_probe()
827 if (!sr_info->name) in omap_sr_probe()
830 platform_set_drvdata(pdev, sr_info); in omap_sr_probe()
837 sr_info->base = devm_platform_ioremap_resource(pdev, 0); in omap_sr_probe()
838 if (IS_ERR(sr_info->base)) in omap_sr_probe()
839 return PTR_ERR(sr_info->base); in omap_sr_probe()
845 sr_info->irq = ret; in omap_sr_probe()
847 sr_info->fck = devm_clk_get(pdev->dev.parent, "fck"); in omap_sr_probe()
848 if (IS_ERR(sr_info->fck)) in omap_sr_probe()
849 return PTR_ERR(sr_info->fck); in omap_sr_probe()
850 clk_prepare(sr_info->fck); in omap_sr_probe()
854 snprintf(sr_info->name, SMARTREFLEX_NAME_LEN, "%s", pdata->name); in omap_sr_probe()
856 sr_info->pdev = pdev; in omap_sr_probe()
857 sr_info->srid = pdev->id; in omap_sr_probe()
858 sr_info->voltdm = pdata->voltdm; in omap_sr_probe()
859 sr_info->nvalue_table = pdata->nvalue_table; in omap_sr_probe()
860 sr_info->nvalue_count = pdata->nvalue_count; in omap_sr_probe()
861 sr_info->senn_mod = pdata->senn_mod; in omap_sr_probe()
862 sr_info->senp_mod = pdata->senp_mod; in omap_sr_probe()
863 sr_info->err_weight = pdata->err_weight; in omap_sr_probe()
864 sr_info->err_maxlimit = pdata->err_maxlimit; in omap_sr_probe()
865 sr_info->accum_data = pdata->accum_data; in omap_sr_probe()
866 sr_info->senn_avgweight = pdata->senn_avgweight; in omap_sr_probe()
867 sr_info->senp_avgweight = pdata->senp_avgweight; in omap_sr_probe()
868 sr_info->autocomp_active = false; in omap_sr_probe()
869 sr_info->ip_type = pdata->ip_type; in omap_sr_probe()
871 sr_set_clk_length(sr_info); in omap_sr_probe()
873 list_add(&sr_info->node, &sr_list); in omap_sr_probe()
880 ret = sr_late_init(sr_info); in omap_sr_probe()
891 sr_info->dbg_dir = debugfs_create_dir(sr_info->name, sr_dbg_dir); in omap_sr_probe()
893 debugfs_create_file("autocomp", S_IRUGO | S_IWUSR, sr_info->dbg_dir, in omap_sr_probe()
894 sr_info, &pm_sr_fops); in omap_sr_probe()
895 debugfs_create_x32("errweight", S_IRUGO, sr_info->dbg_dir, in omap_sr_probe()
896 &sr_info->err_weight); in omap_sr_probe()
897 debugfs_create_x32("errmaxlimit", S_IRUGO, sr_info->dbg_dir, in omap_sr_probe()
898 &sr_info->err_maxlimit); in omap_sr_probe()
900 nvalue_dir = debugfs_create_dir("nvalue", sr_info->dbg_dir); in omap_sr_probe()
902 if (sr_info->nvalue_count == 0 || !sr_info->nvalue_table) { in omap_sr_probe()
904 __func__, sr_info->name); in omap_sr_probe()
910 for (i = 0; i < sr_info->nvalue_count; i++) { in omap_sr_probe()
914 sr_info->nvalue_table[i].volt_nominal); in omap_sr_probe()
916 &(sr_info->nvalue_table[i].nvalue)); in omap_sr_probe()
918 sr_info->nvalue_table[i].volt_nominal); in omap_sr_probe()
920 &(sr_info->nvalue_table[i].errminlimit)); in omap_sr_probe()
927 debugfs_remove_recursive(sr_info->dbg_dir); in omap_sr_probe()
930 list_del(&sr_info->node); in omap_sr_probe()
931 clk_unprepare(sr_info->fck); in omap_sr_probe()
939 struct omap_sr *sr_info = platform_get_drvdata(pdev); in omap_sr_remove() local
941 if (sr_info->autocomp_active) in omap_sr_remove()
942 sr_stop_vddautocomp(sr_info); in omap_sr_remove()
943 debugfs_remove_recursive(sr_info->dbg_dir); in omap_sr_remove()
946 clk_unprepare(sr_info->fck); in omap_sr_remove()
947 list_del(&sr_info->node); in omap_sr_remove()
953 struct omap_sr *sr_info = platform_get_drvdata(pdev); in omap_sr_shutdown() local
955 if (sr_info->autocomp_active) in omap_sr_shutdown()
956 sr_stop_vddautocomp(sr_info); in omap_sr_shutdown()