Matt Kemp was unhappy when the weekend began. He had just been activated from the disabled list the morning of the Dodgers’ home opener, but his name wasn’t in the starting lineup.

That changed about an hour later, when Yasiel Puig arrived late for Friday morning’s batting practice at Dodger Stadium. Kemp started the game and ultimately played every inning over the weekend.

By Sunday, it was almost impossible for manager Don Mattingly to take Kemp out of the lineup again. The Dodgers’ center fielder hit two home runs against San Francisco’s Matt Cain and the Dodgers salvaged the finale of the three-game series, beating the Giants 5-2.

Hanley Ramirez hit two home runs (0-1) of his own, including a solo blast off Cain in the third inning that was conservatively estimated at 422 feet. He also doubled in a 3-for-4 performance.

Dodgers pitcher Zack Greinke (2-0) and first baseman Adrian Gonzalez also doubled as all seven of the Dodgers’ hits went for extra bases.

Greinke survived a pair of solo home runs by Brandon Belt and Hunter Pence in the sixth inning. In his second start of the season, the right-hander scattered six hits, walked none and struck out eight in six innings.

Relievers Chris Withrow, J.P. Howell, Chris Perez and Kenley Jansen combined to strike out seven in three scoreless innings.

Puig was out of the lineup again Sunday with an injury to his left thumb.

Although an x-ray on Puig’s wrist Saturday night was negative, he underwent an MRI exam before Sunday’s game and did not play. He was seen on the bench wearing a protective shield over his left hand.