Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pistachio: marduk: Switch on heartbeat LED #20

Merged
merged 4 commits into from Dec 2, 2016

Conversation

ghost
Copy link

@ghost ghost commented Nov 30, 2016

this connects CreatorDev/openwrt#45

Signed-off-by: Francois Berder francois.berder@imgtec.com

{
u32 reg, val;

/* make GPIO output */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you refactor to use a select_* function?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@ghost ghost force-pushed the task-45 branch 2 times, most recently from 692697d to 24cf58a Compare November 30, 2016 17:56
{
u32 reg, val;
reg = PISTACHIO_GPIO + 0x204 + (((mfio) / 16) * 0x24);
val = 0x10000 | ((output) ? (1) : (0));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we get rid of ternary operator by directly ORing output ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am leaving as it is to be consistent with the rest of the code.

@Avinash95 Avinash95 self-assigned this Dec 2, 2016
@ghost ghost force-pushed the task-45 branch 2 times, most recently from e82437d to 71acd09 Compare December 2, 2016 09:09
u32 reg, val;

reg = PISTACHIO_GPIO + 0x208 + (((mfio) / 16) * 0x24);
val = 0x10000 | ((state) ? (1) : (0));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

state is already bool, why do we need ternary operator ?

@@ -103,23 +103,20 @@ static struct pistachio_mfio_reg pistachio_mfio_regs[] =
{MFIO_89_FUNC_SEL_START, MFIO_89_FUNC_SEL_END},
};

static void pistachio_select_gpio(u32 mfio, bool gpio)
static void pistachio_select_gpio(u32 mfio, bool output)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of pistachio_select_gpio(), can we name it pistachio_configure_gpio() ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

void mfio_setup_led(void)
{
/* make GPIO output */
pistachio_select_gpio(76, 1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have macro for this, as GPIO_OUTPUT and GPIO_INPUT

@Avinash95 Avinash95 removed their assignment Dec 2, 2016
pistachio_select_gpio configures gpio as an input or an output.
Inputs are configured not to generate interrupts.

Signed-off-by: Francois Berder <francois.berder@imgtec.com>
Signed-off-by: Francois Berder <francois.berder@imgtec.com>
Signed-off-by: Francois Berder <francois.berder@imgtec.com>
@ghost ghost force-pushed the task-45 branch 3 times, most recently from e28c861 to 9745177 Compare December 2, 2016 13:56
Signed-off-by: Francois Berder <francois.berder@imgtec.com>
Copy link
Member

@Ham22 Ham22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and see it working and nothing else seems to be broken

@Ham22 Ham22 merged commit 31a08e5 into CreatorDev:2015.10 Dec 2, 2016
@Ham22 Ham22 removed the s: review label Dec 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants