Lines Matching refs:pd

19 #define domain_to_rpmhpd(domain) container_of(domain, struct rpmhpd, pd)
46 struct generic_pm_domain pd; member
74 .pd = { .name = "cx", },
80 .pd = { .name = "cx_ao", },
88 .pd = { .name = "cx", },
90 .parent = &mx.pd,
95 .pd = { .name = "cx_ao", },
98 .parent = &mx_ao.pd,
103 .pd = { .name = "ebi", },
108 .pd = { .name = "gfx", },
113 .pd = { .name = "lcx", },
118 .pd = { .name = "lmx", },
124 .pd = { .name = "mmcx", },
130 .pd = { .name = "mmcx_ao", },
138 .pd = { .name = "mmcx", },
140 .parent = &cx.pd,
145 .pd = { .name = "mmcx_ao", },
148 .parent = &cx_ao.pd,
153 .pd = { .name = "mss", },
159 .pd = { .name = "mx", },
165 .pd = { .name = "mx_ao", },
173 .pd = { .name = "mxc", },
179 .pd = { .name = "mxc_ao", },
186 .pd = { .name = "nsp", },
191 .pd = { .name = "nsp0", },
196 .pd = { .name = "nsp1", },
201 .pd = { .name = "qphy", },
574 static int rpmhpd_send_corner(struct rpmhpd *pd, int state, in rpmhpd_send_corner() argument
578 .addr = pd->addr, in rpmhpd_send_corner()
587 return rpmh_write(pd->dev, state, &cmd, 1); in rpmhpd_send_corner()
589 return rpmh_write_async(pd->dev, state, &cmd, 1); in rpmhpd_send_corner()
592 static void to_active_sleep(struct rpmhpd *pd, unsigned int corner, in to_active_sleep() argument
597 if (pd->active_only) in to_active_sleep()
612 static int rpmhpd_aggregate_corner(struct rpmhpd *pd, unsigned int corner) in rpmhpd_aggregate_corner() argument
615 struct rpmhpd *peer = pd->peer; in rpmhpd_aggregate_corner()
621 if (pd->state_synced) { in rpmhpd_aggregate_corner()
622 to_active_sleep(pd, corner, &this_active_corner, &this_sleep_corner); in rpmhpd_aggregate_corner()
625 this_active_corner = pd->level_count - 1; in rpmhpd_aggregate_corner()
626 this_sleep_corner = pd->level_count - 1; in rpmhpd_aggregate_corner()
637 ret = rpmhpd_send_corner(pd, RPMH_ACTIVE_ONLY_STATE, active_corner, in rpmhpd_aggregate_corner()
638 active_corner > pd->active_corner); in rpmhpd_aggregate_corner()
642 pd->active_corner = active_corner; in rpmhpd_aggregate_corner()
647 ret = rpmhpd_send_corner(pd, RPMH_WAKE_ONLY_STATE, in rpmhpd_aggregate_corner()
654 return rpmhpd_send_corner(pd, RPMH_SLEEP_STATE, sleep_corner, in rpmhpd_aggregate_corner()
663 struct rpmhpd *pd = domain_to_rpmhpd(domain); in rpmhpd_power_on() local
669 corner = max(pd->corner, pd->enable_corner); in rpmhpd_power_on()
670 ret = rpmhpd_aggregate_corner(pd, corner); in rpmhpd_power_on()
672 pd->enabled = true; in rpmhpd_power_on()
681 struct rpmhpd *pd = domain_to_rpmhpd(domain); in rpmhpd_power_off() local
686 ret = rpmhpd_aggregate_corner(pd, 0); in rpmhpd_power_off()
688 pd->enabled = false; in rpmhpd_power_off()
698 struct rpmhpd *pd = domain_to_rpmhpd(domain); in rpmhpd_set_performance_state() local
703 for (i = 0; i < pd->level_count; i++) in rpmhpd_set_performance_state()
704 if (level <= pd->level[i]) in rpmhpd_set_performance_state()
711 if (i == pd->level_count) in rpmhpd_set_performance_state()
714 if (pd->enabled) { in rpmhpd_set_performance_state()
716 if (i < pd->enable_corner) in rpmhpd_set_performance_state()
717 i = pd->enable_corner; in rpmhpd_set_performance_state()
719 ret = rpmhpd_aggregate_corner(pd, i); in rpmhpd_set_performance_state()
724 pd->corner = i; in rpmhpd_set_performance_state()
823 rpmhpds[i]->pd.power_off = rpmhpd_power_off; in rpmhpd_probe()
824 rpmhpds[i]->pd.power_on = rpmhpd_power_on; in rpmhpd_probe()
825 rpmhpds[i]->pd.set_performance_state = rpmhpd_set_performance_state; in rpmhpd_probe()
826 rpmhpds[i]->pd.opp_to_performance_state = rpmhpd_get_performance_state; in rpmhpd_probe()
827 pm_genpd_init(&rpmhpds[i]->pd, NULL, true); in rpmhpd_probe()
829 data->domains[i] = &rpmhpds[i]->pd; in rpmhpd_probe()
838 &rpmhpds[i]->pd); in rpmhpd_probe()
849 struct rpmhpd *pd; in rpmhpd_sync_state() local
855 pd = rpmhpds[i]; in rpmhpd_sync_state()
856 if (!pd) in rpmhpd_sync_state()
859 pd->state_synced = true; in rpmhpd_sync_state()
860 if (pd->enabled) in rpmhpd_sync_state()
861 corner = max(pd->corner, pd->enable_corner); in rpmhpd_sync_state()
865 ret = rpmhpd_aggregate_corner(pd, corner); in rpmhpd_sync_state()
867 dev_err(dev, "failed to sync %s\n", pd->res_name); in rpmhpd_sync_state()